pyblenderSDIC.meshes.TriangleMesh3D.to_dict#

TriangleMesh3D.to_dict(description: str | None = None) Dict[str, Any][source]#

Convert the TriangleMesh3D instance to a dictionary.

from pyblenderSDIC.mesh import TriangleMesh3D

# Create a TriangleMesh3D instance
mesh = TriangleMesh3D(vertices=..., triangles=...)
# Convert the mesh to a dictionary
data = mesh.to_dict()

See also

from_dict() for more details about the return dictionary structure.

Note

The values of the dictionary are lists of lists or scalars, so they can be easily serialized to JSON or similar formats.

Parameters:

description (Optional[str]) – A description of the mesh, by default None. This message will be included in the dictionary under the key “description” if provided.

Returns:

A dictionary containing the mesh data.

Return type:

Dict[str, Any]