Method OrientedMinimumBoundingBox2D
OrientedMinimumBoundingBox2D(List<Vector3>, Vector3[])
Find the oriented minimum bounding box for a 2D convex hull.
Declaration
public static Vector2 OrientedMinimumBoundingBox2D(List<Vector3> convexHull, Vector3[] boundingBox)
Parameters
Type | Name | Description |
---|---|---|
List<Vector3> | convexHull | The list of all points in a 2D convex hull on the X and Z axes, in a clockwise winding order. |
Vector3[] | boundingBox | An array of length 4 to fill with the vertex positions of the bounding box,
in the order |
Returns
Type | Description |
---|---|
Vector2 | The size of the bounding box on each axis. Y here maps to the Z axis. |
Remarks
This implements the 'rotating calipers' algorithm and operates in linear time. Operates only on the X and Z axes of the input.