pysdic.triangle_3_mesh_to_open3d#

triangle_3_mesh_to_open3d(mesh, legacy=False, uvmap=True)[source]#

Convert the Mesh (element_type = “triangle_3”) instance to an Open3D TriangleMesh object. (Only for 3D embedding dimension meshes \(E=3\))

If legacy is True, the method returns a legacy Open3D TriangleMesh object. Otherwise, it returns a T geometry TriangleMesh object.

Warning

For now, the method only converts the vertices, triangles, and UV map (if available) to the Open3D mesh. The other properties stored in the Triangle3Mesh instance are not transferred.

Parameters:
  • mesh (Mesh) – A Mesh instance containing the mesh data.

  • legacy (bool, optional) – If True, return a legacy Open3D TriangleMesh object. Default is False.

  • uvmap (bool, optional) – If True, include the UV mapping in the Open3D mesh if available. Default is True.

Returns:

An Open3D TriangleMesh object containing the mesh data.

Return type:

Union[open3d.t.geometry.TriangleMesh, open3d.geometry.TriangleMesh]

Raises:
  • TypeError – If the input mesh is not of type “triangle_3”.

  • ValueError – If the mesh is empty or not 3D embedding dimension.

See also

pysdic.triangle_3_mesh_from_open3d

For converting an Open3D TriangleMesh object to a Mesh instance.

Examples

Converting a Mesh instance to an Open3D TriangleMesh object:

1import open3d as o3d
2from pysdic import Mesh, to_open3d
3
4# Create a Mesh instance
5mesh = Mesh(vertices=..., connectivity=...)
6
7# Convert the mesh to an Open3D object
8o3dmesh = to_open3d(mesh)