Box.from_bounding_box

classmethod Box.from_bounding_box(bbox)

Construct a box from the result of a bounding box calculation.

Parameters

bbox (list[[float, float, float] | compas.geometry.Point]) – A list of 8 point locations, representing the corners of the bounding box. Positions 0, 1, 2, 3 are the bottom corners. Positions 4, 5, 6, 7 are the top corners. Both the top and bottom face are oriented in CCW direction, starting at the bottom, left-most point.

Returns

compas.geometry.Box – The box shape.

Examples

>>> from compas.geometry import bounding_box
>>> bbox = bounding_box([[0.0, 0.0, 0.0], [1.0, 1.0, 1.0]])
>>> box = Box.from_bounding_box(bbox)
>>> box.width
1.0
>>> box.height
1.0
>>> box.depth
1.0