Module spatial_tree

Module spatial_tree 

Source
Expand description

Cycle- and depth-guarded spatial-tree assembly, split out of spatial.rs (#3965 follow-up): walking spatial_children_map into SpatialNodes is a self-contained concern once the relationship maps have been built. spatial_tests.rs (attached to the parent spatial module, not this one) exercises build_spatial_nodes_recursive directly via use super::*.

Constantsยง

MAX_SPATIAL_TREE_DEPTH ๐Ÿ”’
Maximum recursion depth for building the spatial tree, mirroring MAX_SPATIAL_TREE_DEPTH in apps/viewer/src/utils/serverDataModel.ts. This is a second guard beyond the visited set in build_spatial_nodes_recursive: a pathologically deep but acyclic aggregation/containment chain could still exhaust the stack even with cycles ruled out.

Functionsยง

build_spatial_nodes_recursive ๐Ÿ”’
Recursively build spatial nodes with full information.