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: u32Express ID of the IFC element.
ifc_type: StringIFC 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: u8Provenance 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
impl MeshData
Sourcepub fn new(
express_id: u32,
ifc_type: String,
positions: Vec<f32>,
normals: Vec<f32>,
indices: Vec<u32>,
color: [f32; 4],
) -> Self
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.
Sourcepub fn with_geometry_class(self, geometry_class: u8) -> Self
pub fn with_geometry_class(self, geometry_class: u8) -> Self
Tag the geometry’s provenance for the Model/Types view switch (#957).
Sourcepub fn with_origin(self, origin: [f64; 3]) -> Self
pub fn with_origin(self, origin: [f64; 3]) -> Self
Set the per-mesh local origin (positions are relative to it).
Sourcepub fn with_texture(self, uvs: Vec<f32>, texture: MeshTextureData) -> Self
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).
Sourcepub fn with_element_metadata(
self,
global_id: Option<String>,
name: Option<String>,
presentation_layer: Option<String>,
) -> Self
pub fn with_element_metadata( self, global_id: Option<String>, name: Option<String>, presentation_layer: Option<String>, ) -> Self
Set element-level IFC metadata.
Sourcepub fn with_style_metadata(
self,
material_name: Option<String>,
geometry_item_id: Option<u32>,
) -> Self
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.
Sourcepub fn with_properties(
self,
properties: Option<BTreeMap<String, String>>,
) -> Self
pub fn with_properties( self, properties: Option<BTreeMap<String, String>>, ) -> Self
Attach optional IFC property set values.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Get the number of vertices.
Sourcepub fn triangle_count(&self) -> usize
pub fn triangle_count(&self) -> usize
Get the number of triangles.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MeshData
impl<'de> Deserialize<'de> for MeshData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MeshData
impl RefUnwindSafe for MeshData
impl Send for MeshData
impl Sync for MeshData
impl Unpin for MeshData
impl UnsafeUnpin for MeshData
impl UnwindSafe for MeshData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.