class VolumeMesh(dtcc.Geometry)[source]

Represents an unstructured tetrahedral mesh in 3D.

The VolumeMesh class represents a 3D volumetric mesh, which consists of vertices and tetrahedral cells.

vertices

An array of vertices in 3D space.

Type:

np.ndarray

cells

An array of tetrahedral cells defined by vertex indices.

Type:

np.ndarray

markers

An array of markers or labels associated with th cells.

Type:

np.ndarray

Public members

__str__()[source]

Return a string representation of the DTCC VolumeMesh, containing the number of vertices and cells.

calculate_bounds() Bounds[source]

Calculate the bounding box of the mesh.

property num_vertices : int

Get the number of vertices in the volume mesh.

property num_cells : int

Get the number of cells or elements in the volume mesh.

to_proto() Geometry[source]

Return a protobuf representation of the VolumeMesh.

from_proto(pb: Geometry | bytes)[source]

Initialize VolumeMesh from a protobuf representation.

VolumeMesh(...)

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

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

save(path)
view(*args, **kwargs)
vertices : ndarray
cells : ndarray
markers : ndarray
property bounds : 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.