Skip to main content

BoundingBox

Struct BoundingBox 

Source
pub struct BoundingBox<'m> { /* private fields */ }
Expand description

IfcBoundingBox: a box given by a corner and three extents.

Implementations§

Source§

impl<'m> BoundingBox<'m>

Source

pub fn new(id: EntityId, entity: &'m Entity) -> Self

Wrap an entity assumed to be an IfcBoundingBox.

Source

pub fn id(&self) -> EntityId

The entity id.

Source

pub fn corner(&self) -> GeometryResult<EntityId>

The IfcCartesianPoint reference at the box’s minimum corner.

Self::corner_point resolves it through resource::point, which owns the point view; this module does not define a competing one.

Source

pub fn corner_point<'v>( &self, model: &'v Model, ) -> GeometryResult<CartesianPoint<'v>>

The minimum corner as a typed point view, resolved from the model.

Its coordinates are local to the containing representation; see the module docs before treating them as world coordinates.

Source

pub fn x_dim(&self) -> GeometryResult<f64>

Extent along the local X axis, in file length units.

Source

pub fn y_dim(&self) -> GeometryResult<f64>

Extent along the local Y axis, in file length units.

Source

pub fn z_dim(&self) -> GeometryResult<f64>

Extent along the local Z axis, in file length units.

Source

pub fn dimensions(&self) -> GeometryResult<[f64; 3]>

All three extents, in local X, Y, Z order.

Source

pub fn checked_dimensions(&self) -> GeometryResult<[f64; 3]>

The extents, rejecting the non-positive values the schema forbids.

A zero extent is not a flat-but-usable box: IfcPositiveLengthMeasure excludes it, and a consumer that accepts it will divide by it somewhere.

Source

pub fn max_corner_local(&self, corner: [f64; 3]) -> GeometryResult<[f64; 3]>

The local-space maximum corner, given the resolved minimum corner.

Takes the corner coordinates rather than resolving them, because IfcCartesianPoint belongs to another module. The result is in the same local system as the input; see the module docs before treating it as a world AABB bound.

Trait Implementations§

Source§

impl<'m> Clone for BoundingBox<'m>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'m> Copy for BoundingBox<'m>

Source§

impl<'m> Debug for BoundingBox<'m>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'m> Freeze for BoundingBox<'m>

§

impl<'m> RefUnwindSafe for BoundingBox<'m>

§

impl<'m> Send for BoundingBox<'m>

§

impl<'m> Sync for BoundingBox<'m>

§

impl<'m> Unpin for BoundingBox<'m>

§

impl<'m> UnsafeUnpin for BoundingBox<'m>

§

impl<'m> UnwindSafe for BoundingBox<'m>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.