pysdic.PointCloud.from_vtk#

classmethod PointCloud.from_vtk(filepath, load_properties=True)[source]#

Create a PointCloud object from a VTK file (only for 3D point clouds).

The VTK file should contain vertex definitions. Only vertices are read; faces and other elements are ignored.

The points are extracted using meshio library.

See also

  • to_vtk() method for saving the point cloud to a VTK file.

Warning

This method only works for 3-dimensional point clouds, as VTK format is primarily used for 3D data.

Parameters:
  • filepath (str) – The path to the VTK file.

  • load_properties (bool, optional) – If True, the point data properties from the VTK file will be loaded into the point cloud. Default is True.

Returns:

A PointCloud object containing the points read from the VTK file.

Return type:

PointCloud

Examples

Creating a PointCloud object from a VTK file.

1from pysdic import PointCloud
2# Create a point cloud from a VTK file
3point_cloud = PointCloud.from_vtk('path/to/point_cloud.vtk')

Now, point_cloud is a PointCloud object containing the points read from the specified VTK file.