pysdic.PointCloud.to_meshio#

PointCloud.to_meshio(save_properties=True)[source]#

Convert the point cloud to a meshio.Mesh object.

The points are stored as vertices in the mesh and the properties are saved as point data.

See also

Parameters:

save_properties (bool, optional) – If True, the point cloud properties will be saved as point data in the mesh. Default is True.

Returns:

A meshio.Mesh object containing the points as vertices.

Return type:

meshio.Mesh

Examples

Converting a PointCloud object to a meshio.Mesh object.

1import numpy as np
2from pysdic import PointCloud
3
4# Create a random point cloud with 100 points
5random_points = np.random.rand(100, 3)  # shape (100, 3)
6point_cloud = PointCloud.from_array(random_points)
7
8# Convert the point cloud to a meshio Mesh
9mesh = point_cloud.to_meshio()

Now, mesh is a meshio.Mesh object containing the points of the point cloud as vertices.