pyvista_cad.to_cadquery

On this page

pyvista_cad.to_cadquery#

to_cadquery(mesh)[source]#

Wrap a pyvista.PolyData as a faceted cadquery.Workplane.

The mesh is converted to an OCCT TopoDS shell and wrapped in a cadquery.Compound on a default XY workplane.

Parameters:
meshpyvista.PolyData

Surface mesh to convert.

Returns:
cadquery.Workplane

Workplane wrapping a faceted Compound. Analytical surface information is lost.

Raises:
pyvista_cad.OptionalDependencyError

If cadquery is not installed.

Parameters:

mesh (pv.PolyData)

Return type:

Any

See also

from_cadquery

Inverse conversion.

Examples

>>> import pyvista as pv
>>> from pyvista_cad import to_cadquery
>>> wp = to_cadquery(pv.Sphere())
>>> wp.val().Volume() > 0
True