pub struct Axis2Placement3D<'m> { /* private fields */ }Expand description
A borrowed view of an IfcAxis2Placement3D: origin, local Z, local X.
Implementations§
Source§impl<'m> Axis2Placement3D<'m>
impl<'m> Axis2Placement3D<'m>
Sourcepub fn new(id: EntityId, entity: &'m Entity) -> Self
pub fn new(id: EntityId, entity: &'m Entity) -> Self
Wrap an entity assumed to be an IfcAxis2Placement3D.
Sourcepub fn location(&self, model: &'m Model) -> GeometryResult<[f64; 3]>
pub fn location(&self, model: &'m Model) -> GeometryResult<[f64; 3]>
The origin, promoted to 3D.
Sourcepub fn axis(&self, model: &'m Model) -> GeometryResult<Option<[f64; 3]>>
pub fn axis(&self, model: &'m Model) -> GeometryResult<Option<[f64; 3]>>
The local Z direction if Axis is present, normalized.
None means the file omitted it, which is legal and means global Z.
The distinction is kept rather than defaulted here so
Self::transform can hand from_axes the real “absent” case and get
the spec’s paired default for RefDirection too.
Sourcepub fn ref_direction(
&self,
model: &'m Model,
) -> GeometryResult<Option<[f64; 3]>>
pub fn ref_direction( &self, model: &'m Model, ) -> GeometryResult<Option<[f64; 3]>>
The approximate local X direction if RefDirection is present.
“Approximate” because the schema only requires it to be non-parallel to
Axis; the true X is its projection onto the plane normal to Axis.
Sourcepub fn transform(&self, model: &'m Model) -> GeometryResult<Transform>
pub fn transform(&self, model: &'m Model) -> GeometryResult<Transform>
The placement as an orthonormal transform.
Delegates the Gram-Schmidt projection to
Transform::from_axes, which also supplies the schema defaults when
Axis or RefDirection is absent. Parallel axes are
crate::GeometryError::Degenerate – they define no unique frame, and the
schema’s AxisToRefDirPosition rule forbids them.
Trait Implementations§
Source§impl<'m> Clone for Axis2Placement3D<'m>
impl<'m> Clone for Axis2Placement3D<'m>
Source§fn clone(&self) -> Axis2Placement3D<'m>
fn clone(&self) -> Axis2Placement3D<'m>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more