Module spatial

Module spatial 

Source
Expand description

Spatial hierarchy extraction.

Split across three files (#3965 follow-up, to stay under the module-size ratchet): this file builds the relationship maps (canonical_parent, spatial_children_map, element_containment_map) and drives the orphan-fill pass; spatial_tree.rs walks those maps into SpatialNodes with the cycle/depth guards; spatial_elevation.rs reads IfcBuildingStorey.Elevation. spatial_tests.rs stays attached to this file and exercises functions from all three via use super::* plus the re-exports below.

Modulesยง

spatial_canonical_parent ๐Ÿ”’
Cycle-safe canonical-parent resolution, split out of spatial.rs (same reason spatial_elevation.rs, spatial_invariant.rs and spatial_tree.rs already are: stay under the module-size ratchet). Mirrors packages/parser/src/spatial-hierarchy-canonical-parent.ts, which split the same concern out of spatial-hierarchy-builder.ts for the same reason.
spatial_elevation ๐Ÿ”’
Storey-elevation extraction, split out of spatial.rs (#3965 follow-up): reading IfcBuildingStorey.Elevation, with the ObjectPlacement Z fallback, is a self-contained concern the tree-building code merely calls into. spatial_tests.rs (attached to the parent spatial module, not this one) exercises these functions directly via use super::*.
spatial_invariant ๐Ÿ”’
Structural invariant over a finished spatial-node set, split out of spatial.rs to stay under the module-size ratchet (the same reason spatial_tree.rs and spatial_elevation.rs exist).
spatial_lookups ๐Ÿ”’
The element -> spatial-container lookup tables of SpatialHierarchyData (element_to_storey and friends), split out of spatial.rs for the module-size ratchet. Built after the node tree so the storey ruling can tell a project-reachable storey from a rescued orphan (#4310).
spatial_tree ๐Ÿ”’
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::*.

Functionsยง

build_spatial_hierarchy ๐Ÿ”’
Build spatial hierarchy from relationships.