pysdic.PointCloud.from_meshio#
- classmethod PointCloud.from_meshio(mesh, load_properties=True)[source]#
Create a
PointCloudobject from ameshio.Meshobject.The points are extracted from the mesh vertices and the properties are read from the point data.
See also
to_array()method for converting the point cloud back to a NumPy array.
Note
Only the vertices of the mesh are used to create the point cloud. Cells are ignored.
- Parameters:
- Returns:
A
PointCloudobject containing the points extracted from the mesh vertices.- Return type:
- Raises:
ValueError – If the mesh does not contain any points.
Examples
Creating a
PointCloudobject from ameshio.Meshobject.1import meshio 2from pysdic import PointCloud 3 4# Load a mesh using meshio 5mesh = meshio.read('path/to/mesh_file.vtk') 6 7# Create a point cloud from the mesh 8point_cloud = PointCloud.from_meshio(mesh)
Now,
point_cloudis aPointCloudobject containing the points extracted from the mesh vertices.