class Mesh(dtcc.Geometry)[source]

Represents an unstructured triangular mesh in 3D.

The Mesh class represents a 3D triangular mesh, which consists of vertices and triangular faces.

vertices

An array of vertices in 3D space.

Type:

np.ndarray

faces

An array of triangular faces defined by vertex indices.

Type:

np.ndarray

markers

An array of markers or labels associated with the faces.

Type:

np.ndarray

Public members

__str__()[source]

Return a string representation of the DTCC Mesh

property num_vertices : int

Get the number of vertices in the mesh.

calculate_bounds()[source]

Calculate the bounding box of the mesh.

property num_faces : int

Calculate the number of faces in the mesh.

to_proto() Geometry[source]

Return a protobuf representation of the Mesh.

from_proto(pb: Geometry | bytes)[source]

Initialize Mesh from a protobuf representation.

Mesh(_bounds: ~dtcc_model.geometry.bounds.Bounds = <factory>, ...)

Initialize self. See help(type(self)) for accurate signature.

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

save(path)
merge(other: Mesh, weld=False) Mesh
view(data: Any | None = None)

View a mesh in 3D with a GLFW window.

vertices : ndarray
faces : ndarray
markers : ndarray
property bounds
add_field(field: Field)[source]

Add a field to the geometry.

transform : Transform
fields : list[Field]
to_json() str

Return a JSON representation of the object.

copy(**kwargs)

Return a copy of the object.

classmethod add_methods(module, name=None)

Adds methods from a module or function to the class.

classmethod print_methods(verbose=False)

Print the methods that have been added to the class.