mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
3e55c5126c
IfcTriangulatedFaceSet and IfcPolygonalFaceSet used CoordIndex values to index Coordinates.CoordList directly, ignoring the optional PnIndex attribute. When PnIndex is present it remaps point references, so a CoordIndex value i must resolve as CoordList[PnIndex[i-1]-1] (both 1-based). Without the indirection any model carrying a PnIndex was built from the wrong points. Add a resolve() helper in both mappings that applies the PnIndex indirection when present and is a plain bounds-checked lookup otherwise, with bounds checks at both index levels. When PnIndex is absent the behavior is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>