Crate axiolid_spatial

Source
Expand description

Spatial acceleration contracts.

§What this crate provides

Two indices, both deterministic and callback-based:

  • Bvh over bounded objects – triangles, solids, anything with an AABB. Adapts to how geometry is distributed, so empty space costs nothing. This is what clash, ray casting, and healing use.
  • PointIndex over points, on a uniform grid. Exact KNN and radius search for scattered samples, where every query has the same radius and cell arithmetic beats tree descent.

An octree, k-d tree, GPU broad phase, or foreign index can implement the same SpatialIndex callback API. None is provided here: the BVH covers object queries and the grid covers point queries, and a third structure should arrive with a measured workload that needs it, not before.

Narrow-phase geometry remains outside the index: these answer which candidates, never what the intersection is.

Beside the indices, barycentric locates a point in a triangle, tetrahedron or polygon by weights of its corners, for interpolating values given there.

Re-exports§

pub use barycentric::mean_value_coordinates2;
pub use barycentric::tetrahedron_barycentric;
pub use barycentric::triangle_barycentric2;
pub use barycentric::triangle_barycentric3;
pub use barycentric::BarycentricError;
pub use bvh::Bvh;
pub use bvh::CandidatePair;
pub use bvh::NearestCandidate;
pub use bvh::PairCandidates;
pub use bvh::SpatialQueryStats;
pub use index::RayHit;
pub use index::SpatialIndex;
pub use index::SpatialItem;
pub use points::PointHit;
pub use points::PointIndex;
pub use points::PointQueryError;

Modules§

barycentric
Barycentric and mean-value coordinates, for interpolating values given at the corners of a triangle, a tetrahedron or a polygon (#143).
bvh
Deterministic median-split bounding-volume hierarchy.
index
Zero-allocation spatial index query contract.
points
Nearest-neighbour and radius queries over point sets.