Skip to content

Commit f6447de

Browse files
committed
Fix some bugs
1 parent 0cc8627 commit f6447de

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

examples/Animation.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@
280280
"metadata": {},
281281
"outputs": [],
282282
"source": [
283+
"# This lets three.js create the geometry, then syncs back vertex positions etc.\n",
284+
"# For this reason, you should allow for the sync to complete before executing the next cell\n",
283285
"morph = PlainBufferGeometry.from_geometry(SphereBufferGeometry(1, 32, 16))"
284286
]
285287
},

examples/superellipsoid.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"y_box = np.concatenate((-np.ones(n-1), np.linspace(-1, 1., n), np.ones(n-2), np.linspace(1, -1., n-1, endpoint=False)))\n",
3030
"nx_box = x_box.size\n",
3131
"\n",
32-
"coords = np.empty((nx_box**2, 3))\n",
32+
"coords = np.empty((nx_box**2, 3), dtype=np.float32)\n",
3333
"\n",
3434
"def superellipse(rx, ry, m):\n",
3535
" \"\"\"\n",
@@ -176,6 +176,7 @@
176176
" superellipsoid(rx_slider.value, ry_slider.value, rz_slider.value, \n",
177177
" m1_slider.value, m2_slider.value)\n",
178178
" coordinate_widget.array = coords\n",
179+
" coordinate_widget.notify_changed()\n",
179180
" \n",
180181
"m1_slider.observe(update, names=['value'])\n",
181182
"m2_slider.observe(update, names=['value'])\n",

pythreejs/geometries/PlainBufferGeometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def validate(self, proposal):
2222

2323
if 'index' in value:
2424
# We treat index special, so we might as well do some checking:
25-
idx = value['index']
25+
idx = value['index'].array
2626
array = idx.array if isinstance(idx, NDArrayWidget) else idx
2727
if array.dtype.kind != 'u':
2828
raise TraitError('Index attribute must have unsigned integer data')

0 commit comments

Comments
 (0)