vibespatial.constructive.minimum_clearance

GPU-accelerated minimum_clearance and minimum_clearance_line computation.

Minimum clearance is the smallest distance between any two non-adjacent vertices/edges of a geometry. Returns a scalar float per geometry.

Minimum clearance line returns a 2-point LineString connecting the two closest non-adjacent points of a geometry.

Architecture (ADR-0033 tier classification): - Point/MultiPoint: infinity / empty LineString (no segments, no clearance) - LineString: O(n^2) pairwise non-adjacent segment distance (Tier 1 NVRTC) - Polygon: O(n^2) all-segments including cross-ring pairs (Tier 1 NVRTC) - MultiLineString: O(n^2) all segments across all parts (Tier 1 NVRTC) - MultiPolygon: O(n^2) all segments across all parts and rings (Tier 1 NVRTC)

Precision (ADR-0002): - minimum_clearance: METRIC class – fp64 required for distance computation. - minimum_clearance_line: CONSTRUCTIVE class – fp64 required (output is geometry). Both are templated on compute_t for observability but stay fp64.

Two segments are “adjacent” if they share a vertex index in the flattened coordinate array. Adjacent segments always have distance 0 at the shared vertex and are excluded from the minimum.

The kernel computes full segment-to-segment distance (not just vertex-to-vertex) using the parametric closest-approach method.

Attributes

cp

Functions

minimum_clearance_owned(→ numpy.ndarray)

Compute minimum clearance from OwnedGeometryArray coordinate buffers.

minimum_clearance_line_owned(...)

Compute minimum clearance line from OwnedGeometryArray coordinate buffers.

Module Contents

vibespatial.constructive.minimum_clearance.cp = None
vibespatial.constructive.minimum_clearance.minimum_clearance_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = 'auto') numpy.ndarray

Compute minimum clearance from OwnedGeometryArray coordinate buffers.

GPU path uses ADR-0002 METRIC-class precision dispatch (fp64 required for distance computation). Returns float64 array of shape (row_count,).

Zero host/device transfers mid-process. When owned.device_state is populated (vibeFrame path), GPU kernels read directly from device pointers with no copy.

vibespatial.constructive.minimum_clearance.minimum_clearance_line_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = 'auto') vibespatial.geometry.owned.OwnedGeometryArray

Compute minimum clearance line from OwnedGeometryArray coordinate buffers.

GPU path uses ADR-0002 CONSTRUCTIVE-class precision dispatch (fp64 required, output is geometry). Returns an OwnedGeometryArray of 2-point LineStrings.

Each output LineString connects the two closest non-adjacent points of the corresponding input geometry. Degenerate cases (points, multipoints, geometries with fewer than 3 non-adjacent segments) yield empty LineStrings.

Zero host/device transfers mid-process. When owned.device_state is populated (vibeFrame path), GPU kernels read directly from device pointers with no copy.