pyvista.PointSet#

class PointSet(*args, **kwargs)[source]#

Concrete class for storing a set of points.

This is a concrete class representing a set of points that specifies the interface for datasets that explicitly use “point” arrays to represent geometry. This class is useful for improving the performance of filters on point clouds, but not plotting.

For further details see VTK: vtkPointSet Details.

Parameters:
var_inpvtk.vtkPointSet, Matrix, optional

Flexible input type. Can be a vtk.vtkPointSet, in which case this PointSet object will be copied if deep=True and will be a shallow copy if deep=False.

List, numpy array, or sequence containing point locations. Must be an (N, 3) array of points.

deepbool, default: False

Whether to copy the input points, or to create a PointSet from them without copying them. Setting deep=True ensures that the original arrays can be modified outside the mesh without affecting the mesh.

force_floatbool, default: True

Casts the datatype to float32 if points datatype is non-float. Set this to False to allow non-float types, though this may lead to truncation of intermediate floats when transforming datasets.

Notes

This class requires vtk>=9.1.0. This is an abstract class in vtk<9.1.0 and cannot be instantiated.

Examples

Create a simple point cloud of 10 points from a numpy array.

>>> import numpy as np
>>> import pyvista as pv
>>> rng = np.random.default_rng()
>>> points = rng.random((10, 3))
>>> pset = pv.PointSet(points)

Plot the pointset. Note: this casts to a pyvista.PolyData internally when plotting.

>>> pset.plot(point_size=10)
../../../_images/pyvista-PointSet-1_00_00.png

Methods

PointSet.cast_to_polydata([deep])

Cast this dataset to polydata.

PointSet.cell_data_to_point_data(*args, **kwargs)

Raise PointSets do not have cells.

PointSet.contour(*args, **kwargs)

Raise dimension reducing operations are not supported.

PointSet.decimate_boundary(*args, **kwargs)

Raise cell operations are not supported.

PointSet.delaunay_3d([alpha, tol, offset, ...])

Construct a 3D Delaunay triangulation of the mesh.

PointSet.explode([factor])

Push each individual cell away from the center of the dataset.

PointSet.extract_geometry(*args, **kwargs)

Raise extract geometry are not supported.

PointSet.extract_surface(*args, **kwargs)

Raise extract surface are not supported.

PointSet.find_cells_along_line(*args, **kwargs)

Raise cell operations are not supported.

PointSet.plot([off_screen, full_screen, ...])

Plot a PyVista, numpy, or vtk object.

PointSet.point_data_to_cell_data(*args, **kwargs)

Raise PointSets do not have cells.

PointSet.point_is_inside_cell(*args, **kwargs)

Raise cell operations are not supported.

PointSet.remove_cells(*args, **kwargs)

Raise cell operations are not supported.

PointSet.separate_cells(*args, **kwargs)

Raise cell operations are not supported.

PointSet.shrink(*args, **kwargs)

Raise cell operations are not supported.

PointSet.slice(*args, **kwargs)

Raise dimension reducing operations are not supported.

PointSet.slice_along_axis(*args, **kwargs)

Raise dimension reducing operations are not supported.

PointSet.slice_along_line(*args, **kwargs)

Raise dimension reducing operations are not supported.

PointSet.slice_implicit(*args, **kwargs)

Raise dimension reducing operations are not supported.

PointSet.slice_orthogonal(*args, **kwargs)

Raise dimension reducing operations are not supported.

PointSet.tessellate(*args, **kwargs)

Raise cell operations are not supported.

PointSet.threshold([value, scalars, invert, ...])

Apply a vtkThreshold filter to the input dataset.

PointSet.threshold_percent([percent, ...])

Threshold the dataset by a percentage of its range on the active scalars array.

PointSet.triangulate(*args, **kwargs)

Raise cell operations are not supported.

Attributes

PointSet.area

Return 0.0 since a PointSet has no area.

PointSet.volume

Return 0.0 since a PointSet has no volume.