Expand description
Spatial search structures for SpatialRust.
KDTree, hash grid, and octree implementations live in this crate.
Structs§
- Brute
Force Index - Reference index using brute-force search for correctness tests.
- KdTree
- Cache-friendly KD-tree for 3D point clouds.
- Neighbor
- One neighbor search result.
- Neighbor
Graph - A directed neighborhood graph over a point cloud.
Constants§
- MAX_
UNIFORM_ GRID_ CELLS - Upper bound on dense grid cells; callers should fall back when exceeded.
- PARALLEL_
CHUNK_ QUERY_ MIN_ POINTS - Minimum point count before threaded chunk dispatch is used.
- PARALLEL_
STAGING_ MIN_ POINTS - Minimum point count before multi-threaded index staging is used.
Traits§
- Chunked
Nearest Neighbor Index - k-NN search over contiguous query index ranges.
- Chunked
Radius Search Index - Radius search over contiguous query index ranges.
- Nearest
Neighbor Index - Exact nearest neighbor queries.
- Radius
Search Index - Radius search queries.
- Spatial
Index - Common spatial index operations.
Functions§
- brute_
force_ knn - Finds up to
knearest neighbors by brute force. - brute_
force_ radius - Finds all neighbors within
radiusby brute force. - build_
grid - Counting-sort points into grid cells, returning sorted indices and CSR offsets.
- euclidean_
cluster_ roots - Connected-component roots via uniform-grid union-find (minimum index per component).
- euclidean_
cluster_ roots_ from_ segments - Computes Euclidean component roots from pre-built sparse grid segments.
- grid_
bounds - Returns grid origin (min corner) and cell counts for cell size
radius. - knn_
graph - Builds a directed k-nearest-neighbor graph: an edge from every point to each
of its
knearest neighbors (excluding itself). - nearest_
k_ spatial_ tensor - Runs k-NN search for every chunk in a
SpatialTensor, appending tagged neighbors. - nearest_
k_ spatial_ tensor_ parallel - Parallel k-NN search over
SpatialTensorchunks. - nearest_
k_ spatial_ tensor_ parallel_ into - Parallel k-NN search, appending
(query_index, neighbor)pairs toout. - parallel_
index_ for_ each - Runs
workover disjoint index ranges usingparallel_worker_count. - parallel_
index_ ranges - Returns disjoint half-open index ranges covering
[0, point_count). - parallel_
worker_ count - Returns the number of worker threads to use for
point_countpoints. - parallel_
worker_ count_ with_ chunk - Returns the number of worker threads for an explicit staging chunk size.
- radius_
graph - Builds a directed radius graph: an edge from every point to each other point
within
radius. - radius_
search_ spatial_ tensor - Runs radius search for every chunk in a
SpatialTensor, appending tagged neighbors. - radius_
search_ spatial_ tensor_ parallel - Parallel radius search over
SpatialTensorchunks. - radius_
search_ spatial_ tensor_ parallel_ into - Parallel radius search, appending
(query_index, neighbor)pairs toout. - uniform_
grid_ fits - Returns whether a uniform grid with the given cell size fits within the cell cap.
Type Aliases§
- Chunk
Query Range - Range of query point indices (matches
SpatialTensor::chunksranges).