# A BIM Based Framework for Damage Segmentation, Modeling, and Visualization Using IFC
## 3 Methodology
### Damage Modeling  
Damage modeling includes geometric and semantic modeling. After the calculation of the geometry, it is necessary to create an as-damaged BIM. This includes the alignment and linking of the damage. Aligning the defect geometry correctly in the resulting BIM model requires the coordinate transformation between the generated point cloud and the BIM model. For this purpose, a BIM model of the afflicted structure or component is generated and a synthetic point cloud is calculated based on this model. The dense point cloud from the SfM and the synthetic point cloud from the BIM model may be aligned manually or by using automated methods such as Iterative Closest Point (ICP) algorithm [50; 51]. The data model is the central exchange point for the entire framework. Section 2.2 discussed the requirements of an open standard supporting multiple domains. Figure 7 shows a UML class diagram of the final data model incorporating semantic and geometric data. Blue elements are semantic data, visual data is depicted in green, and yellow elements refer to geometric data. Bridge related classes are colored in gray. A single defect is represented by a _DefectAnnotation_ with a name, id, and description. Such defect needs a relationship to the affected component; this relationship is realized with an objectified relationship; namely either the _DefectProductRelation_ or the _DamageGeometryCutout_. The former relationship only represents that a defect affects a component. The latter includes the geometric impact of a defect, such as the subtraction in case of a spalling. Objectified relationships may carry additional information, for example, a name and description. Furthermore, the defect has a _DamageType_; damage types may be crack, spalling, or corrosion. Some defects need additional measurements, such as width or depth. This information is stored in a _Measurement_ object. Several _Measurements_ are grouped into a _MeasurementSet_. As an example, the breadth and depth of a spalling are stored as measurements with a value and unit. These two measurements are grouped into a measurement set as geometric parameters. Figure 6: Workflow of the geometry generation with triangulation and extrusion. Figure 7: UML diagram of the data model. Semantic data is depicted in blue. Yellow elements refer to geometric data and green elements are related to visual data. The gray elements are related to the bridge. Defects may have relationships to other defects, such as a cause or an effect, that is stored in the objectified _DefectCause_ relationship, for example, a spalling is the resulting defect of a corrosion. Last, additional documents may be provided for further information about a defect or damaged component. For this purpose, a _DocumentReference_ is available. This document reference stores at least a label of the document, an identifier, and the URI to the document. Images, for example, photos or sketches, are a combination of geometric, semantic, pixel position, and pixel color density data. If images are rectified, they may be used as textures depicted on a 3D geometry. For this purpose, the data model contains the class _Texturing_. A texture needs a defined area to be placed onto; this information is stored in the _TextureArea_ class. The _Texturing_ itself contains the URI of the image and is linked to the _DefectAnnotation_. Geometry data are crucial for physical defects, for instance cracks or spalling. A defect annotation and a building product have one or more geometries. Multiple geometries occur if a defect has been registered repeatedly over time or if a component has an undamaged and damaged representation. To consider multiple geometries with the related context information, the geometry has a related _RepresentationContext_. On the basis of the BIM model with the related geometric damage information, further semantic and visual data is added. Several studies proposed methods for automatic semantic enrichment. Although, this study relies on manual semantic enrichment, automatic enrichment may be used as well.