oriented_bounding_box_xy_numpy
- compas.geometry.oriented_bounding_box_xy_numpy(points)[source]
Compute the oriented minimum bounding box of set of points in the XY plane.
- Parameters
points (array_like[point]) – XY(Z) coordinates of the points.
- Returns
list[[float, float, float]] – XYZ coordinates of 8 points defining a box.
Notes
The oriented (minimum) bounding box (OBB) is computed using the following procedure:
Compute the convex hull of the points.
For each of the edges on the hull:
Compute the s-axis as the unit vector in the direction of the edge
Compute the othorgonal t-axis.
Use the start point of the edge as origin.
Compute the spread of the points along the s-axis. (dot product of the point vecor in local coordinates and the s-axis)
Compute the spread along the t-axis.
Determine the side of s on which the points are.
Compute and store the corners of the bbox and its area.
Select the box with the smallest area.
Examples
>>>