pyvista.DataSet.cast_to_poly_points

pyvista.DataSet.cast_to_poly_points#

DataSet.cast_to_poly_points(
pass_cell_data: bool = False,
) PolyData[source]#

Extract the points of this dataset and return a pyvista.PolyData.

Parameters:
pass_cell_databool, default: False

Run the cell_data_to_point_data() filter and pass cell data fields to the new pointset.

Returns:
pyvista.PolyData

Dataset cast into a pyvista.PolyData.

Notes

This will produce a deep copy of the points and point/cell data of the original mesh.

Examples

>>> from pyvista import examples
>>> mesh = examples.load_uniform()
>>> points = mesh.cast_to_poly_points(pass_cell_data=True)
>>> type(points)
<class 'pyvista.core.pointset.PolyData'>
>>> points.n_arrays
2
>>> points.point_data
pyvista DataSetAttributes
Association     : POINT
Active Scalars  : Spatial Point Data
Active Vectors  : None
Active Texture  : None
Active Normals  : None
Contains arrays :
    Spatial Point Data      float64    (1000,)              SCALARS
>>> points.cell_data
pyvista DataSetAttributes
Association     : CELL
Active Scalars  : None
Active Vectors  : None
Active Texture  : None
Active Normals  : None
Contains arrays :
    Spatial Cell Data       float64    (1000,)