pysdic.PointCloud.from_npz#

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

Create a PointCloud object from a NumPy NPZ file.

The NPZ file should contain an array named ‘points’ with shape \((N_p, E)\) representing the coordinates of the points. Additional properties can be stored as separate arrays in the NPZ file.

See also

  • to_npz() method for saving the point cloud to a NPZ file.

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

  • load_properties (bool, optional) – If True, all arrays in the NPZ file with format "_properties/{property_name}" will be loaded as properties of the point cloud. Default is True.

Returns:

A PointCloud object containing the points and properties read from the NPZ file.

Return type:

PointCloud

Examples

Creating a PointCloud object from a NPZ file.

1from pysdic import PointCloud
2# Create a point cloud from a NPZ file
3point_cloud = PointCloud.from_npz('path/to/point_cloud.npz')

Now, point_cloud is a PointCloud object containing the points and properties read from the specified NPZ file.