MCPcopy Index your code
hub / github.com/CadQuery/cadquery / toString

Function toString

cadquery/occ_impl/exporters/vtk.py:53–73  ·  view source on GitHub ↗
(
    shape: Shape, tolerance: float = 1e-3, angularTolerance: float = 0.1
)

Source from the content-addressed store, hash-verified

51
52
53def toString(
54 shape: Shape, tolerance: float = 1e-3, angularTolerance: float = 0.1
55) -> tuple[str, str]:
56
57 writer_edges = vtkXMLPolyDataWriter()
58 writer_edges.SetWriteToOutputString(True)
59
60 writer_faces = vtkXMLPolyDataWriter()
61 writer_faces.SetWriteToOutputString(True)
62
63 # extract edges and faces
64 data = shape.toVtkPolyData(tolerance, angularTolerance, True)
65 data_edges, data_faces = extractEdgesFaces(data)
66
67 # separate edges and faces
68 writer_edges.SetInputData(data_edges)
69 writer_edges.Write()
70 writer_faces.SetInputData(data_faces)
71 writer_faces.Write()
72
73 return writer_edges.GetOutputString(), writer_faces.GetOutputString()

Callers 2

displayFunction · 0.85
toJSONFunction · 0.85

Calls 3

extractEdgesFacesFunction · 0.85
toVtkPolyDataMethod · 0.80
WriteMethod · 0.80

Tested by

no test coverage detected