Skip to content

Commit 3511b47

Browse files
author
cuttlefisch
committed
curvier example, fix pytest expected path
1 parent 6267314 commit 3511b47

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

solid/examples/hobby_splines_example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
def assembly():
1818
knot_points = [
1919
Point3(0, 0, -1),
20-
Point3(1, 3, -2),
21-
Point3(2, 1, 1),
20+
Point3(1, -2, -2),
21+
Point3(2, 0, 1),
2222
Point3(3, -1, 2),
23-
Point3(0, -4, 0),
23+
Point3(3, 1, -2),
2424
]
2525
knot_points = [kp * SCALE for kp in knot_points]
2626
path = splines.hobby_points(knot_points, OMEGA, close_loop=True)

solid/test/test_splines.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ def test_hobby_points(self):
124124
Point3(1.00, 1.00, 0.00),
125125
Point3(1.33, 1.12, 0.00),
126126
Point3(1.71, 1.19, 0.00),
127+
Point3(2.00, 1.00, 0.00),
128+
Point3(2.63, 0.60, 0.00),
129+
Point3(2.35, -0.28, 0.00),
127130
Point3(2.00, -1.00, 0.00),
128131
]
129132

@@ -133,11 +136,19 @@ def test_hobby_points(self):
133136
def test_hobby_points_raw(self):
134137
expected = [
135138
Point3(0.00, 0.00, 0.00),
136-
Point3(-0.10, 0.54, 0.00),
137-
Point3(0.43, 0.91, 0.00),
139+
Point3(0.07, 0.50, 0.00),
140+
Point3(0.52, 0.82, 0.00),
141+
Point3(1.00, 1.00, 0.00),
142+
Point3(1.33, 1.12, 0.00),
143+
Point3(1.71, 1.19, 0.00),
138144
Point3(2.00, 1.00, 0.00),
145+
Point3(2.63, 0.60, 0.00),
146+
Point3(2.35, -0.28, 0.00),
147+
Point3(2.00, -1.00, 0.00),
139148
]
140-
actual = hobby_points(self.points_raw, self.hobby_omega, close_loop=False)
149+
actual = hobby_points(
150+
self.bezier_controls_raw, self.hobby_omega, close_loop=False
151+
)
141152
self.assertPointsListsEqual(expected, actual)
142153

143154
def test_hobby_points_3d(self):
@@ -154,6 +165,9 @@ def test_hobby_points_3d(self):
154165
Point3(-0.50, -0.50, 1.00),
155166
Point3(-0.12, -0.22, 1.10),
156167
Point3(0.11, 0.24, 1.13),
168+
Point3(0.50, 0.50, 1.00),
169+
Point3(1.01, 0.84, 0.83),
170+
Point3(1.55, 0.88, 0.44),
157171
Point3(2.00, 1.00, 0.00),
158172
]
159173

0 commit comments

Comments
 (0)