pub struct BoundingBox<'m> { /* private fields */ }Expand description
IfcBoundingBox: a box given by a corner and three extents.
Implementations§
Source§impl<'m> BoundingBox<'m>
impl<'m> BoundingBox<'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 IfcBoundingBox.
Sourcepub fn corner(&self) -> GeometryResult<EntityId>
pub fn corner(&self) -> GeometryResult<EntityId>
The IfcCartesianPoint reference at the box’s minimum corner.
TODO: resolve through the point module once it exists; this crate deliberately does not define a competing point view.
Sourcepub fn x_dim(&self) -> GeometryResult<f64>
pub fn x_dim(&self) -> GeometryResult<f64>
Extent along the local X axis, in file length units.
Sourcepub fn y_dim(&self) -> GeometryResult<f64>
pub fn y_dim(&self) -> GeometryResult<f64>
Extent along the local Y axis, in file length units.
Sourcepub fn z_dim(&self) -> GeometryResult<f64>
pub fn z_dim(&self) -> GeometryResult<f64>
Extent along the local Z axis, in file length units.
Sourcepub fn dimensions(&self) -> GeometryResult<[f64; 3]>
pub fn dimensions(&self) -> GeometryResult<[f64; 3]>
All three extents, in local X, Y, Z order.
Sourcepub fn checked_dimensions(&self) -> GeometryResult<[f64; 3]>
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.
Sourcepub fn max_corner_local(&self, corner: [f64; 3]) -> GeometryResult<[f64; 3]>
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.