MCPcopy
hub / github.com/CadQuery/cadquery / test_ctrlPts

Function test_ctrlPts

tests/test_vis.py:169–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167
168
169def test_ctrlPts():
170
171 c = circle(1)
172
173 # non-NURBS objects throw
174 with raises(ValueError):
175 ctrlPts(c)
176
177 # control points of a curve
178 a1 = ctrlPts(c.toNURBS())
179 assert isinstance(a1, vtkActor)
180
181 # control points of a non-periodic curve
182 a2 = ctrlPts(c.trim(0, 1).toNURBS())
183 assert isinstance(a2, vtkActor)
184
185 # non-NURBS objects throw
186 with raises(ValueError):
187 ctrlPts(plane(1, 1))
188
189 # control points of a surface
190 a3 = ctrlPts(sweep(c.trim(0, 1), spline((0, 0, 0), (0, 0, 1))))
191 assert isinstance(a3, vtkActor)
192
193 # control points of a u,v periodic surface
194 a4 = ctrlPts(torus(5, 1).faces().toNURBS())
195 assert isinstance(a4, vtkActor)
196
197
198def test_style(wp, assy):

Callers

nothing calls this directly

Calls 9

ctrlPtsFunction · 0.90
circleFunction · 0.85
planeFunction · 0.85
sweepFunction · 0.85
splineFunction · 0.85
torusFunction · 0.85
toNURBSMethod · 0.80
trimMethod · 0.45
facesMethod · 0.45

Tested by

no test coverage detected