pyvista_cad.to_topods

On this page

pyvista_cad.to_topods#

to_topods(mesh)[source]#

Build a faceted TopoDS_Compound from a pyvista.PolyData.

Each triangle becomes a planar OCCT face. Analytical surface information is lost.

Parameters:
meshpyvista.PolyData

Surface mesh to convert.

Returns:
OCP.TopoDS.TopoDS_Compound

Faceted compound.

Raises:
pyvista_cad.OptionalDependencyError

If OCP is not installed.

Parameters:

mesh (pv.PolyData)

Return type:

Any

Examples

Build a faceted OCCT compound from a PyVista sphere (requires the [step] extra):

>>> import pyvista as pv
>>> from pyvista_cad import to_topods
>>> shape = to_topods(pv.Sphere())
>>> type(shape).__name__
'TopoDS_Solid'