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 vtkPointSet.
- Parameters:
- var_inpvtkPointSet,
MatrixLike[float],optional Flexible input type. Can be a vtkPointSet, in which case this PointSet object will be copied if
deep=Trueand 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=Trueensures that the original arrays can be modified outside the mesh without affecting the mesh.- force_floatbool, default:
True Casts the datatype to
float32if points datatype is non-float. Set this toFalseto allow non-float types, though this may lead to truncation of intermediate floats when transforming datasets.- validatebool |
MeshValidationFields| sequence[MeshValidationFields], default:False Validate the mesh using
validate_mesh()after initialization. Set this toTrueto validate all fields, or specify any combination of fields allowed byvalidate_mesh.Added in version 0.47.
- var_inpvtkPointSet,
Examples#
Download Python source code | Download Jupyter notebook
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)
Used In#
Docstring Examples
DataSet.dimensionality(1 use)DataSetFilters.extract_values(1 use)Plotter.increment_point_size_and_line_width(1 use)
Gallery Examples
Attributes#
Return 0.0 since a PointSet has no area. |
|
Return 0.0 since a PointSet has no volume. |
Inherited Attributes#
Return the active normals as an array. |
|
Return the active scalars as an array. |
|
Return the active scalar’s association and name. |
|
Return the name of the active scalars. |
|
Return the active tensors array. |
|
Return the active tensor’s field and name: [field, name]. |
|
Return the name of the active tensor array. |
|
Return the active texture coordinates on the points. |
|
Return the active vectors array. |
|
Return the active vector’s association and name. |
|
Return the name of the active vectors array. |
|
Return the actual size of the dataset object. |
|
Return a list of array names for the dataset. |
|
Return a glyph representation of the active vector data as arrows. |
|
Compute the radius and center of a bounding sphere. |
|
Return the bounding box of this dataset. |
|
Return the size of each axis of the object’s bounding box. |
|
A generator that provides an easy way to loop over all cells. |
|
Return cell data as DataSetAttributes. |
|
Set or return the center of the bounding box. |
|
Return the number of spatial dimensions spanned by this dataset’s points. |
|
Return the set of distinct cell types in this dataset. |
|
Return FieldData as DataSetAttributes. |
|
Return True if the mesh contains any non-linear cells. |
|
Return |
|
Return the length of the diagonal of the bounding box. |
|
Return the maximum spatial dimensionality of all cells in this mesh. |
|
Get address of the underlying VTK C++ object. |
|
Get the minimum spatial dimensionality of all cells in this mesh. |
|
Return the number of arrays present in the dataset. |
|
Return the number of cells in the entire dataset. |
|
Return the number of points in the entire dataset. |
|
Return the number of cells. |
|
Return the number of points. |
|
Return point data as DataSetAttributes. |
|
Return a reference to the points as a NumPy object. |
|
Set or return a user-specified data dictionary. |
Methods#
|
Cast this dataset to polydata. |
Cast this dataset to |
|
|
Raise PointSets do not have cells. |
|
Raise extract all edges are not supported. |
|
Raise cell operations are not supported. |
|
Raise extract all edges are not supported. |
|
Raise dimension reducing operations are not supported. |
|
Raise cell operations are not supported. |
|
Construct a 3D Delaunay triangulation of the mesh. |
|
Push each individual cell away from the center of the dataset. |
|
Raise extract all edges are not supported. |
|
Raise extract geometry are not supported. |
|
Raise extract surface are not supported. |
|
Raise cell operations are not supported. |
|
Plot a PyVista, NumPy, or VTK object. |
|
Raise PointSets do not have cells. |
|
Raise cell operations are not supported. |
|
Raise cell operations are not supported. |
|
Raise cell operations are not supported. |
|
Raise cell operations are not supported. |
|
Raise dimension reducing operations are not supported. |
|
Raise dimension reducing operations are not supported. |
|
Raise dimension reducing operations are not supported. |
|
Raise dimension reducing operations are not supported. |
|
Raise dimension reducing operations are not supported. |
|
Raise cell operations are not supported. |
|
Apply a vtkThreshold filter to the input dataset. |
|
Threshold the dataset by a percentage of its range on the active scalars array. |
|
Raise cell operations are not supported. |
Inherited Methods#
Add field data. |
|
Convert this |
|
Extract the points of this dataset and return a |
|
Extract the points of this dataset and return a |
|
Get the cell neighbors of the ind-th cell. |
|
Get consecutive levels of cell neighbors. |
|
Return the coordinates for the center of mass of the mesh. |
|
Remove all cell arrays. |
|
Remove all arrays from point/cell/field data. |
|
Remove all field data. |
|
Remove all point arrays. |
|
Return a copy of the object. |
|
Copy the data attributes of the input dataset object. |
|
Overwrite this dataset in-place with the new dataset’s geometries and data. |
|
Copy pyvista meta data onto this object from another object. |
|
Copy the structure (geometry and topology) of the input dataset object. |
|
Overwrite this data object with another data object as a deep copy. |
|
Find the index of cells that intersect a line. |
|
Find the index of cells in this mesh within bounds. |
|
Find index of closest cell in this mesh to the given point. |
|
Find index of closest point in this mesh to the given point. |
|
Find index of a cell that contains the given point. |
|
Search both point, cell, and field data for an array. |
|
Get the association of an array. |
|
Return a |
|
Get the min and max of a named array. |
|
Return the header stats of this dataset. |
|
Locate points and cell ids that intersect a line. |
|
Get the cell IDs that use the ind-th point. |
|
Get the point neighbors of the ind-th point. |
|
Get consecutive levels of point neighbors. |
|
Convert the points datatype to double precision. |
|
Change array name by searching for the array then renaming it. |
|
Save this vtk object to file. |
|
Find the scalars by name and appropriately sets it as active. |
|
Find the tensors by name and appropriately sets it as active. |
|
Find the vectors by name and appropriately sets it as active. |
|
Create a shallow copy from a different dataset into this one. |
|
Return this dataset’s point or cell arrays as a |
|
Return this dataset’s point or cell arrays as a |
Filters#
Align a dataset to another. |
|
Align a dataset to the x-y-z axes. |
|
Return a bounding box for this dataset. |
|
Generate points at the center of the cells in this dataset. |
|
Clip a dataset by a plane by specifying the origin and normal. |
|
Clip a dataset by a bounding box defined by the bounds. |
|
Clip a dataset by a scalar. |
|
Clip a dataset by a slab of finite thickness around a plane. |
|
Clip any mesh type using a |
|
Add RGB(A) scalars to labeled data. |
|
Compute metrics on the boundary faces of a mesh. |
|
Compute derivative-based quantities of point/cell scalar field. |
|
Compute the implicit distance from the points to a surface. |
|
Find and label connected regions. |
|
Compute the convex hull from this mesh’s points. |
|
Transform cell data into point data. |
|
Generate scalar values on a dataset. |
|
Return a subset of the grid. |
|
Extract cells of a specified type. |
|
Extract edges from the surface of the mesh. |
|
Extract largest connected set in mesh. |
|
Return a subset of the grid (with cells) that contains any of the given point indices. |
|
Return a subset of the mesh based on the values of point or cell data. |
|
Flip mesh about the normal. |
|
Flip mesh about the x-axis. |
|
Flip mesh about the y-axis. |
|
Flip mesh about the z-axis. |
|
Splat points into a volume using a Gaussian distribution. |
|
Copy a geometric representation (called a glyph) to the input dataset. |
|
Integrate point and cell data. |
|
Interpolate values onto this mesh from a given dataset. |
|
Join one or many other grids to this grid. |
|
Merge duplicate points in this mesh. |
|
Return an oriented bounding box (OBB) for this dataset. |
|
Produce an outline of the full extent for the input dataset. |
|
Produce an outline of the corners for the input dataset. |
|
Renumber labeled data such that labels are contiguous. |
|
Break down input dataset into a requested number of partitions. |
|
Sample a dataset along a circular arc and plot it. |
|
Sample a dataset along a circular arc defined by a normal and polar vector and plot it. |
|
Sample a dataset along a high resolution line and plot. |
|
Transform point data into cell data. |
|
Reflect a dataset across a plane. |
|
Remove cells whose scalar values are NaN. |
|
Resize the dataset’s bounds. |
|
Rotate mesh about a point with a rotation matrix or |
|
Rotate mesh about a vector. |
|
Rotate mesh about the x-axis. |
|
Rotate mesh about the y-axis. |
|
Rotate mesh about the z-axis. |
|
Resample array data from a passed mesh onto this mesh. |
|
Sample a dataset over a circular arc. |
|
Sample a dataset over a circular arc defined by a normal and polar vector and plot it. |
|
Sample a dataset onto a line. |
|
Sample a dataset onto a multiple lines. |
|
Scale the mesh. |
|
Mark points as to whether they are inside a closed surface. |
|
Mark points from this mesh as inside or outside relative to a closed surface. |
|
Sort labeled data by number of points or cells. |
|
Find, label, and split connected bodies/volumes. |
|
Split mesh into separate sub-meshes using point or cell data. |
|
Integrate a vector field to generate streamlines. |
|
Generate evenly spaced streamlines on a 2D dataset. |
|
Generate streamlines of vectors from the points of a source mesh. |
|
Return the surface indices of a grid. |
|
Texture map this dataset to a user defined plane. |
|
Texture map this dataset to a user defined sphere. |
|
Transform this mesh with a 4x4 transform. |
|
Translate the mesh. |
|
Validate this mesh’s array data, points, and cells. |
|
Voxelize mesh to UnstructuredGrid. |
|
Voxelize mesh as a binary |
|
Voxelize mesh to create a RectilinearGrid voxel volume. |
|
Warp the dataset’s points by a point data scalars array’s values. |
|
Warp the dataset’s points by a point data vectors array’s values. |