Description
When loading IFC files that define material colors through IfcMaterialDefinitionRepresentation
(e.g., via IfcRelAssociatesMaterial → IfcMaterialLayerSetUsage → IfcMaterial → IfcMaterialDefinitionRepresentation → IfcStyledRepresentation → IfcSurfaceStyle → IfcColourRgb),
the PlacedGeometry.color returned by web-ifc uses only the direct geometry-level IfcStyledItem
color, ignoring the material definition chain.
This causes elements like walls to appear gray/white instead of their intended material color.
Reproduction
IFC file: Duplex_A_20110907.ifc
(also known as Ifc2x3_Duplex_Architecture.ifc)
Affected elements: IfcWallStandardCase (e.g., #3797)
Material chain:
- Wall
#3797 → IfcRelAssociatesMaterial → IfcMaterialLayerSetUsage #3983
- Layer set
#3982 → IfcMaterialLayer → IfcMaterial "Masonry - Brick" #3876
IfcMaterialDefinitionRepresentation #3891 → IfcStyledRepresentation
IfcSurfaceStyle "Masonry - Brick" → IfcColourRgb (0.667, 0.392, 0.412) = pink/brick
Direct geometry style:
- Wall shape representation →
IfcStyledItem #3794 → IfcSurfaceStyle "Default Wall"
IfcColourRgb (0.502, 0.502, 0.502) = gray
Expected behavior: Material definition color (pink brick) should take priority or be
merged with the geometry-level style.
Actual behavior: Only the geometry-level "Default Wall" gray color is returned in
PlacedGeometry.color.
Environment
- web-ifc: 0.0.75
- @thatopen/components: 3.3.1
- @thatopen/fragments: 3.3.3
Notes
This appears to be a regression from web-ifc ~0.0.71 where the material definition
representation colors were correctly resolved. Elements with colors defined directly on
geometry representations (e.g., doors, windows) render correctly in both versions.
Description
When loading IFC files that define material colors through
IfcMaterialDefinitionRepresentation(e.g., via
IfcRelAssociatesMaterial → IfcMaterialLayerSetUsage → IfcMaterial → IfcMaterialDefinitionRepresentation → IfcStyledRepresentation → IfcSurfaceStyle → IfcColourRgb),the
PlacedGeometry.colorreturned by web-ifc uses only the direct geometry-levelIfcStyledItemcolor, ignoring the material definition chain.
This causes elements like walls to appear gray/white instead of their intended material color.
Reproduction
IFC file: Duplex_A_20110907.ifc
(also known as
Ifc2x3_Duplex_Architecture.ifc)Affected elements:
IfcWallStandardCase(e.g.,#3797)Material chain:
#3797→IfcRelAssociatesMaterial→IfcMaterialLayerSetUsage #3983#3982→IfcMaterialLayer→IfcMaterial"Masonry - Brick"#3876IfcMaterialDefinitionRepresentation #3891→IfcStyledRepresentationIfcSurfaceStyle"Masonry - Brick" →IfcColourRgb(0.667, 0.392, 0.412) = pink/brickDirect geometry style:
IfcStyledItem #3794→IfcSurfaceStyle"Default Wall"IfcColourRgb(0.502, 0.502, 0.502) = grayExpected behavior: Material definition color (pink brick) should take priority or be
merged with the geometry-level style.
Actual behavior: Only the geometry-level "Default Wall" gray color is returned in
PlacedGeometry.color.Environment
Notes
This appears to be a regression from web-ifc ~0.0.71 where the material definition
representation colors were correctly resolved. Elements with colors defined directly on
geometry representations (e.g., doors, windows) render correctly in both versions.