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

Function extractEdgesFaces

cadquery/occ_impl/exporters/vtk.py:16–40  ·  view source on GitHub ↗

Helper for edges and faces extraction

(data: vtkPolyData)

Source from the content-addressed store, hash-verified

14
15
16def extractEdgesFaces(data: vtkPolyData) -> tuple[vtkPolyData, vtkPolyData]:
17 """Helper for edges and faces extraction"""
18
19 # extract edges
20 extr = vtkExtractCellsByType()
21 extr.SetInputDataObject(data)
22
23 extr.AddCellType(VTK_LINE)
24 extr.AddCellType(VTK_POLY_LINE)
25 extr.AddCellType(VTK_VERTEX)
26 extr.Update()
27 data_edges = extr.GetOutput()
28
29 # extract faces
30 extr = vtkExtractCellsByType()
31 extr.SetInputDataObject(data)
32
33 extr.AddCellType(VTK_TRIANGLE)
34 extr.Update()
35 data_faces = extr.GetOutput()
36
37 # remove normals from edges
38 data_edges.GetPointData().RemoveArray("Normals")
39
40 return data_edges, data_faces
41
42
43def exportVTP(

Callers 3

toVTKAssyFunction · 0.85
toVTKFunction · 0.85
toStringFunction · 0.85

Calls 1

UpdateMethod · 0.80

Tested by

no test coverage detected