Skip to content

Commit 25be4fc

Browse files
author
Littie28
committed
examples: updated notebooks
Changes: - formatted imports - removed obsolete np.array call in np.hstack
1 parent f57be58 commit 25be4fc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/01-surface_intersections.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@
2525
"metadata": {},
2626
"outputs": [],
2727
"source": [
28-
"from hazy import Frame, Point, Vector\n",
29-
"from dataclasses import dataclass"
28+
"from dataclasses import dataclass\n",
29+
"\n",
30+
"import numpy as np\n",
31+
"import matplotlib.pyplot as plt\n",
32+
"\n",
33+
"from hazy import Frame, Point, Vector"
3034
]
3135
},
3236
{
@@ -218,8 +222,6 @@
218222
"metadata": {},
219223
"outputs": [],
220224
"source": [
221-
"import numpy as np\n",
222-
"\n",
223225
"distance_traveled = (intersection_global - simple_ray.origin.to_global()).magnitude\n",
224226
"print(f\"Distance ray traveled: {distance_traveled:.2f} units\")\n",
225227
"\n",
@@ -269,8 +271,6 @@
269271
"metadata": {},
270272
"outputs": [],
271273
"source": [
272-
"import matplotlib.pyplot as plt\n",
273-
"\n",
274274
"complex_ray_frame = (\n",
275275
" root.make_child(\"complex_ray\").translate(x=-2, z=1).rotate_euler(y=10, degrees=True)\n",
276276
")\n",

examples/02-frame-hierarchies.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
" end_point = laser.origin + laser.direction * (i + 1) / 5\n",
115115
" end_global = end_point.to_global()\n",
116116
"\n",
117-
" laser_line = np.vstack([np.array(origin_global), np.array(end_global)])\n",
117+
" laser_line = np.vstack([origin_global, end_global])\n",
118118
"\n",
119119
" ax.plot(*laser_line[:, :2].T, color=colors[i], linewidth=2, alpha=0.8)\n",
120120
"\n",

0 commit comments

Comments
 (0)