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_DEPTHinapps/viewer/src/utils/serverDataModel.ts. This is a second guard beyond the visited set inbuild_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.