Skip to content

Commit f230a48

Browse files
committed
update examples
1 parent a3cd6ca commit f230a48

File tree

6 files changed

+62
-62
lines changed

6 files changed

+62
-62
lines changed

notebooks/00_basics.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 5,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -54,12 +54,12 @@
5454
{
5555
"data": {
5656
"application/vnd.jupyter.widget-view+json": {
57-
"model_id": "4f3f899780144ac1938a528b5025e7e9",
57+
"model_id": "5074219cbe9e4a31b290282bf3c2ebd9",
5858
"version_major": 2,
5959
"version_minor": 0
6060
},
6161
"text/plain": [
62-
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
62+
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
6363
]
6464
},
6565
"metadata": {},
@@ -68,7 +68,6 @@
6868
],
6969
"source": [
7070
"viewer = Viewer()\n",
71-
"viewer.config.ui.show_sidebar = True\n",
7271
"viewer.scene.add(mesh, color='#cccccc', show_edges=True, vertexsize=0.1)\n",
7372
"viewer.show()"
7473
]

notebooks/10_scene.ipynb

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 32,
5+
"execution_count": 15,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 33,
15+
"execution_count": 16,
1616
"metadata": {},
1717
"outputs": [],
1818
"source": [
@@ -25,7 +25,7 @@
2525
},
2626
{
2727
"cell_type": "code",
28-
"execution_count": 34,
28+
"execution_count": 17,
2929
"metadata": {},
3030
"outputs": [],
3131
"source": [
@@ -35,18 +35,18 @@
3535
},
3636
{
3737
"cell_type": "code",
38-
"execution_count": 35,
38+
"execution_count": 18,
3939
"metadata": {},
4040
"outputs": [
4141
{
4242
"data": {
4343
"application/vnd.jupyter.widget-view+json": {
44-
"model_id": "14f00c69ebfa47ddbe57f51eddfaadc9",
44+
"model_id": "c238c41d3c4c40cab23ad94bc43826cb",
4545
"version_major": 2,
4646
"version_minor": 0
4747
},
4848
"text/plain": [
49-
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
49+
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
5050
]
5151
},
5252
"metadata": {},
@@ -62,7 +62,7 @@
6262
},
6363
{
6464
"cell_type": "code",
65-
"execution_count": 36,
65+
"execution_count": 19,
6666
"metadata": {},
6767
"outputs": [
6868
{
@@ -74,31 +74,12 @@
7474
}
7575
],
7676
"source": [
77-
"print(viewer.scene.tree)"
77+
"print(viewer.scene)"
7878
]
7979
},
8080
{
8181
"cell_type": "code",
82-
"execution_count": 37,
83-
"metadata": {},
84-
"outputs": [
85-
{
86-
"name": "stdout",
87-
"output_type": "stream",
88-
"text": [
89-
"└── <TreeNode: ROOT>\n",
90-
" ├── <ThreeBoxObject: Box>\n",
91-
" └── <ThreeMeshObject: Mesh>\n"
92-
]
93-
}
94-
],
95-
"source": [
96-
"viewer.scene.tree.print_hierarchy()"
97-
]
98-
},
99-
{
100-
"cell_type": "code",
101-
"execution_count": 38,
82+
"execution_count": 20,
10283
"metadata": {},
10384
"outputs": [
10485
{
@@ -107,18 +88,18 @@
10788
"<TreeNode: ROOT>"
10889
]
10990
},
110-
"execution_count": 38,
91+
"execution_count": 20,
11192
"metadata": {},
11293
"output_type": "execute_result"
11394
}
11495
],
11596
"source": [
116-
"viewer.scene.tree.root"
97+
"viewer.scene.root"
11798
]
11899
},
119100
{
120101
"cell_type": "code",
121-
"execution_count": 39,
102+
"execution_count": 21,
122103
"metadata": {},
123104
"outputs": [
124105
{
@@ -127,18 +108,18 @@
127108
"[<ThreeBoxObject: Box>, <ThreeMeshObject: Mesh>]"
128109
]
129110
},
130-
"execution_count": 39,
111+
"execution_count": 21,
131112
"metadata": {},
132113
"output_type": "execute_result"
133114
}
134115
],
135116
"source": [
136-
"viewer.scene.tree.root.children"
117+
"viewer.scene.root.children"
137118
]
138119
},
139120
{
140121
"cell_type": "code",
141-
"execution_count": 40,
122+
"execution_count": 22,
142123
"metadata": {},
143124
"outputs": [
144125
{
@@ -147,18 +128,18 @@
147128
"<ThreeBoxObject: Box>"
148129
]
149130
},
150-
"execution_count": 40,
131+
"execution_count": 22,
151132
"metadata": {},
152133
"output_type": "execute_result"
153134
}
154135
],
155136
"source": [
156-
"viewer.scene.tree.root.children[0]"
137+
"viewer.scene.root.children[0]"
157138
]
158139
},
159140
{
160141
"cell_type": "code",
161-
"execution_count": 41,
142+
"execution_count": 23,
162143
"metadata": {},
163144
"outputs": [
164145
{
@@ -167,13 +148,13 @@
167148
"<TreeNode: ROOT>"
168149
]
169150
},
170-
"execution_count": 41,
151+
"execution_count": 23,
171152
"metadata": {},
172153
"output_type": "execute_result"
173154
}
174155
],
175156
"source": [
176-
"viewer.scene.tree.root.children[0].parent"
157+
"viewer.scene.root.children[0].parent"
177158
]
178159
}
179160
],

notebooks/20_geometry.ipynb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,27 @@
3737
},
3838
{
3939
"cell_type": "code",
40-
"execution_count": 7,
40+
"execution_count": 4,
4141
"metadata": {},
4242
"outputs": [
43+
{
44+
"name": "stdout",
45+
"output_type": "stream",
46+
"text": [
47+
"PyThreeJS Model elements registered.\n",
48+
"PyThreeJS SceneObjects registered.\n",
49+
"TNA Notebook SceneObjects registered.\n"
50+
]
51+
},
4352
{
4453
"data": {
4554
"application/vnd.jupyter.widget-view+json": {
46-
"model_id": "1765ca6cd7b74861bda14b7a22ac7087",
55+
"model_id": "b35465690efb4ca0b49f14eed9056963",
4756
"version_major": 2,
4857
"version_minor": 0
4958
},
5059
"text/plain": [
51-
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
60+
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
5261
]
5362
},
5463
"metadata": {},
@@ -57,7 +66,6 @@
5766
],
5867
"source": [
5968
"viewer = Viewer()\n",
60-
"viewer.config.ui.sidebar.show = False\n",
6169
"\n",
6270
"viewer.scene.add(point, color=Color.red(), pointsize=0.3)\n",
6371
"viewer.scene.add(line)\n",

notebooks/30_shapes.ipynb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,27 @@
4848
},
4949
{
5050
"cell_type": "code",
51-
"execution_count": 5,
51+
"execution_count": 4,
5252
"metadata": {},
5353
"outputs": [
54+
{
55+
"name": "stdout",
56+
"output_type": "stream",
57+
"text": [
58+
"PyThreeJS Model elements registered.\n",
59+
"PyThreeJS SceneObjects registered.\n",
60+
"TNA Notebook SceneObjects registered.\n"
61+
]
62+
},
5463
{
5564
"data": {
5665
"application/vnd.jupyter.widget-view+json": {
57-
"model_id": "c91f7f708b5e440580f325b799037ac2",
66+
"model_id": "6003d61fe7e94edc8bf51749ff8792d2",
5867
"version_major": 2,
5968
"version_minor": 0
6069
},
6170
"text/plain": [
62-
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
71+
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
6372
]
6473
},
6574
"metadata": {},
@@ -68,7 +77,6 @@
6877
],
6978
"source": [
7079
"viewer = Viewer()\n",
71-
"viewer.config.ui.sidebar.show = False\n",
7280
"\n",
7381
"for point in cloud:\n",
7482
" viewer.scene.add(point, pointsize=0.1)\n",

notebooks/60_breps.ipynb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
{
4545
"cell_type": "code",
46-
"execution_count": 5,
46+
"execution_count": 4,
4747
"metadata": {},
4848
"outputs": [
4949
{
@@ -58,12 +58,12 @@
5858
{
5959
"data": {
6060
"application/vnd.jupyter.widget-view+json": {
61-
"model_id": "1105de51e4a04d70a0e66d85d9256261",
61+
"model_id": "47bf97db5a45479f9a9873245f129932",
6262
"version_major": 2,
6363
"version_minor": 0
6464
},
6565
"text/plain": [
66-
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
66+
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
6767
]
6868
},
6969
"metadata": {},
@@ -72,9 +72,6 @@
7272
],
7373
"source": [
7474
"viewer = Viewer()\n",
75-
"viewer.config.ui.sidebar.show = False\n",
76-
"viewer.config.view.show_axes = False\n",
77-
"\n",
7875
"viewer.scene.clear()\n",
7976
"viewer.scene.add(result, color=Color.grey().lightened(50))\n",
8077
"viewer.show()"

notebooks/70_graphs.ipynb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,27 @@
3434
},
3535
{
3636
"cell_type": "code",
37-
"execution_count": 6,
37+
"execution_count": 4,
3838
"metadata": {},
3939
"outputs": [
40+
{
41+
"name": "stdout",
42+
"output_type": "stream",
43+
"text": [
44+
"PyThreeJS Model elements registered.\n",
45+
"PyThreeJS SceneObjects registered.\n",
46+
"TNA Notebook SceneObjects registered.\n"
47+
]
48+
},
4049
{
4150
"data": {
4251
"application/vnd.jupyter.widget-view+json": {
43-
"model_id": "beef96c8b33443a9bdc20ebf8f70886a",
52+
"model_id": "8d7996e04a9f471b9aa7868801f32ad0",
4453
"version_major": 2,
4554
"version_minor": 0
4655
},
4756
"text/plain": [
48-
"VBox(children=(HBox(children=(Button(icon='folder-open', layout=Layout(height='32px', width='48px'), style=But…"
57+
"VBox(children=(HBox(children=(Button(icon='search-plus', layout=Layout(height='32px', width='48px'), style=But…"
4958
]
5059
},
5160
"metadata": {},
@@ -54,8 +63,6 @@
5463
],
5564
"source": [
5665
"viewer = Viewer()\n",
57-
"viewer.config.view.show_axes = False\n",
58-
"\n",
5966
"viewer.scene.add(graph, color=Color.grey().lightened(50), nodesize=0.1)\n",
6067
"viewer.show()"
6168
]

0 commit comments

Comments
 (0)