Object Styles
In IFC, styles can be applied to objects by assigning them visual rendition properties via a material presentation assignment or a geometry presentation assignment as depicted by the figure below.
The pitotal element is the IfcStyledItem
According to the IfcStyledItem defintion:
The IfcStyledItem holds presentation style information for products, either explicitly for an IfcGeometricRepresentationItem being part of an IfcShapeRepresentation assigned to a product, or by assigning presentation information to IfcMaterial being assigned as other representation for a product.
- If the IfcStyledItem is used within a reference from an IfcProductDefinitionShape then one Item shall be provided.
- If the IfcStyledItem is used within a reference from an IfcMaterialDefinitionRepresentation then no Item shall be provided.
As shown on the figure the IfcGeometricRepresentationItem is ABSTRACT. Hence, it is not used as such and instead a 'non abstract' item will be used.
It can be an: (this is not limitative)
- "IfcBooleanClippingResult"
- "IfcBoundingBox"
- "IfcExtrudedAreaSolid"
- "IfcFaceBasedSurfaceModel"
- "IfcFacetedBrep"
- "IfcGeometricCurveSet"
- "IfcGeometricSet"
- "IfcIndexedPolyCurve"
- "IfcMappedItem"
- "IfcPolygonalFaceSet"
Impact on IfcJSON
They are not handled by the IfcJSON framework and we have adapted the code to account for styling.
Styles are not critical for most Administrative Procedures which will mainly use PropertySets. However, we are used to a nice rendition and it is a convenient addition.
Example of link between a Door and a Style
This example is extracted from an IFC2X3 files and contains a IfcDoorStyle. In IFC4, it would be an IfcDoorType, but the relationships would be the same. This example is provided to understand the role of the IfcRelDefinesByType and IfcStyledItems in assigning a color to the door.
erDiagram
item_93 ["#93 IfcDoor"]
item_199 ["#199 IfcRelDefinesByType"]
item_196 ["#196 IfcDoorStyle"]
item_69 ["#69 IfcRepresentationMap"]
item_68 ["#68 IfcShapeRepresentation"]
item_60 ["#60 IfcExtrudedAreaSolid"]
item_182 ["#182 IfcStyledItem"]
item_181 ["#181 IfcPresentationStyleAssignment"]
item_180 ["#180 IfcSurfaceStyle"]
item_179 ["#179 IfcSurfaceStyleRendering"]
item_178 ["#178 IfcColourRgb"]
item_92 ["#92 IfcProductDefinitionShape"]
item_72 ["#72 IfcShapeRepresentation"]
item_71 ["#71 IfcMappedItem"]
item_93 ||--|| item_92 : ""
item_92 ||--|| item_72 : ""
item_72 ||--|| item_71 : ""
item_71 ||--|| item_69 : ""
item_199 ||--|{ item_93 : ""
item_199 ||--|| item_196 : ""
item_196 ||--|| item_69 : ""
item_69 ||--|| item_68 : ""
item_68 ||--|| item_60 : ""
item_182 ||--|| item_60 : ""
item_182 ||--|{ item_181 : ""
item_181 ||--|| item_180 : ""
item_180 ||--|| item_179 : ""
item_179 ||--|| item_178 : ""
style item_182 fill:teal
style item_199 fill:teal