pysdic.triangle_3_mesh_from_open3d#

triangle_3_mesh_from_open3d(mesh, internal_bypass=False)[source]#

Create a Mesh (element_type = “triangle_3”) instance from an Open3D TriangleMesh object. (Only for 3D embedding dimension meshes \(E=3\))

Warning

For now, the method only extracts the vertices, triangles, and UV map (if available) from the Open3D mesh. The other properties (normals, centroids, areas) are not extracted and must be computed separately.

Parameters:
  • mesh (Union[open3d.t.geometry.TriangleMesh, open3d.geometry.TriangleMesh]) – An Open3D TriangleMesh object containing the mesh data.

  • internal_bypass (bool, optional) – Internal use only. If True, bypasses certain checks for performance, by default False.

Returns:

A Mesh instance containing the mesh data.

Return type:

Mesh

Raises:
  • TypeError – If the input mesh is not an Open3D TriangleMesh object.

  • ValueError – If the mesh is empty.

See also

pysdic.triangle_3_mesh_to_open3d

For converting a Mesh instance to an Open3D TriangleMesh object.

Example

Reading a mesh using Open3D and converting it to a Mesh instance:

1import open3d as o3d
2from pysdic import Mesh, from_open3d
3
4# Read the mesh from a file
5o3dmesh = o3d.io.read_triangle_mesh("path/to/mesh.ply")
6
7# Create a Mesh instance from the Open3D object
8mesh = from_open3d(o3dmesh)