vibespatial.constructive.minimum_rotated_rectangle

GPU-accelerated minimum rotated rectangle (oriented envelope) computation.

Uses rotating calipers on the convex hull to find the minimum-area bounding rectangle for each geometry. Output is always Polygon family: each row produces a closed 5-vertex polygon (the minimum-area rotated rectangle).

Algorithm per geometry:
  1. Compute convex hull (reuses existing GPU convex_hull kernel).

  2. For each edge of the convex hull, compute the perpendicular bounding rectangle by rotating coordinates into an edge-aligned frame.

  3. Track the rectangle with minimum area.

  4. Output the 4 corners (+ closure) of the minimum-area rectangle.

Degenerate cases:
  • Point -> degenerate polygon (point repeated 5 times).

  • Collinear / <3 hull vertices -> degenerate rectangle from the line segment endpoints.

ADR-0033: Tier 1 NVRTC for rotating calipers (geometry-specific inner loop). ADR-0002: CONSTRUCTIVE class – stays fp64 on all devices per policy.

Attributes

Functions

minimum_rotated_rectangle_owned(...)

Compute the minimum rotated rectangle (oriented envelope) of each geometry.

Module Contents

vibespatial.constructive.minimum_rotated_rectangle.cp = None
vibespatial.constructive.minimum_rotated_rectangle.logger
vibespatial.constructive.minimum_rotated_rectangle.minimum_rotated_rectangle_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = PrecisionMode.AUTO) vibespatial.geometry.owned.OwnedGeometryArray

Compute the minimum rotated rectangle (oriented envelope) of each geometry.

Uses rotating calipers on the convex hull. Output is always Polygon family: each row produces a closed 5-vertex polygon (the minimum-area bounding rectangle).

Parameters

ownedOwnedGeometryArray

Input geometries (any family).

dispatch_modeExecutionMode or str

Execution mode selection. Defaults to AUTO.

precisionPrecisionMode or str

Precision mode selection. Defaults to AUTO. CONSTRUCTIVE class: stays fp64 on all devices per ADR-0002.

Returns

OwnedGeometryArray

Polygon OwnedGeometryArray with one minimum rotated rectangle per input row.