pyvista_cad.CadMultiBlockAccessor.flatten_to_polydata

pyvista_cad.CadMultiBlockAccessor.flatten_to_polydata#

CadMultiBlockAccessor.flatten_to_polydata()[source]#

Fuse the entire MultiBlock into one pyvista.PolyData.

Merges every leaf into a single surface mesh (points merged, surface-extracted). Use this when you want one mesh; use flatten() when you want to keep the leaves as separate blocks in a flat MultiBlock.

Returns:
pyvista.PolyData

Concatenation of every leaf block, surface-extracted.

Return type:

PolyData

Examples

>>> import pyvista as pv
>>> import pyvista_cad
>>> tree = pv.MultiBlock([pv.Sphere(), pv.Cube()])
>>> poly = tree.cad.flatten_to_polydata()
>>> isinstance(poly, pv.PolyData)
True