Skip to main content

TriangulatedFaceSet

Struct TriangulatedFaceSet 

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

IfcTriangulatedFaceSet: triangles indexed into a shared point list.

§Closed decides what this even is

Closed = TRUE means the set is a boundary representation, a solid. Closed = FALSE or absent means it is a surface model with no interior. Only a closed set is a legal boolean operand, and only a closed set has a volume; treating an open one as a solid produces nonsense quantities.

§Normals

Normals is optional and, when present, is indexed per face or per vertex depending on Closed – the schema ties the two. Rather than guess, this view exposes the raw triples and leaves the choice to a consumer that has read the rule for its case.

Implementations§

Source§

impl<'m> TriangulatedFaceSet<'m>

Source

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

Wrap an entity assumed to be an IfcTriangulatedFaceSet.

Source

pub fn id(&self) -> EntityId

The entity id.

Source

pub fn base(&self) -> TessellatedFaceSet<'m>

The inherited IfcTessellatedFaceSet attributes.

Source

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

The IfcCartesianPointList3D reference holding the vertices.

Source

pub fn closed(&self) -> Option<bool>

Whether the mesh bounds a solid.

None means the file did not say. That is not the same as false for a consumer deciding whether the set may be a boolean operand: an unstated flag is a file defect worth reporting, not a licence to assume.

Source

pub fn normals(&self) -> Option<Vec<[f64; 3]>>

Optional normal triples, exactly as written.

Source

pub fn triangles_1based(&self) -> GeometryResult<Vec<[i64; 3]>>

Triangles as the file wrote them: 1-based vertex indices.

Use this to round-trip or to diff against a file. To index a Rust slice, use Self::triangles_0based instead.

Source

pub fn triangles_0based(&self) -> GeometryResult<Vec<[usize; 3]>>

Triangles as 0-based indices, ready to index a vertex Vec.

Applies PnIndex when it is present, so the result always addresses Coordinates directly. Rejects a 0 or negative index rather than wrapping it.

Source

pub fn pn_index_1based(&self) -> Option<Vec<i64>>

PnIndex exactly as written: 1-based positions in Coordinates.

Source

pub fn pn_index_0based(&self) -> GeometryResult<Option<Vec<usize>>>

PnIndex converted to 0-based, or None when absent.

When present, a CoordIndex value i selects PnIndex[i - 1], and that is the position in Coordinates. Skipping the hop silently permutes the mesh’s vertices.

Source

pub fn triangle_count(&self) -> GeometryResult<usize>

How many triangles the set declares.

Trait Implementations§

Source§

impl<'m> Clone for TriangulatedFaceSet<'m>

Source§

fn clone(&self) -> TriangulatedFaceSet<'m>

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 TriangulatedFaceSet<'m>

Source§

impl<'m> Debug for TriangulatedFaceSet<'m>

Source§

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

Formats the value using the given formatter. Read more

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
§

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

§

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.

§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.