Skip to main content

SolidKind

Enum SolidKind 

Source
pub enum SolidKind {
    Swept,
    Brep,
    Csg,
    HalfSpace,
    Boolean,
    Tessellated,
    SurfaceModel,
    BoundingBox,
    SectionedSpine,
}
Expand description

Which family of IfcGeometricModelResource an entity belongs to.

§Why classify at all

A representation item arrives as an untyped entity, and the correct handling differs by family in ways that are not recoverable later: a half space must be routed into a boolean, a boolean must be walked as a tree, a face set must have its 1-based indices converted. Deciding once, by name, keeps that dispatch out of every call site and keeps the volume semantics table in a single place.

Variants§

§

Swept

A swept solid: extrusion, revolution, directrix sweep or swept disk.

§

Brep

A boundary representation.

§

Csg

A CSG solid or one of the analytic primitives.

§

HalfSpace

A half space. Infinite; only valid as a boolean operand.

§

Boolean

A boolean result. Its operands form a tree and may nest.

§

Tessellated

A tessellated face set. Solid only when its Closed flag is TRUE.

§

SurfaceModel

A surface model or geometric set. Never encloses a volume.

§

BoundingBox

An IfcBoundingBox: a proxy extent, not geometry to build.

§

SectionedSpine

IfcSectionedSpine: cross sections along a spine.

Kept apart from Self::Swept because it subtypes IfcGeometricRepresentationItem directly, has a different slot layout, and needs interpolation a plain sweep does not.

Implementations§

Source§

impl SolidKind

Source

pub fn classify(type_name: &str) -> Option<Self>

Classify an IFC type name, case-insensitively.

Returns None for anything outside this schema, so a caller can pass any representation item and route the rest elsewhere.

Source

pub fn is_finite_solid(self) -> bool

Does this family enclose a finite volume on its own?

false for half spaces (infinite), booleans (depends on the operands), tessellated sets (depends on Closed), surface models and bounding boxes. A true here is the only safe licence to compute a volume without further checks.

Source

pub fn requires_boolean_context(self) -> bool

Must this be routed through a boolean rather than built directly?

true only for half spaces. Anything else may be built standalone, though not everything built will have a volume.

Trait Implementations§

Source§

impl Clone for SolidKind

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 Copy for SolidKind

Source§

impl Debug for SolidKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for SolidKind

Source§

impl PartialEq for SolidKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SolidKind

Auto Trait Implementations§

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.