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_inp
vtk.vtkPointSet
,Matrix
,optional
Flexible input type. Can be a
vtk.vtkPointSet
, in which case this PointSet object will be copied ifdeep=True
and will be a shallow copy ifdeep=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. Settingdeep=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 toFalse
to allow non-float types, though this may lead to truncation of intermediate floats when transforming datasets.
- var_inp
Notes
This class requires
vtk>=9.1.0
. This is an abstract class invtk<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(seed=0) >>> 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)
Methods
PointSet.cast_to_polydata
([deep])Cast this dataset to polydata.
Cast this dataset to
pyvista.UnstructuredGrid
.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
Return 0.0 since a PointSet has no area.
Return 0.0 since a PointSet has no volume.