Skip to main content

derive_placement_transform

Function derive_placement_transform 

Source
pub fn derive_placement_transform(
    model: &Model,
    units: &UnitScale,
    placement: EntityId,
    expression: &PointByDistance,
    evaluator: &dyn CurveEvaluator,
) -> GeometryResult<Transform>
Expand description

Resolve an IfcPointByDistanceExpression by evaluating its basis curve.

evaluator supplies the capability; this function supplies the IFC reading and the unit handling. expression is in FILE units (read it with ifc_alignment and a length factor of 1, as derive_linear_placement_transform does); the distance and offsets are converted to metres before they cross the boundary, because the kernel is unitless.

The frame is (tangent, left, up) and the offsets follow IFC4.3: see the module documentation. The placement’s own Axis/RefDirection are not read here; derive_linear_placement_transform applies them.

Refuses, rather than approximating, when:

  • the basis curve is not one this bridge can lower to a Curve3
  • the evaluator reports it cannot measure distance on that curve, or measures a different distance than IFC states for it
  • the authored value is an IfcParameterValue on a basis curve whose IFC parameterisation is undefined (an alignment centreline)
  • the tangent is vertical, so there is no horizontal left
  • DistanceAlong lies on a tangent discontinuity and the evaluator cannot read its incoming side (GeometryError::SeamSideUnsupported, module documentation)
  • the basis curve is a curve relation and the evaluator reads single curves only (GeometryError::CurvePathUnsupported), or the authored value is an IfcParameterValue along one