# Wall Structure Geometry Verification Using TLS Data and BIM Model
## 2 Building Structures' Geometry Verification
### Creation of Deviation Maps  
The last step of the approach for building structures' geometry verification according to the flowchart in Figure 1 is the comparison of the as-planned data derived from the BIM model and the as-built data from the point cloud. The deviations are expressed in the form of tables and deviation maps. Two deviation maps are generated for each wall plane. The first deviation map is created by comparison of the plane determined from IFC and the corresponding segmented subset of the point cloud (Figure 12). The distance of each point from the as-planned plane is calculated in the direction of the plane's normal vector. The distances are calculated as a dot product of vectors containing the coordinate differences  
Figure 11: Segmented point cloud—additional curve segmentation used.  
Figure 10: Final segmentation curves. Transparent colors represent the segments of the image.  
between the given point and the centroid point and the normal vector of the plane. The distances are positive if the point is on the same side of the plane as the normal vector and negative if it is on the opposite side. Considering the general equation of the plane (5) and the fact that the normal vector of the plane is normalized (with length equal to 1), the distances are calculated using Equation (12):  
\[\text{a}\cdot\text{X}_{\text{P}}+\text{b}\cdot\text{Y}_{\text{P}}+\text{c} \cdot\text{Z}_{\text{P}}+\text{d}=\text{dist}. \tag{12}\]  
where \(\text{X}_{\text{P}}\), \(\text{Y}_{\text{P}}\), and \(Z_{\text{P}}\) are the coordinates of a given point of the subset.  
Subsequently, the points are colored according to the signed distances of the points from the plane. For practical use, especially in case of dense point clouds, the deviation map can be downsampled (e.g., 20 mm \(\times\) 20 mm) to present the deviation map in the form of more homogeneously distributed points. It can be performed using grid average method, which means that the points within the same grid box are merged to a single point.  
In addition to the deviation map, the rotation (difference between the orientation of normal vectors) and the deviation between both planes' coefficient d are calculated. The rotation of the planes is calculated according to Equation (13):  
\[\alpha=\text{acos}(\text{n}_{\text{IFC}}\cdot\text{n}_{\text{PoC}}), \tag{13}\]  
where n\({}_{\text{IFC}}\) is the normal vector of the wall plane from the BIM model and n\({}_{\text{PoC}}\) is the normal vector of the estimated regression plane from the segmented point cloud. The deviation between the two models' coefficient d is calculated using Equation (14):  
\[\delta=(|\text{d}_{\text{IFC}}|-|\text{d}_{\text{PoC}}|), \tag{14}\]  
where d\({}_{\text{IFC}}\) is the distance of the IFC plane from the origin of the coordinate system and d\({}_{\text{PoC}}\) is the distance of the estimated regression plane from the origin of the coordinate system.  
The second deviation map (generated for the same wall) quantifies the flatness of the wall (Figure 13). The flatness of the wall is calculated as the orthogonal distance of each point of the point cloud from the estimated regression plane using (12).  
The advantage of the approach described above over existing methods is that a detailed segmentation and filtration of the point cloud is performed. Deleting points not directly related to the surface of the inspected wall increases the accuracy of the results. The biggest contribution of the paper in this field is the developed extended evolving plane curve segmentation, which identifies the openings and the objects not creating the surface of the wall. This is crucial in case of the flatness inspection of the walls, otherwise, the deviation maps will contain false information.  
Figure 12: Deviation map—comparison of the IFC plane and the segmented point cloud.