Skip to main content

Module tessellated

Module tessellated 

Source
Expand description

Tessellated geometry: explicit meshes addressed by index.

§THE off-by-one that corrupts every mesh

Every index in this schema is 1-BASED. CoordIndex, PnIndex and InnerCoordIndices all count from 1 into the coordinate list, because EXPRESS aggregates are 1-based and the values are typed IfcPositiveInteger – the schema literally cannot express a 0.

Rust slices are 0-based. Feeding a raw CoordIndex to a Vec either panics at the last vertex or, far worse, shifts every triangle by one vertex and produces a mesh that still renders: recognisable, watertight-looking, and wrong everywhere. This is the single most damaging mistake available in IFC geometry.

The views here therefore expose both forms explicitly: *_indices_1based() returns the file’s own numbers, *_indices_0based() returns slice-ready indices and errors on a 0 rather than wrapping.

§The PnIndex indirection

When PnIndex is present the face indices do not point into Coordinates directly. They point into PnIndex, and the value found there is the (1-based) position in Coordinates. Skipping the hop silently reorders vertices whenever PnIndex is not the identity permutation, which is exactly when an exporter bothered to write it.

§Coordinates are read by resource::point

IfcCartesianPointList3D belongs to IfcGeometryResource, owned by crate::resource::point. These views return its EntityId, and TessellatedFaceSet::coordinate_list resolves it into that module’s view.

Re-exports§

pub use irregular_network::TriangulatedIrregularNetwork;
pub use polygonal::IndexedPolygonalFace;
pub use polygonal::IndexedPolygonalFaceWithVoids;
pub use polygonal::PolygonalFaceSet;
pub use triangulated::TriangulatedFaceSet;

Modules§

irregular_network
IfcTriangulatedIrregularNetwork: an IFC4X3 terrain mesh.
polygonal
IfcPolygonalFaceSet and the indexed faces it is built from.
triangulated
IfcTriangulatedFaceSet: an indexed triangle mesh.

Structs§

TessellatedFaceSet
IfcTessellatedFaceSet: the abstract face set, giving access to Coordinates.
TessellatedItem
IfcTessellatedItem: the abstract root of the tessellation family.