Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed May 12, 2024
1 parent a3cd6ca commit f230a48
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 62 deletions.
7 changes: 3 additions & 4 deletions notebooks/00_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -54,12 +54,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4f3f899780144ac1938a528b5025e7e9",
"model_id": "5074219cbe9e4a31b290282bf3c2ebd9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
]
},
"metadata": {},
Expand All @@ -68,7 +68,6 @@
],
"source": [
"viewer = Viewer()\n",
"viewer.config.ui.show_sidebar = True\n",
"viewer.scene.add(mesh, color='#cccccc', show_edges=True, vertexsize=0.1)\n",
"viewer.show()"
]
Expand Down
59 changes: 20 additions & 39 deletions notebooks/10_scene.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -35,18 +35,18 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "14f00c69ebfa47ddbe57f51eddfaadc9",
"model_id": "c238c41d3c4c40cab23ad94bc43826cb",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
]
},
"metadata": {},
Expand All @@ -62,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 19,
"metadata": {},
"outputs": [
{
Expand All @@ -74,31 +74,12 @@
}
],
"source": [
"print(viewer.scene.tree)"
"print(viewer.scene)"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"└── <TreeNode: ROOT>\n",
" ├── <ThreeBoxObject: Box>\n",
" └── <ThreeMeshObject: Mesh>\n"
]
}
],
"source": [
"viewer.scene.tree.print_hierarchy()"
]
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 20,
"metadata": {},
"outputs": [
{
Expand All @@ -107,18 +88,18 @@
"<TreeNode: ROOT>"
]
},
"execution_count": 38,
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"viewer.scene.tree.root"
"viewer.scene.root"
]
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 21,
"metadata": {},
"outputs": [
{
Expand All @@ -127,18 +108,18 @@
"[<ThreeBoxObject: Box>, <ThreeMeshObject: Mesh>]"
]
},
"execution_count": 39,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"viewer.scene.tree.root.children"
"viewer.scene.root.children"
]
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 22,
"metadata": {},
"outputs": [
{
Expand All @@ -147,18 +128,18 @@
"<ThreeBoxObject: Box>"
]
},
"execution_count": 40,
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"viewer.scene.tree.root.children[0]"
"viewer.scene.root.children[0]"
]
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 23,
"metadata": {},
"outputs": [
{
Expand All @@ -167,13 +148,13 @@
"<TreeNode: ROOT>"
]
},
"execution_count": 41,
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"viewer.scene.tree.root.children[0].parent"
"viewer.scene.root.children[0].parent"
]
}
],
Expand Down
16 changes: 12 additions & 4 deletions notebooks/20_geometry.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,27 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"PyThreeJS Model elements registered.\n",
"PyThreeJS SceneObjects registered.\n",
"TNA Notebook SceneObjects registered.\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1765ca6cd7b74861bda14b7a22ac7087",
"model_id": "b35465690efb4ca0b49f14eed9056963",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
]
},
"metadata": {},
Expand All @@ -57,7 +66,6 @@
],
"source": [
"viewer = Viewer()\n",
"viewer.config.ui.sidebar.show = False\n",
"\n",
"viewer.scene.add(point, color=Color.red(), pointsize=0.3)\n",
"viewer.scene.add(line)\n",
Expand Down
16 changes: 12 additions & 4 deletions notebooks/30_shapes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,27 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"PyThreeJS Model elements registered.\n",
"PyThreeJS SceneObjects registered.\n",
"TNA Notebook SceneObjects registered.\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c91f7f708b5e440580f325b799037ac2",
"model_id": "6003d61fe7e94edc8bf51749ff8792d2",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
]
},
"metadata": {},
Expand All @@ -68,7 +77,6 @@
],
"source": [
"viewer = Viewer()\n",
"viewer.config.ui.sidebar.show = False\n",
"\n",
"for point in cloud:\n",
" viewer.scene.add(point, pointsize=0.1)\n",
Expand Down
9 changes: 3 additions & 6 deletions notebooks/60_breps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -58,12 +58,12 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1105de51e4a04d70a0e66d85d9256261",
"model_id": "47bf97db5a45479f9a9873245f129932",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
]
},
"metadata": {},
Expand All @@ -72,9 +72,6 @@
],
"source": [
"viewer = Viewer()\n",
"viewer.config.ui.sidebar.show = False\n",
"viewer.config.view.show_axes = False\n",
"\n",
"viewer.scene.clear()\n",
"viewer.scene.add(result, color=Color.grey().lightened(50))\n",
"viewer.show()"
Expand Down
17 changes: 12 additions & 5 deletions notebooks/70_graphs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,27 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"PyThreeJS Model elements registered.\n",
"PyThreeJS SceneObjects registered.\n",
"TNA Notebook SceneObjects registered.\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "beef96c8b33443a9bdc20ebf8f70886a",
"model_id": "8d7996e04a9f471b9aa7868801f32ad0",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
]
},
"metadata": {},
Expand All @@ -54,8 +63,6 @@
],
"source": [
"viewer = Viewer()\n",
"viewer.config.view.show_axes = False\n",
"\n",
"viewer.scene.add(graph, color=Color.grey().lightened(50), nodesize=0.1)\n",
"viewer.show()"
]
Expand Down

0 comments on commit f230a48

Please sign in to comment.