Skip to main content

MeshData

Struct MeshData 

Source
pub struct MeshData {
Show 16 fields pub express_id: u32, pub ifc_type: String, pub global_id: Option<String>, pub name: Option<String>, pub presentation_layer: Option<String>, pub positions: Vec<f32>, pub normals: Vec<f32>, pub indices: Vec<u32>, pub color: [f32; 4], pub material_name: Option<String>, pub geometry_item_id: Option<u32>, pub properties: Option<BTreeMap<String, String>>, pub uvs: Option<Vec<f32>>, pub texture: Option<MeshTextureData>, pub geometry_class: u8, pub origin: [f64; 3],
}
Expand description

Individual mesh data with geometry and metadata.

Fields§

§express_id: u32

Express ID of the IFC element.

§ifc_type: String

IFC type name (e.g., “IfcWall”).

§global_id: Option<String>

IFC GlobalId (Root attribute #0) when available.

§name: Option<String>

IFC Name (Root/Object attribute #2) when available.

§presentation_layer: Option<String>

IFC presentation layer assignment name when available.

§positions: Vec<f32>

Vertex positions (x, y, z triplets).

§normals: Vec<f32>

Vertex normals (x, y, z triplets).

§indices: Vec<u32>

Triangle indices.

§color: [f32; 4]

RGBA color [r, g, b, a] in 0-1 range.

§material_name: Option<String>

Optional material/style name resolved from per-item IFC styling.

§geometry_item_id: Option<u32>

Optional source geometry item id for submesh outputs.

§properties: Option<BTreeMap<String, String>>

Optional IFC property set values keyed by IFC property names. Primarily attached for IfcSpace/IfcZone so downstream tools can build room attribute UIs.

§uvs: Option<Vec<f32>>

Per-vertex texture coordinates (u, v pairs, 1:1 with positions), present only for textured meshes (issue #961).

§texture: Option<MeshTextureData>

Decoded surface texture, present only for textured meshes (#961).

§geometry_class: u8

Provenance of the geometry for the viewer’s Model/Types switch (#957): 0 = ordinary occurrence, 1 = orphan type-product RepresentationMap (no occurrence instantiates it), 2 = instanced type-product map (the type library shape; its occurrences already draw the real geometry). Serde-default so existing JSON payloads and disk caches stay readable; skipped when 0 so ordinary meshes serialize byte-identically.

§origin: [f64; 3]

Per-mesh local origin (world/RTC frame, f64). positions are stored RELATIVE to this — the world position of a vertex is origin + position — so building/georef-scale placement never collapses adjacent vertices to bit-identical f32. The renderer applies it as a per-mesh translation (camera-relative). [0, 0, 0] ⇒ positions are absolute (legacy/local). Serde-default + skip-when-zero so existing payloads/caches stay readable and local meshes serialize byte-identically.

Implementations§

Source§

impl MeshData

Source

pub fn new( express_id: u32, ifc_type: String, positions: Vec<f32>, normals: Vec<f32>, indices: Vec<u32>, color: [f32; 4], ) -> Self

Create a new MeshData from geometry components.

Source

pub fn with_geometry_class(self, geometry_class: u8) -> Self

Tag the geometry’s provenance for the Model/Types view switch (#957).

Source

pub fn with_origin(self, origin: [f64; 3]) -> Self

Set the per-mesh local origin (positions are relative to it).

Source

pub fn with_texture(self, uvs: Vec<f32>, texture: MeshTextureData) -> Self

Attach per-vertex UVs + a decoded surface texture (issue #961). uvs must be 1:1 with positions (2 floats per vertex).

Source

pub fn with_element_metadata( self, global_id: Option<String>, name: Option<String>, presentation_layer: Option<String>, ) -> Self

Set element-level IFC metadata.

Source

pub fn with_style_metadata( self, material_name: Option<String>, geometry_item_id: Option<u32>, ) -> Self

Set material name and source geometry item id metadata.

Source

pub fn with_properties( self, properties: Option<BTreeMap<String, String>>, ) -> Self

Attach optional IFC property set values.

Source

pub fn vertex_count(&self) -> usize

Get the number of vertices.

Source

pub fn triangle_count(&self) -> usize

Get the number of triangles.

Source

pub fn is_empty(&self) -> bool

Check if the mesh is empty.

Trait Implementations§

Source§

impl Clone for MeshData

Source§

fn clone(&self) -> MeshData

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 Debug for MeshData

Source§

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

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

impl<'de> Deserialize<'de> for MeshData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MeshData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more