vibespatial.kernels.constructive.polygon_rect_intersection

GPU-native element-wise polygon-vs-rectangle intersection kernel.

Clips each polygon row in left against an axis-aligned rectangle row in right. The rectangle comes from the right polygon’s exact 5-vertex box coordinates, keeping the work on the GPU and avoiding the generic overlay pipeline for parcel-grid workloads.

ADR-0033: Tier 1 (custom NVRTC kernel) – geometry-specific ring traversal and

rectangle clipping.

ADR-0002: CONSTRUCTIVE class – stays fp64 on all devices per policy. ADR-0034: NVRTC precompilation via request_nvrtc_warmup at module scope.

Attributes

Functions

polygon_rect_split_boundary_components(...)

Split repeated-boundary rectangle clip rings into MultiPolygon parts.

polygon_rect_intersection_can_handle(→ bool)

polygon_rect_intersection(...)

Module Contents

vibespatial.kernels.constructive.polygon_rect_intersection.cp = None
vibespatial.kernels.constructive.polygon_rect_intersection.logger
vibespatial.kernels.constructive.polygon_rect_intersection.polygon_rect_split_boundary_components(clipped: vibespatial.geometry.owned.OwnedGeometryArray, rectangles: vibespatial.geometry.owned.OwnedGeometryArray) vibespatial.geometry.owned.OwnedGeometryArray | None

Split repeated-boundary rectangle clip rings into MultiPolygon parts.

polygon_rect_intersection emits one polygon ring per row. Concave mask clips can produce disconnected intersections; in that case the single ring contains repeated rectangle-boundary connector segments. This helper removes those connector edges and closes each component along the rectangle boundary on the GPU. Unsupported shapes return None so callers keep the generic GPU make-valid fallback.

vibespatial.kernels.constructive.polygon_rect_intersection.polygon_rect_intersection_can_handle(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray) bool
vibespatial.kernels.constructive.polygon_rect_intersection.polygon_rect_intersection(left: vibespatial.geometry.owned.OwnedGeometryArray, right: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = PrecisionMode.AUTO) vibespatial.geometry.owned.OwnedGeometryArray