pysdic.PointCloud.from_vtk#
- classmethod PointCloud.from_vtk(dataset, *, load_properties=True)[source]#
Create a point cloud from the points of a VTK dataset (
vtkPolyData,vtkUnstructuredGrid,vtkStructuredGrid, …, i.e. anyvtkPointSet).The cells are ignored and the properties are read from the point data (their data types are kept). The point cloud is always 3D (\(E = 3\)).
- Parameters:
dataset (
vtkPointSet) – The VTK dataset to read.load_properties (bool, optional (default:
True)) – If False, the point data are ignored.
- Returns:
The new point cloud.
- Return type:
- Raises:
TypeError – If
datasetis not avtkPointSet(e.g. avtkImageData, whose points are implicit), or if a point data array is not numeric (e.g. avtkStringArray; useload_properties=Falseto ignore the point data).ValueError – If the dataset has no points array or if a point data array has no name.