pub struct Placement {
pub location: DVec3,
pub axis: DVec3,
pub ref_direction: DVec3,
}Expand description
An object placement, modelled as IFC models it.
Stored as IfcAxis2Placement3D does — a location plus a Z axis and a reference X axis —
rather than as a raw 4×4. Keeping the IFC shape avoids a lossy decomposition on every
export, and it makes a non-orthogonal or mirrored transform impossible to represent by
accident.
Fields§
§location: DVec3§axis: DVec3Local Z. Normalised on construction.
ref_direction: DVec3Local X. Orthogonalised against axis on construction.
Implementations§
Source§impl Placement
impl Placement
pub fn at(location: DVec3) -> Self
Sourcepub fn new(location: DVec3, axis: DVec3, ref_direction: DVec3) -> Self
pub fn new(location: DVec3, axis: DVec3, ref_direction: DVec3) -> Self
Build a placement, normalising axis and orthogonalising ref_direction against it.
Degenerate input (zero-length or parallel axes) falls back to the identity basis rather than producing a silently broken transform.
Sourcepub fn from_matrix(matrix: DMat4) -> Self
pub fn from_matrix(matrix: DMat4) -> Self
Recover a placement from a rigid transform.
Import needs this: IFC nests placements, so an element’s transform is the composition
of its whole IfcLocalPlacement chain, and getting back to a storey-relative placement
means composing, inverting, and decomposing.
Only rotation and translation survive. Scale and shear are discarded by
re-orthogonalising, because Placement cannot represent them and silently keeping a
scaled basis would corrupt every downstream length.
Sourcepub fn translated(self, delta: DVec3) -> Self
pub fn translated(self, delta: DVec3) -> Self
Translate without touching orientation.