mesh_bounding_box

compas.datastructures.mesh_bounding_box(mesh)[source]

Compute the (axis aligned) bounding box of a mesh.

Parameters:
meshcompas.datastructures.Mesh

The mesh data structure.

Returns:
list[list[float]]

The 8 corners of the bounding box of the mesh.

See also

compas.geometry.mesh_oriented_bounding_box_numpy()
compas.geometry.mesh_oriented_bounding_box_xy_numpy()
compas.geometry.mesh_bounding_box_xy()

Examples

>>> from compas.datastructures import Mesh
>>> mesh = Mesh.from_obj(compas.get('faces.obj'))
>>> mesh_bounding_box(mesh)
[[0.0, 0.0, 0.0], [10.0, 0.0, 0.0], [10.0, 10.0, 0.0], [0.0, 10.0, 0.0], [0.0, 0.0, 0.0], [10.0, 0.0, 0.0], [10.0, 10.0, 0.0], [0.0, 10.0, 0.0]]