pysdic.PointCloud.to_meshio#
- PointCloud.to_meshio(save_properties=True)[source]#
Convert the point cloud to a
meshio.Meshobject.The points are stored as vertices in the mesh and the properties are saved as point data.
See also
from_meshio()class method for creating aPointCloudobject from ameshio.Meshobject.
- Parameters:
save_properties (
bool, optional) – IfTrue, the point cloud properties will be saved as point data in the mesh. Default isTrue.- Returns:
A
meshio.Meshobject containing the points as vertices.- Return type:
meshio.Mesh
Examples
Converting a
PointCloudobject to ameshio.Meshobject.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,
meshis ameshio.Meshobject containing the points of the point cloud as vertices.