# Wall Structure Geometry Verification Using TLS Data and BIM Model
## 2 Building Structures' Geometry Verification
### Geometry Identification from BIM Model
In the case of a wall, we need an additional parameter which is thickness, defined in the _IfCWall_ line. From the five wall parameters directly derived from the IFC (coordinates of the reference point, direction, height, thickness, and length) the mathematical definition of the walls must be determined for verification of their geometry. Therefore, coordinates of the center point (center of gravity), and the coefficients of the general equation of the plane (wall surface) are estimated. The coefficients of the general equation include the components of the normal vector. Both planes of a wall are calculated, as both can be used in the further procedure. It depends on whether both planes were scanned and have to be verified or not. To calculate the center of gravity of a plane, first, we need to calculate the four boundary points (corners). The calculation is based on the well-known orthogonal surveying method using the coordinates of the reference point (origin) of the wall, from  
Figure 2: Identification of wall geometry in IFC. which we subtract or add the half of the wall's thickness h recalculated to the direction of the coordinate system axis using the Equation (1):  
\[X_{1}=X_{\text{ref}}\pm\frac{h}{2}\cdot Y_{\text{dirr}},\ Y_{1}=Y_{\text{ref}} \pm\frac{h}{2}\cdot X_{\text{dirr}} \tag{1}\]  
where Xref, Yref are the coordinates of the reference point, h is thickness of the wall, and Xdir, Ydir are the elements of the unit vector defining the direction of the wall. The plus or minus sign in the above equations is chosen according to whether we determine the inner or outer planes of the wall. The remaining three boundary points (2, 3, 4) can be calculated similarly using Equation (1). The center of gravity of the plane is calculated as the arithmetic mean of the four corners of the plane using the Equation (2):  
\[X_{\text{mean}}=\sqrt{\frac{1}{n}}\sum_{i=1}^{n}X_{i},\ Y_{\text{mean}}= \sqrt{\frac{1}{n}}\sum_{i=1}^{n}Y_{i},\ Z_{\text{mean}}=\sqrt{\frac{1}{n}} \sum_{i=1}^{n}Z_{i} \tag{2}\]  
where X, Y, and Z are the coordinates of the corners. Subsequently, two auxiliary vectors are calculated from three points of the plane according to (3):  
\[\mathbf{u}=[X_{4}-X_{1},Y_{4}-Y_{1},Z_{4}-Z_{1}],\mathbf{v}=[X_{2}-X_{1},Y_{2 }-Y_{1},Z_{2}-Z_{1}]. \tag{3}\]  
As the vector product of the vectors \(\mathbf{u}\) and \(\mathbf{v}\), the normal vector n of the plane is calculated using Equation (4). Then, the general equation of the plane (5) can be defined from the calculated elements of the normal vector. \[\mathbf{n}=(\mathbf{a},\mathbf{b},\mathbf{c})=\frac{\mathbf{u}\times\mathbf{v }}{|\mathbf{u}\times\mathbf{v}|}. \tag{4}\]  
\[\mathbf{a}\cdot X+\mathbf{b}\cdot Y+\mathbf{c}\cdot Z+d=0, \tag{5}\]  
where d calculated by (6) is the scalar product of the normal vector of the plane and the position vector of the center of gravity. \[d=-(\mathbf{a}\cdot X_{\text{mean}}+\mathbf{b}\cdot Y_{\text{mean}}+\mathbf{ c}\cdot Z_{\text{mean}}). \tag{6}\]  
The results of the algorithm for identification of the geometry of structural elements from IFC are the coordinates of the center points (centers of gravity) of individually verified walls, the unit normal vectors of walls' planes, and the general equations of planes (Figure 3). After the wall plane segments are extracted from the as-planned IFC model, the corresponding planes are segmented from the as-built point cloud data. The procedure of this segmentation is described in the following section.