pub struct Direction<'m> { /* private fields */ }Expand description
A borrowed view of an IfcDirection.
Implementations§
Source§impl<'m> Direction<'m>
impl<'m> Direction<'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 IfcDirection.
Sourcepub fn ratios(&self) -> GeometryResult<Vec<f64>>
pub fn ratios(&self) -> GeometryResult<Vec<f64>>
The raw DirectionRatios, unnormalized and of the file’s own length.
Sourcepub fn dimension(&self) -> GeometryResult<usize>
pub fn dimension(&self) -> GeometryResult<usize>
How many ratios the direction carries: 2 or 3.
Sourcepub fn ratios_3d(&self) -> GeometryResult<[f64; 3]>
pub fn ratios_3d(&self) -> GeometryResult<[f64; 3]>
The ratios promoted to 3D with z = 0, still unnormalized.
A 2D direction’s third component is genuinely zero (it lies in the
plane), unlike a 2D point’s z, so padding here is not a guess. It is
still a separate call from Self::ratios so a caller that needs the
dimension can ask for it.
Sourcepub fn unit(&self) -> GeometryResult<[f64; 3]>
pub fn unit(&self) -> GeometryResult<[f64; 3]>
The direction as a normalized 3D vector.
Fails with crate::GeometryError::Degenerate on a zero-length direction
rather than returning NaN components, because a NaN here is found
three subsystems later as missing geometry.
Trait Implementations§
Auto Trait Implementations§
impl<'m> Freeze for Direction<'m>
impl<'m> RefUnwindSafe for Direction<'m>
impl<'m> Send for Direction<'m>
impl<'m> Sync for Direction<'m>
impl<'m> Unpin for Direction<'m>
impl<'m> UnsafeUnpin for Direction<'m>
impl<'m> UnwindSafe for Direction<'m>
Blanket Implementations§
Source§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
Mutably borrows from an owned value. Read more