- class PointSet(*args, **kwargs)#
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.
Flexible input type. Can be a
vtk.vtkPointSet, in which case this PointSet object will be copied if
deep=Trueand will be a shallow copy if
List, numpy array, or sequence containing point locations. Must be an
(N, 3)array of points.
Whether to copy the input
points, or to create a PointSet from them without copying them. Setting
deep=Trueensures that the original arrays can be modified outside the mesh without affecting the mesh. Default is
Casts the datatype to
float32if points datatype is non-float. Default
True. Set this to
Falseto allow non-float types, though this may lead to truncation of intermediate floats when transforming datasets.
This class requires
vtk>=9.1.0. This is an abstract class in
vtk<9.1.0and cannot be instantiated.
Create a simple point cloud of 10 points from a numpy array.
>>> import numpy as np >>> import pyvista >>> rng = np.random.default_rng() >>> points = rng.random((10, 3)) >>> pset = pyvista.PointSet(points)
Plot the pointset. Note: this casts to a
pyvista.PolyDatainternally when plotting.
Cast this dataset to polydata.
PointSet.plot([off_screen, full_screen, ...])
Plot a PyVista, numpy, or vtk object.