Skip to content

Commit 17d874f

Browse files
committed
js engine rework
1 parent 1d3c144 commit 17d874f

20 files changed

Lines changed: 257 additions & 189 deletions

docs/Quickstart.ipynb

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,23 @@
125125
}
126126
],
127127
"metadata": {
128-
"kernelspec": {"display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3"},
129-
"language_info": {"name": "python", "version": "3.14.3"}
128+
"kernelspec": {
129+
"display_name": "Python 3 (ipykernel)",
130+
"language": "python",
131+
"name": "python3"
132+
},
133+
"language_info": {
134+
"codemirror_mode": {
135+
"name": "ipython",
136+
"version": 3
137+
},
138+
"file_extension": ".py",
139+
"mimetype": "text/x-python",
140+
"name": "python",
141+
"nbconvert_exporter": "python",
142+
"pygments_lexer": "ipython3",
143+
"version": "3.14.5"
144+
}
130145
},
131146
"nbformat": 4,
132147
"nbformat_minor": 5

docs/animation.ipynb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@
9494
" gf.Interpolate(f)\n",
9595
" ani.add_time()\n",
9696
"\n",
97-
"scene = Draw([ani, Colorbar(cfr.colormap)])\n",
98-
"ani.add_options_to_gui(scene.gui)"
97+
"Draw([ani, Colorbar(cfr.colormap)])"
9998
]
10099
},
101100
{
@@ -112,8 +111,23 @@
112111
}
113112
],
114113
"metadata": {
115-
"kernelspec": {"display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3"},
116-
"language_info": {"name": "python", "version": "3.14.3"}
114+
"kernelspec": {
115+
"display_name": "Python 3 (ipykernel)",
116+
"language": "python",
117+
"name": "python3"
118+
},
119+
"language_info": {
120+
"codemirror_mode": {
121+
"name": "ipython",
122+
"version": 3
123+
},
124+
"file_extension": ".py",
125+
"mimetype": "text/x-python",
126+
"name": "python",
127+
"nbconvert_exporter": "python",
128+
"pygments_lexer": "ipython3",
129+
"version": "3.14.5"
130+
}
117131
},
118132
"nbformat": 4,
119133
"nbformat_minor": 5

docs/clipping.ipynb

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"source": [
1818
"## Clipping a 3D Mesh\n",
1919
"\n",
20-
"`Clipping` controls the plane position and orientation. `add_options_to_gui` adds interactive sliders for normal direction and position."
20+
"`Clipping` controls the plane position and orientation. The GUI automatically provides interactive sliders for normal direction and position."
2121
]
2222
},
2323
{
@@ -40,9 +40,7 @@
4040
"\n",
4141
"volume_elements = MeshElements3d(meshdata, clipping=clipping)\n",
4242
"volume_elements.shrink = 0.8\n",
43-
"scene = Draw(volume_elements)\n",
44-
"volume_elements.add_options_to_gui(scene.gui)\n",
45-
"clipping.add_options_to_gui(scene.gui)"
43+
"scene = Draw(volume_elements)"
4644
]
4745
},
4846
{
@@ -52,7 +50,7 @@
5250
"source": [
5351
"## Clipping a Function (ClippingCF)\n",
5452
"\n",
55-
"`ClippingCF` computes and renders function values on the clipping plane cross-section via a compute shader. `add_options_to_gui` adds enabling/disabling the function on the clipping plane to the clipping menu."
53+
"`ClippingCF` computes and renders function values on the clipping plane cross-section via a compute shader."
5654
]
5755
},
5856
{
@@ -81,9 +79,7 @@
8179
"clip_cf = ClippingCF(function_data, clipping=clipping)\n",
8280
"cfr = CFRenderer(function_data, clipping=clipping, colormap=clip_cf.colormap)\n",
8381
"\n",
84-
"scene = Draw([cfr, clip_cf, Colorbar(clip_cf.colormap)])\n",
85-
"clipping.add_options_to_gui(scene.gui)\n",
86-
"clip_cf.add_options_to_gui(scene.gui)"
82+
"scene = Draw([cfr, clip_cf, Colorbar(clip_cf.colormap)])"
8783
]
8884
},
8985
{
@@ -97,8 +93,7 @@
9793
"|---|---|\n",
9894
"| `clipping.center` | Point on the plane (list of 3 floats) |\n",
9995
"| `clipping.normal` | Plane normal direction (list of 3 floats) |\n",
100-
"| `clipping.mode` | `Clipping.Mode.DISABLED` or `Clipping.Mode.PLANE` |\n",
101-
"| `add_options_to_gui(gui)` | Adds interactive controls |"
96+
"| `clipping.mode` | `Clipping.Mode.DISABLED` or `Clipping.Mode.PLANE` |"
10297
]
10398
}
10499
],
@@ -118,7 +113,7 @@
118113
"name": "python",
119114
"nbconvert_exporter": "python",
120115
"pygments_lexer": "ipython3",
121-
"version": "3.14.3"
116+
"version": "3.14.5"
122117
}
123118
},
124119
"nbformat": 4,

docs/complex_fields.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"name": "python",
314314
"nbconvert_exporter": "python",
315315
"pygments_lexer": "ipython3",
316-
"version": "3.14.4"
316+
"version": "3.14.5"
317317
}
318318
},
319319
"nbformat": 4,

docs/element_boundaries.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@
114114
"renderer = FacetCFRenderer3D(mdata, x + 2 * y, order=2,\n",
115115
" colormap=colormap, clipping=clipping)\n",
116116
"\n",
117-
"scene = Draw([renderer, Colorbar(colormap)])\n",
118-
"clipping.add_options_to_gui(scene.gui)"
117+
"Draw([renderer, Colorbar(colormap)])"
119118
]
120119
},
121120
{
@@ -174,8 +173,7 @@
174173
"renderer = FacetCFRenderer3D(mdata, gf.components[1], order=order,\n",
175174
" colormap=colormap, clipping=clipping)\n",
176175
"\n",
177-
"scene = Draw([renderer, Colorbar(colormap)])\n",
178-
"clipping.add_options_to_gui(scene.gui)"
176+
"Draw([renderer, Colorbar(colormap)])"
179177
]
180178
},
181179
{
@@ -203,7 +201,7 @@
203201
"name": "python",
204202
"nbconvert_exporter": "python",
205203
"pygments_lexer": "ipython3",
206-
"version": "3.14.4"
204+
"version": "3.14.5"
207205
}
208206
},
209207
"nbformat": 4,

docs/entity_numbers.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
"name": "python",
218218
"nbconvert_exporter": "python",
219219
"pygments_lexer": "ipython3",
220-
"version": "3.14.4"
220+
"version": "3.14.5"
221221
}
222222
},
223223
"nbformat": 4,

docs/functions.ipynb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,8 @@
8484
"colormap = Colormap()\n",
8585
"clip = ClippingCF(function_data, clipping=clipping, colormap=colormap)\n",
8686
"cfr = CFRenderer(function_data, colormap=colormap, clipping=clipping)\n",
87-
"cfr.on_component_change(clip.set_component)\n",
8887
"\n",
89-
"scene = Draw([cfr, clip, Colorbar(colormap)])\n",
90-
"clipping.add_options_to_gui(scene.gui)\n",
91-
"cfr.add_options_to_gui(scene.gui)"
88+
"Draw([cfr, clip, Colorbar(colormap)])\n"
9289
]
9390
},
9491
{
@@ -116,7 +113,7 @@
116113
"name": "python",
117114
"nbconvert_exporter": "python",
118115
"pygments_lexer": "ipython3",
119-
"version": "3.14.3"
116+
"version": "3.14.5"
120117
}
121118
},
122119
"nbformat": 4,

docs/geometry.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@
102102
"geo = OCCGeometry(shape)\n",
103103
"clipping = Clipping()\n",
104104
"renderer = GeometryRenderer(geo, clipping=clipping)\n",
105-
"scene = Draw([renderer])\n",
106-
"clipping.add_options_to_gui(scene.gui)"
105+
"Draw([renderer])"
107106
]
108107
},
109108
{
@@ -131,7 +130,7 @@
131130
"name": "python",
132131
"nbconvert_exporter": "python",
133132
"pygments_lexer": "ipython3",
134-
"version": "3.14.3"
133+
"version": "3.14.5"
135134
}
136135
},
137136
"nbformat": 4,

docs/isosurface.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@
5555
"neg_clip = NegativeClippingRenderer(func_data, levelset_data, clipping, colormap)\n",
5656
"\n",
5757
"clipping.mode = clipping.Mode.PLANE\n",
58-
"scene = Draw([iso, neg_clip, neg_surface, Colorbar(colormap)])\n",
59-
"clipping.add_options_to_gui(scene.gui)"
58+
"scene = Draw([iso, neg_clip, neg_surface, Colorbar(colormap)])"
6059
]
6160
},
6261
{
@@ -117,7 +116,7 @@
117116
"name": "python",
118117
"nbconvert_exporter": "python",
119118
"pygments_lexer": "ipython3",
120-
"version": "3.14.3"
119+
"version": "3.14.5"
121120
}
122121
},
123122
"nbformat": 4,

docs/mesh.ipynb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
"surface_elements = MeshElements2d(meshdata, clipping=clipping)\n",
4343
"wireframe = MeshWireframe2d(meshdata, clipping=clipping)\n",
4444
"\n",
45-
"scene = Draw([surface_elements, wireframe])\n",
46-
"clipping.add_options_to_gui(scene.gui)"
45+
"Draw([surface_elements, wireframe])"
4746
]
4847
},
4948
{
@@ -75,9 +74,7 @@
7574
"# clipping.mode = clipping.Mode.PLANE # enables clipping\n",
7675
"volume_elements = MeshElements3d(meshdata, clipping=clipping)\n",
7776
"volume_elements.shrink = 0.8\n",
78-
"scene = Draw(volume_elements)\n",
79-
"volume_elements.add_options_to_gui(scene.gui)\n",
80-
"clipping.add_options_to_gui(scene.gui)"
77+
"Draw(volume_elements)"
8178
]
8279
},
8380
{
@@ -164,14 +161,21 @@
164161
"surface_elements = MeshElements2d(meshdata, clipping=clipping)\n",
165162
"segments = MeshSegments(meshdata, clipping=clipping)\n",
166163
"\n",
167-
"scene = Draw([surface_elements, segments])\n",
168-
"clipping.add_options_to_gui(scene.gui)"
164+
"Draw([surface_elements, segments])"
169165
]
166+
},
167+
{
168+
"cell_type": "code",
169+
"execution_count": null,
170+
"id": "2b4d6378-c67b-49e5-993f-1f328a0360cb",
171+
"metadata": {},
172+
"outputs": [],
173+
"source": []
170174
}
171175
],
172176
"metadata": {
173177
"kernelspec": {
174-
"display_name": "Python 3",
178+
"display_name": "Python 3 (ipykernel)",
175179
"language": "python",
176180
"name": "python3"
177181
},
@@ -185,7 +189,7 @@
185189
"name": "python",
186190
"nbconvert_exporter": "python",
187191
"pygments_lexer": "ipython3",
188-
"version": "3.13.11"
192+
"version": "3.14.5"
189193
}
190194
},
191195
"nbformat": 4,

0 commit comments

Comments
 (0)