pub struct PlacementResolver { /* private fields */ }Expand description
Resolves placement chains to world transforms, with memoization.
§Why a resolver rather than a free function
Placement chains share their upper links: every element in a storey walks the same storey-building-site tail. Caching per placement turns repeated work into a lookup, which matters because this runs once per element in the file.
§Every IfcObjectPlacement kind (#363)
IFC4.3 ADD2 declares PlacementRelTo : OPTIONAL IfcObjectPlacement on
IfcObjectPlacement itself, so any placement may be relative to any
other: a bracket on a linearly placed signal mast, a fixing on a column
placed on a grid. The walk resolves each link by its kind –
IfcLocalPlacement by its RelativePlacement, IfcGridPlacement by
its grid intersection in the grid’s frame (#362),
IfcLinearPlacement along its basis curve in the alignment’s frame
(#357) – and caches each. Grid and linear placements reach their frames
through further placements (the grid’s or the alignment’s
ObjectPlacement), so the walk follows those too; the depth limit and
the cycle check cover the whole mixed chain.
A resolver’s cache holds transforms resolved one way: the crate’s entry points use a fresh resolver per resolution mode, so a cached linear placement never mixes a cache-only answer with a derived one.
Implementations§
Source§impl PlacementResolver
impl PlacementResolver
Sourcepub fn world_transform(
&mut self,
model: &Model,
placement: EntityId,
) -> GeometryResult<Transform>
pub fn world_transform( &mut self, model: &Model, placement: EntityId, ) -> GeometryResult<Transform>
Resolve a placement to its world transform, in FILE units.
Walks PlacementRelTo to the root, then composes downward. Detects
cycles rather than overflowing the stack, and reports the entity where
the cycle closes so the file can be repaired.
Every placement kind resolves (#363): an IfcGridPlacement with
straight axes, and an IfcLinearPlacement from its cached
CartesianPosition. Deriving an uncached linear placement or
intersecting curved grid axes needs a curve evaluator, which this
entry point does not take: those are refused by name, and
product_world_transform_with_evaluator (feature compile) resolves
them.