differt_core.geometry.TriangleMesh#
- class TriangleMesh#
Bases:
objectA lower-level mesh made of triangles.
This class should not be used directly, prefer its higher-level version
differt.geometry.TriangleMeshinstead.Attributes
The array of face colors.
The array of face materials.
List of material names.
The array of object indices.
The array of triangle indices.
The array of triangle vertices.
Methods
append(other)Move all the elements of
otherintoselfand updateobject_bounds.load_obj(filename)Load a triangle mesh from a Wavefront .obj file.
load_ply(filename)Load a triangle mesh from a Stanford PLY .ply file.
Detailed documentation
- append(other)#
Move all the elements of
otherintoselfand updateobject_bounds.After calling this method,
otherwill be empty.- Parameters:
other (TriangleMesh) – The mesh to be appended to
self.
- face_colors#
The array of face colors.
The array contains the face colors, as RGB triplets, with a black color used as defaults (if some faces have a color). This attribute is
Noneif all face colors are unset.
- face_materials#
The array of face materials.
The array contains the material indices, with a special placeholder value of
-1. To obtain the name of the material, seematerial_names. This attribute isNoneif all face materials are unset.- Type:
- classmethod load_obj(filename)#
Load a triangle mesh from a Wavefront .obj file.
Currently, only vertices and triangles are loaded. Triangle normals are ignored because they are computed with
differt.geometry.TriangleMesh.normalsusing JAX so that they can be differentiated with respect to triangle vertices.- Parameters:
file (str) – The path to the Wavefront .obj file.
- Returns:
The corresponding mesh containing only triangles.
- Return type:
- classmethod load_ply(filename)#
Load a triangle mesh from a Stanford PLY .ply file.
Currently, only vertices and triangles are loaded. Triangle normals are ignored because they are computed with
differt.geometry.TriangleMesh.normalsusing JAX so that they can be differentiated with respect to triangle vertices.- Parameters:
file (str) – The path to the Stanford PLY .ply file.
- Returns:
The corresponding mesh containing only triangles.
- Return type:
- object_bounds#
The array of object indices.
If the present mesh contains multiple objects, usually as a result of appending multiple meshes together, this array contains start and end indices for each sub mesh.
- Type:
- triangles#
The array of triangle indices.
- vertices#
The array of triangle vertices.