Module spatial
Expand description
Cold caller-buffered native BVH construction and allocation-free nearest shoreline queries. Exact segment distances remain the acceptance criterion.
Structs§
- Aabb
- Axis-aligned bounding box in 3D.
- BvhNode
- BVH node: 40 bytes,
repr(C), naturally aligned. - Point2
- 2D point in double precision for shoreline segment distance queries.
- Point3
- 3D point in double precision for AABB and BVH queries.
- Shore
Spatial Scratch
Enums§
- BvhError
- Errors raised by the BVH builder.
- Spatial
Order Error - Errors raised by spatial ordering functions.
Constants§
- BVH_
NODE_ SIZE - Node size in bytes.
- MAX_
BVH_ DEPTH - Maximum BVH depth (bounded by 2^21 primitives -> 21 levels).
Functions§
- build_
bvh_ recursive - Build a BVH using the deterministic Morton-sorted recursive builder.
- point_
segment_ distance_ sq_ 2d - Squared distance from point
pto segmentabin 2D. - shore_
distance_ accelerated_ into - Accelerated shore-distance field into
out. - sort_
by_ morton_ 3d - Compute Morton codes for a 3D point set and sort indices by code.
- spatial_
working_ bytes - Includes caller arrays and the native BVH builder’s bounded centroid scratch.