# A BIM Based Framework for Damage Segmentation, Modeling, and Visualization Using IFC
## 4 Implementation
### As-Damaged BIM with IFC  
As aforementioned in Section 2.2, this study aims to provide a framework with respect to the big open BIM concept. In compliance with this requirement, the IFC 4 standard is used for the implementation of this data model [60]. Four different entities may be used to represent the defect annotation: _IfcProxy_, _IfcVoidingFeature_, _IfcSurfaceFeature_, or _IfcAnnotation_. Proxies are generic elements that can represent every entity not included in the IFC so far, and hence, are suitable for any damage type. Voiding features lead to a subtraction of the defect geometry from geometry of the affected component. This circumstance is applicable for physical defects. Surface features represent changes on the surface of a component, such as corrosion. Annotations are designed to add further information to a component. In case of divergences from national bridge requirements or norms, these annotations may be used.  
The defect product relation depends on the selection of the defect annotation. In case of using a voiding feature, _IfcRelVoidsElement_ is the way to go. This relationship leads to  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Metric** & **Mean** & **Std** \\ \hline Dice (F1) & 0.8304 & 0.1754 \\ Jaccard (IoU) & 0.8326 & 0.2013 \\ Accuracy & 0.9196 & 0.0672 \\ Precision & 0.8755 & 0.1672 \\ Recall & 0.8136 & 0.2057 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Mean Performance metrics values for the F1 score, Jaccard index, Accuracy, Precision, and Recall of the retrained TernausNet16 model respectively. The column mean shows the mean values and std contains standard deviations.  
cutting out the defect geometry from the component geometry. However, providing a geometric representation context would not be possible in this case. Another possibility is to assign a defect to a component with _IfcRelAssociatesProduct_. A defect is part of a component as long as both exist; hence, an aggregation is suitable as well. For the defect cause, only the assignment is applicable. Figure 8 shows a block diagram as overview of the designed IFC structure. The _IfcVoidingFeature_ represents the defect at the building element. Further data, for example, measurements or ratings, may be included by _IfcPropertySets_. A type of a defect is realized with the _IfcTypeObject_ or one of its sub-classes. Additional documents, such as additional reports or photos, are included via _IfcDocumentReferences_.  
IFC offers additional classifications via _IfcTypeObject_. Type objects are linked to the related instances via _IfcRelDefinesByType_. _IfcDocumentReference_ provides the functionality to include external documents or additional photos. Properties and property sets are used to incorporate measurement data.  
Geometries are stored as _IfcGeometricRepresentationItems_. Several subclasses of this class provide possibilities to model different geometries, for example, surface models, solid models, or Constructive Solid Geometries (CSG). Any geometry has a relation to a representation that again has a relation to an _IfcRepresentationContext_.  
For texturing a 3D model or a part of it, the texture is provided by _IfcSurfaceTexture_. Based on the used subclass, a blob, image, or pixel texture is provided. By using a styled item and a surface style, the texture is connected to the geometric representation item. Besides  the image for the texture, the texture mapping is required. The texture mapping defines which vertex of the geometry corresponds to which coordinate in the texture. This may be done via an algorithm or explicitly. IFC provides the class _IfcTextureCoordinate_ to provide this mapping information.