Skip to content

compas_cgal.measure ¤

Functions¤

mesh_area ¤

mesh_area(mesh: VerticesFaces) -> float

Compute the area of a triangle mesh.

Parameters:

Name Type Description Default
mesh VerticesFaces

The mesh.

required

Returns:

Type Description
float

The area of the mesh.

mesh_centroid ¤

mesh_centroid(mesh: VerticesFaces) -> list[float]

Compute the centroid of a the volume of a closed triangle mesh.

Parameters:

Name Type Description Default
mesh VerticesFaces

The mesh.

required

Returns:

Type Description
list[float]

The centroid of the mesh.

mesh_volume ¤

mesh_volume(mesh: VerticesFaces) -> float

Compute the volume of a closed triangle mesh.

Parameters:

Name Type Description Default
mesh VerticesFaces

The mesh.

required

Returns:

Type Description
float

The volume of the mesh.

Examples:

>>> from compas.geometry import Box
>>> from compas_cgal.measure import mesh_volume
>>> box = Box(1)
>>> mesh = box.to_vertices_and_faces(triangulated=True)
>>> mesh_volume(mesh)
1.0