pyvista.PointSet.cast_to_unstructured_grid#

PointSet.cast_to_unstructured_grid() UnstructuredGrid[source]#

Cast this dataset to pyvista.UnstructuredGrid.

A deep copy of the points and point data is made.

Returns:
pyvista.UnstructuredGrid

Dataset cast to a pyvista.UnstructuredGrid.

Examples

Cast a pyvista.PointSet to a pyvista.UnstructuredGrid.

>>> import pyvista as pv
>>> from pyvista import examples
>>> mesh = examples.download_cloud_dark_matter()
>>> type(mesh)
<class 'pyvista.core.pointset.PointSet'>
>>> grid = mesh.cast_to_unstructured_grid()
>>> type(grid)
<class 'pyvista.core.pointset.UnstructuredGrid'>