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. any vtkPointSet).

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:

pysdic.PointCloud

Raises:
  • TypeError – If dataset is not a vtkPointSet (e.g. a vtkImageData, whose points are implicit), or if a point data array is not numeric (e.g. a vtkStringArray; use load_properties=False to ignore the point data).

  • ValueError – If the dataset has no points array or if a point data array has no name.