Skip to content

Material colors from IfcMaterialDefinitionRepresentation not resolved in geometry color output #1833

@andreabanci87

Description

@andreabanci87

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 #3797IfcRelAssociatesMaterialIfcMaterialLayerSetUsage #3983
  • Layer set #3982IfcMaterialLayerIfcMaterial "Masonry - Brick" #3876
  • IfcMaterialDefinitionRepresentation #3891IfcStyledRepresentation
  • IfcSurfaceStyle "Masonry - Brick" → IfcColourRgb (0.667, 0.392, 0.412) = pink/brick

Direct geometry style:

  • Wall shape representation → IfcStyledItem #3794IfcSurfaceStyle "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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions