Expand description
Nearest-neighbour and radius queries over point sets.
§Exact, not broad phase
The BVH in this crate answers with AABB lower bounds: a candidate may be further away than its bound suggests, so its results are broad-phase candidates that a narrow phase must confirm.
A point has no extent, so the distance to it is exact. These queries
therefore return real distances and are complete: a radius query returns
every point inside the radius and nothing else. That difference is why
the result types here are distinct from NearestCandidate — a caller
must never mistake an exact hit for a candidate needing confirmation, or
the reverse.
§Allocation
Queries take a callback and allocate nothing per hit. The index itself
is built once and reused. *_into helpers exist for callers that do
want a vector, but they are a convenience over the callback form rather
than the primitive.
§Determinism
Ties are broken by point index, so equal distances always resolve the same way. Sorted variants order by distance then index. Without this a caller could get different neighbours across runs of identical input, which would make any downstream reconstruction irreproducible.
Structs§
- Point
Hit - A point found by a query, with its exact distance.
- Point
Index - A uniform-grid index over a point set.
Enums§
- Point
Query Error - Why a query could not be answered.