MCPcopy Create free account
hub / github.com/CadQuery/cadquery / test_toVTK

Function test_toVTK

tests/test_exporters.py:1034–1054  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1032
1033
1034def test_toVTK():
1035
1036 from cadquery.occ_impl.assembly import toVTK
1037
1038 assy = Assembly().add(face(rect(10, 0.5)))
1039
1040 renderer = toVTK(assy)
1041 actors = renderer.GetActors()
1042 actors.InitTraversal()
1043
1044 assert actors.GetNumberOfItems() == 2
1045
1046 face_actor = actors.GetNextActor()
1047 face_data = face_actor.GetMapper().GetInput()
1048 assert face_data.GetNumberOfPolys() > 0
1049 assert face_data.GetNumberOfLines() == 0
1050
1051 edge_actor = actors.GetNextActor()
1052 edge_data = edge_actor.GetMapper().GetInput()
1053 assert edge_data.GetNumberOfLines() > 0
1054 assert edge_data.GetNumberOfPolys() == 0

Callers

nothing calls this directly

Calls 5

AssemblyClass · 0.90
faceFunction · 0.90
rectFunction · 0.90
toVTKFunction · 0.90
addMethod · 0.45

Tested by

no test coverage detected