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

Function test_style

tests/test_vis.py:198–239  ·  view source on GitHub ↗
(wp, assy)

Source from the content-addressed store, hash-verified

196
197
198def test_style(wp, assy):
199
200 t = torus(10, 1)
201 e = t.Edges()[0]
202 pts = e.sample(10)[0]
203 locs = e.locations([0, 0.5, 0.75])
204
205 # Shape
206 act = style(t, color="red", alpha=0.5, tubes=True, spheres=True)
207 assert instance_of(act, List[vtkProp3D])
208
209 # Assy
210 act = style(assy, color="red", alpha=0.5, tubes=True, spheres=True)
211 assert instance_of(act, List[vtkProp3D])
212
213 # Workplane
214 act = style(wp, color="red", alpha=0.5, tubes=True, spheres=True)
215 assert instance_of(act, List[vtkProp3D])
216
217 # Shape
218 act = style(e)
219 assert instance_of(act, List[vtkProp3D])
220
221 # Sketch
222 act = style(Sketch().circle(1))
223 assert instance_of(act, List[vtkProp3D])
224
225 # list[Vector]
226 act = style(pts)
227 assert instance_of(act, List[vtkProp3D])
228
229 # list[Location]
230 act = style(locs)
231 assert instance_of(act, List[vtkProp3D])
232
233 # vtkAssembly
234 act = style(style(t))
235 assert instance_of(act, List[vtkProp3D])
236
237 # vtkActor
238 act = style(ctrlPts(e.toNURBS()))
239 assert instance_of(act, List[vtkProp3D])
240
241
242def test_camera_position(wp, patch_vtk):

Callers

nothing calls this directly

Calls 10

styleFunction · 0.90
instance_ofFunction · 0.90
SketchClass · 0.90
ctrlPtsFunction · 0.90
torusFunction · 0.85
EdgesMethod · 0.80
sampleMethod · 0.80
locationsMethod · 0.80
toNURBSMethod · 0.80
circleMethod · 0.45

Tested by

no test coverage detected