pyblenderSDIC.meshes.TriangleMesh3D.to_open3d#

TriangleMesh3D.to_open3d(legacy: bool = False) TriangleMesh | TriangleMesh[source]#

Convert the TriangleMesh3D instance to an Open3D TriangleMesh object.

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

import open3d as o3d
from pyblenderSDIC.mesh import TriangleMesh3D

# Create a TriangleMesh3D instance
mesh = TriangleMesh3D(vertices=..., triangles=...)
# Convert the mesh to an Open3D object
open3d_mesh = mesh.to_open3d()

Warning

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

Parameters:

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

Returns:

An Open3D TriangleMesh object containing the mesh data.

Return type:

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