pub struct Axis2Placement {
pub location: [f64; 3],
pub axis: Option<[f64; 3]>,
pub ref_direction: Option<[f64; 3]>,
pub planar: bool,
}Expand description
The attributes of an IfcAxis2Placement3D or IfcAxis2Placement2D: raw
Axis and RefDirection ratios (None when $), orthonormalised only by
Self::matrix.
Points and directions are read under the one leaf rule of
EntityDecoder::{point3, direction3} (D26): 2 or 3 finite numbers, a 2D
value promotes to z = 0, anything else is refused and counted (D3).
Fields§
§location: [f64; 3]§axis: Option<[f64; 3]>§ref_direction: Option<[f64; 3]>§planar: boolRead from an IfcAxis2Placement2D: axis is +Z, location has z = 0.
Implementations§
Source§impl Axis2Placement
impl Axis2Placement
Sourcepub fn read_3d(
placement: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
) -> PlacementResult<Self>
pub fn read_3d( placement: &DecodedEntity, decoder: &mut EntityDecoder<'_>, ) -> PlacementResult<Self>
Read the attribute layout of an IfcAxis2Placement3D: Location (0),
Axis (1), RefDirection (2). A wrong record type is refused and counted.
Sourcepub fn read_2d(
placement: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
) -> PlacementResult<Self>
pub fn read_2d( placement: &DecodedEntity, decoder: &mut EntityDecoder<'_>, ) -> PlacementResult<Self>
Read the attribute layout of an IfcAxis2Placement2D: Location (0),
RefDirection (1). The Axis is +Z, so Self::matrix is the XY frame
of [build_axis2_matrix]. A wrong record type is refused and counted.
Sourcepub fn read(
placement: &DecodedEntity,
decoder: &mut EntityDecoder<'_>,
) -> PlacementResult<Self>
pub fn read( placement: &DecodedEntity, decoder: &mut EntityDecoder<'_>, ) -> PlacementResult<Self>
Self::read_3d or Self::read_2d by the record’s type; any other
type is PlacementError::Unsupported.
Sourcepub fn read_id(
id: u32,
decoder: &mut EntityDecoder<'_>,
) -> PlacementResult<Self>
pub fn read_id( id: u32, decoder: &mut EntityDecoder<'_>, ) -> PlacementResult<Self>
Decode id, then Self::read.
Trait Implementations§
Source§impl Clone for Axis2Placement
impl Clone for Axis2Placement
Source§fn clone(&self) -> Axis2Placement
fn clone(&self) -> Axis2Placement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Axis2Placement
impl Debug for Axis2Placement
Source§impl PartialEq for Axis2Placement
impl PartialEq for Axis2Placement
impl Copy for Axis2Placement
impl StructuralPartialEq for Axis2Placement
Auto Trait Implementations§
impl Freeze for Axis2Placement
impl RefUnwindSafe for Axis2Placement
impl Send for Axis2Placement
impl Sync for Axis2Placement
impl Unpin for Axis2Placement
impl UnwindSafe for Axis2Placement
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.