pyblenderSDIC.meshes.TriangleMesh3D.to_meshio#

TriangleMesh3D.to_meshio() Mesh[source]#

Convert the TriangleMesh3D instance to a meshio.Mesh object.

The following fields are set in the meshio object:

  • mesh.points → vertices

  • mesh.cells → triangles

  • mesh.point_data → vertex_normals

  • mesh.cell_data → triangle_normals, triangle_centroids, triangle_areas, uvmap

import meshio
from pyblenderSDIC.mesh import TriangleMesh3D

# Create a TriangleMesh3D instance
mesh = TriangleMesh3D(vertices=..., triangles=...)
# Convert the mesh to a meshio object
meshio_mesh = mesh.to_meshio()

See also

from_meshio() for creating a TriangleMesh3D instance from a meshio object and more details about the meshio structure.

Returns:

A meshio.Mesh object containing the mesh data.

Return type:

meshio.Mesh