# A Layer-Wise Strategy for Indoor As-Built Modeling Using Point Clouds
## 3 Methodology
### Layer Contour Extraction
#### 3.4.2 Contour Extraction  
Inspired by the shrink-wrapping method from mesh reconstruction [24], we utilized a shrinkage process to obtain the regularized sub-contours. After that, we merged them along with the localizations of inner walls to complete the extraction of the contours. By this means, the boundary of each contour could represent the outer wall elements, and the inner wall elements could be recovered simultaneously. The shrink-wrapping method is a classical geometry-processing algorithm which has been widely utilized in mesh reconstruction, simplification, and remeshing [25; 26]. The basic principle behind shrink-wrapping is in its simulating process that a membrane is shrinking and finally wrapping onto an object. Therefore, the iso-surface of the reconstructed mesh is the wrapping membrane. Using  
Figure 12: The division process of 2D layer: (**a**) The localization of inner walls (blue circle: wall in multiple labels; red circle: Wall in the individual label), and (**b**) the layer division according to the inner wall positions. point clouds as input, a convex hull is constructed as the initial approximation (\"the membrane\"). Consequently, the shrinkage is completed by incrementally deleting triangles until all points lie on the reconstructed surface (\"wrapping on the object\"). The advantages of shrinking-wrapping are the robustness and toleration of most point clouds. Despite these two advantages, our implementation could produce water-tight and regularized contours. The main differences between our case and the traditional shrink-wrapping approach are three-fold: (1) The 2D application scenario, (2) the object of shrinkage, and (3) the strategy of the shrinking process. The detailed descriptions of (2) and (3) are in the following. 1. Sub-Contour Extraction  
The object of shrinkage: Compared with the conventional shrinking method, the object of our approach is linear primitive. Most of the wall elements are perpendicular to each other in the indoor environment, which means that there are two principle directions of each contour. As shown in Figure 13, the red lines denote the vertical primitives (type I), and the green lines indicate the horizontal primitives (type II). These two types of primitives are the dominant directions of the building. We can build a boundary box from the dominant directions as an initial approximation for the shrinkage. Although most of buildings are conforming to two dominant directions or the Manhattan-World assumption, there are not uncommon for the non-perpendicular wall elements in the real world. Accordingly, we introduce the arbitrary primitive as the type (type III) of linear primitive. Part 1 of Figure 13 shows an instance for the arbitrary primitive (depicted in blue color). Figure 13: The types of linear primitives in sub-contours: vertical primitives (red), horizontal primitives (green), and arbitrary primitives (blue). 1–6 indicate the sub-floorplans in the 2D layer. The strategy of Shrinkage: Taking the linear primitives of sub-contours as input, we classified these primitives into two sets as \(L_{a}\) and \(L_{b}\). \(L_{a}\) contained the type I and II primitives which were the dominant directions of the sub-contours. \(L_{b}\) was the set of arbitrary primitives (type III) which would be considered in the later step of sub-contour extraction. We built a rectangular bounding box \(B=\{\{B_{1}\},\{B_{2}\},\{B_{3}\},\{B_{4}\}\}\) based on the two dominant directions as the initial approximation (see Figure 14). To initialize the elements in set \(B\), we assigned the linear primitives in \(L_{a}\) according to the directions and distances. The rectangles with dash lines in Figure 14 are the illustrations of the bounding box. Accordingly, we assigned the primitives to nearest edges of bounding box as shown in the right of Figure 14.  
After initialization, the shrinkage was completed primitive-by-primitive. Selecting a primitive \(l_{curr}\) in the set \(B_{j}\), we extended the current boundary \(e_{curr}\) at first.