Algorithm for Generating 3D Geometric Representation Based on Indoor Point Cloud Data

: This study proposes a new method to generate a three-dimensional (3D) geometric representation of an indoor environment by reﬁning and processing an indoor point cloud data (PCD) captured through backpack laser scanners. The proposed algorithm comprises two parts to generate the 3D geometric representation: data reﬁnement and data processing. In the reﬁnement section, the inputted indoor PCD are roughly segmented by applying random sample consensus (RANSAC) to raw data based on an estimated normal vector. Next, the 3D geometric representation is generated by calculating and separating tangent points on segmented PCD. This study proposes a robust algorithm that utilizes the topological feature of the indoor PCD created by a hierarchical data process. The algorithm minimizes the size and the uncertainty of raw PCD caused by the absence of a global navigation satellite system and equipment errors. The result of this study shows that the indoor environment can be converted into 3D geometric representation by applying the proposed algorithm to the indoor PCD.


Introduction
With the advancement of three-dimensional (3D) scanning equipment, diverse studies associated with reverse engineering using point cloud data (PCD) are being conducted at present. In particular, methods to generate geometric representation from data captured by porTable 3D scanners have been developed mainly in the architecture, engineering, and construction (AEC) industries [1][2][3]. Compared to an outdoor environment that can be scanned by a navigation system-based 3D scanning, an indoor environment has limitations in utilizing the system (e.g., global navigation satellite system, inertial navigation system) [4]. Thus, the 3D geometric representation of the indoor environment is generated by manual operation due to a lack of essential information, such as a normal vector and the scanner's trajectory.
However, the manual operation requires a time-consuming process and causes an inconsistent accuracy of geometric representation. The time-consuming process reduces the efficiency of reverse engineering because an executor who reconstructs the building components (e.g., structural member, non-structural member, furniture) from the raw PCD checks the result of geometric representation iteratively to minimize an error [5][6][7]. In addition, the accuracy of geometric representation depends on the ability of the executor. If the executor has little experience, the accuracy of the result will decrease since the indoor PCD capture through the porTable 3D scanning method lacks the information for detecting the building components [8][9][10].
To compensate for these limitations, this study proposes a new algorithm capable of generating 3D geometric representation using the topological feature of planar interior objects to detect the main structural members such as walls, floor, and ceiling [11]. This study consists of four parts. First, previous studies in the relevant field are reviewed in order to identify limitations in the current method for generating 3D geometric representation. Second, the framework of the new algorithm is presented. Third, the 3D geometric representation is illustrated by the refinement and processing of indoor PCD through a case study. Finally, the error rate of the geometric representations of the main structural members of the building is analyzed to validate the results of this study. The results of this study are expected to be used for the generation of building information modeling (BIM) from PCD that can be used to identify differences in design and construction.

Literature Review
Previous studies focused on the automatic generation method for 3D indoor modeling over the past decades. Recently, there has been an increasing number of studies on generating 3D indoor representation by using the continuity of scanning and a mobile laser scanner (MLS) system to extract trajectory data [1]. Related works on data refinement and processing of indoor PCD are reviewed and analyzed.
Regarding the process of data refinement that serves as preliminary work to achieve precise results, methods of converting 2D geometric representation into a 2.5D model [12] and generating 3D geometric representation by first partitioning the walls [13] are presented. Turner et al. [14] first created a floor plan of an interior using backpack laser scanners (BLSs) and then generated a 2.5D model by vertically extruding the floor plan using height information acquired through scanning. Because the floor plan and height information are included in the algorithm, furniture and other objects that are not related to the building's main structural members (i.e., ceiling, floor, walls) are removed. However, the maximum error of the generated results was 27 cm because of a height difference inside the building. Cui et al. [13] aimed to detect structural elements based on the geometric characteristics of the PCD. The PCD of nonstructural elements are partitioned into rooms through visibility analysis and a combination of the structural member constraints. The 3D geometry of every room was constructed through optimization based on multiple contiguous fixed partition allocation (MFT). However, the error rate is low only inside a simple building with a rectangular structure. A high possibility of clutter in the openings of a building exists in the case of openings detection, resulting in a detection error. The limitation of the study was that the vector elements of reverse-engineered walls are given a fixed width that is different from that in the actual structure.
Data processing after data refinement enables the interconnectivity of data [15] and separates structural and nonstructural elements [16]. To overcome the limitations of the previous research, Ochmann et al. [15] presented an approach to construct a new 3D geometry by setting parameters, interconnectivity, and volume elements as essential components. Through this method, the walls between adjacent rooms are automatically reverse-engineered by generating the normal vector of each wall through given formulas. However, this method has a relatively low opening detection accuracy (85.02%) compared to average accuracy (90.34%) in artificial datasets caused by systemic differences such as vector elements that are not independent and identically distributed. Wang et al. [16] constructed interior and exterior walls in the building with a 3D geometric representation and simplified the process through a graph cut. Even so, this method is also difficult for applications in buildings with complex interiors or nonrectangular floor plans.
Despite these shortcomings, MLSs continue to be used to increase the efficiency of reverse engineering on large objects such as buildings. Research on the estimation of the normal vector is being conducted to overcome these limitations in that the dimension of a derivable geometric representation is restricted to 2D because of problems with data types and capacity. However, these studies have low applicability because they are limited to a single room or multiple simple-shaped rooms. Therefore, a new algorithm is required to expand the applicability of generating 3D geometric representation.

Algorithm Overview
The proposed algorithm is mainly composed of data refinement and data processing phases for generating a 3D geometric representation of the indoor environment. In the data refinement phase, raw data are refined and transformed into a suitable form to generate a 3D geometric representation in accordance with four components: raw data input, random sample consensus (RANSAC), normal vector estimation, and structural member segmentation. Next, in the data processing phase, the 3D geometric representation is generated from the main indoor structural members based on the following four components: grouping the vertical planes, calculating the tangent points, selecting the vertex, and generating the geometric representation. The phases of data refinement and data processing are discussed in detail in Sections 3.2 and 3.3, respectively.

RANSAC
This study uses a 5D PCD composed of 3D coordinate geometry, room data, and separation index, all of which are inputted in txt format. Candidates of structural members that have planar feature descriptors are recognized using RANSAC on the PCD [12]. As depicted in Figure 1, the RANSAC is a method for finding a model fitting to inputted points ( Figure 1A) which has maximum consensus by comparing the number of points in a model-centered range with maximum distance from the model ( Figure 1B). This method is commonly used for deriving planes from 3D PCD of the indoor environment since the objects located in the indoor have planar feature descriptor [17][18][19].
Appl. Sci. 2020, 10, x FOR PEER REVIEW 3 of 13 rooms. Therefore, a new algorithm is required to expand the applicability of generating 3D geometric representation.

Algorithm Overview
The proposed algorithm is mainly composed of data refinement and data processing phases for generating a 3D geometric representation of the indoor environment. In the data refinement phase, raw data are refined and transformed into a suitable form to generate a 3D geometric representation in accordance with four components: raw data input, random sample consensus (RANSAC), normal vector estimation, and structural member segmentation. Next, in the data processing phase, the 3D geometric representation is generated from the main indoor structural members based on the following four components: grouping the vertical planes, calculating the tangent points, selecting the vertex, and generating the geometric representation. The phases of data refinement and data processing are discussed in detail in Sections 3.2 and 3.3, respectively.

RANSAC
This study uses a 5D PCD composed of 3D coordinate geometry, room data, and separation index, all of which are inputted in txt format. Candidates of structural members that have planar feature descriptors are recognized using RANSAC on the PCD [12]. As depicted in Figure 1, the RANSAC is a method for finding a model fitting to inputted points ( Figure 1A) which has maximum consensus by comparing the number of points in a model-centered range with maximum distance from the model ( Figure 1B). This method is commonly used for deriving planes from 3D PCD of the indoor environment since the objects located in the indoor have planar feature descriptor [17][18][19]. The algorithm selects the planes that have the highest number of points among the planes recognized by RANSAC from each room. The points within those planes become the candidates of the six main structural members-floor, ceiling, left wall, right wall, front wall, and back wall. The RANSAC processes in this algorithm have three steps: recognizing planes, selecting planes, and saving points in those planes. In this study, the planes that have the most points in each separation index are selected as candidates of the main structural members. The number of planes detected increases depending on the number of points in the raw data and the threshold necessary to satisfy the minimum points of each plane. Next, a plane that has a minimum sum of distance calculated by the mean square error is selected as the candidate of the main structural members in each room. Figure 2A is the raw PCD that are obtained by scanning the indoor environment, and Figure 2B is an The algorithm selects the planes that have the highest number of points among the planes recognized by RANSAC from each room. The points within those planes become the candidates of the six main structural members-floor, ceiling, left wall, right wall, front wall, and back wall. The RANSAC processes in this algorithm have three steps: recognizing planes, selecting planes, and saving points in those planes. In this study, the planes that have the most points in each separation index are selected as candidates of the main structural members. The number of planes detected increases depending on the number of points in the raw data and the threshold necessary to satisfy the minimum points of each plane. Next, a plane that has a minimum sum of distance calculated by the mean square error is selected as the candidate of the main structural members in each room. Figure 2A is the raw PCD that are obtained by scanning the indoor environment, and Figure 2B is an example in which RANSAC is applied to the PCD and detected as the planes of the floor and two walls.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 4 of 13 example in which RANSAC is applied to the PCD and detected as the planes of the floor and two walls.

Estimation of the Normal Vector
The normal vector is used to separate the candidates of the main structural member into three groups (left and right wall, front and back wall, and ceiling and floor). Because the BLS obtains only 3D coordinate geometry data, the normal vector is estimated separately to generate the main structural members. Figure 3 shows processes to estimate the normal vector of each point in the raw data. Figure 3A shows the inputted raw data, and Figure 3B,C represent the cross product between two adjacent points of the target point to estimate the normal vector and the result of the cross product. To increase the accuracy of this process, the reference points are set based on the target point according to the predetermined number of points, and the mean of the normal vector calculated from the cross product is assigned to the normal vector of the target point.

Estimation of the Normal Vector
The normal vector is used to separate the candidates of the main structural member into three groups (left and right wall, front and back wall, and ceiling and floor). Because the BLS obtains only 3D coordinate geometry data, the normal vector is estimated separately to generate the main structural members. Figure 3 shows processes to estimate the normal vector of each point in the raw data. Figure 3A shows the inputted raw data, and Figure 3B,C represent the cross product between two adjacent points of the target point to estimate the normal vector and the result of the cross product. To increase the accuracy of this process, the reference points are set based on the target point according to the predetermined number of points, and the mean of the normal vector calculated from the cross product is assigned to the normal vector of the target point.

Estimation of the Normal Vector
The normal vector is used to separate the candidates of the main structural member into three groups (left and right wall, front and back wall, and ceiling and floor). Because the BLS obtains only 3D coordinate geometry data, the normal vector is estimated separately to generate the main structural members. Figure 3 shows processes to estimate the normal vector of each point in the raw data. Figure 3A shows the inputted raw data, and Figure 3B,C represent the cross product between two adjacent points of the target point to estimate the normal vector and the result of the cross product. To increase the accuracy of this process, the reference points are set based on the target point according to the predetermined number of points, and the mean of the normal vector calculated from the cross product is assigned to the normal vector of the target point.

Structural Member Segmentation
The candidates of the main structural members generated through Sections 3.2.2 and 3.2.3 are categorized into three groups: left and right walls, front and back walls, and ceilings and floors. First, the normal vector of the candidates is rounded up. Based on this, the candidates are divided as follows: candidates with a normal vector (±1, 0, 0) into the left ( ) and right walls ( ); candidates with a normal vector (0, ±1, 0) into the front ( ) and back walls ( ); and candidates with a normal vector (0, 0, ±1) into the ceiling ( ) and the floor( ). Redundant candidates that have low qualifications to the three main structural members are deleted to minimize the errors of these processes to generate the 3D indoor representation. The raw data refined through Section 3.2 become 9D data by combining the normal vector and main structural member index data into the existing 5D data. Then, based on the refined results, data processing is performed to generate a 3D indoor representation of each room from 9D data.

Grouping Adjacent Planes
The first stage of data processing is the grouping of three planes: one plane from the left and right walls, one plane from the front and rear walls, and one plane from the ceiling and floor ( Figure  4). This grouping process prepares the data to be used to calculate the tangent points among three adjacent planes. In this case, if the number of left and right walls is x in a building with one room, the number of groups generated is 2x 2 . These results occur because the number of left and right walls and the number of front and rear walls are the same, and only one ceiling and only one floor exist in the case of the polyhedron-shaped interior.

Structural Member Segmentation
The candidates of the main structural members generated through Sections 3.2.2 and 3.2.3 are categorized into three groups: left and right walls, front and back walls, and ceilings and floors. First, the normal vector of the candidates is rounded up. Based on this, the candidates are divided as follows: candidates with a normal vector (±1, 0, 0) into the left (N le f t ) and right walls (N right ); candidates with a normal vector (0, ±1, 0) into the front (N f ront ) and back walls (N back ); and candidates with a normal vector (0, 0, ±1) into the ceiling (N ceiling ) and the floor(N f loor ). Redundant candidates that have low qualifications to the three main structural members are deleted to minimize the errors of these processes to generate the 3D indoor representation. The raw data refined through Section 3.2 become 9D data by combining the normal vector and main structural member index data into the existing 5D data. Then, based on the refined results, data processing is performed to generate a 3D indoor representation of each room from 9D data.

Grouping Adjacent Planes
The first stage of data processing is the grouping of three planes: one plane from the left and right walls, one plane from the front and rear walls, and one plane from the ceiling and floor ( Figure 4). This grouping process prepares the data to be used to calculate the tangent points among three adjacent planes. In this case, if the number of left and right walls is x in a building with one room, the number of groups generated is 2x 2 . These results occur because the number of left and right walls and the number of front and rear walls are the same, and only one ceiling and only one floor exist in the case of the polyhedron-shaped interior.

Structural Member Segmentation
The candidates of the main structural members generated through Sections 3.2.2 and 3.2.3 are categorized into three groups: left and right walls, front and back walls, and ceilings and floors. First, the normal vector of the candidates is rounded up. Based on this, the candidates are divided as follows: candidates with a normal vector (±1, 0, 0) into the left ( ) and right walls ( ); candidates with a normal vector (0, ±1, 0) into the front ( ) and back walls ( ); and candidates with a normal vector (0, 0, ±1) into the ceiling ( ) and the floor( ). Redundant candidates that have low qualifications to the three main structural members are deleted to minimize the errors of these processes to generate the 3D indoor representation. The raw data refined through Section 3.2 become 9D data by combining the normal vector and main structural member index data into the existing 5D data. Then, based on the refined results, data processing is performed to generate a 3D indoor representation of each room from 9D data.

Grouping Adjacent Planes
The first stage of data processing is the grouping of three planes: one plane from the left and right walls, one plane from the front and rear walls, and one plane from the ceiling and floor ( Figure  4). This grouping process prepares the data to be used to calculate the tangent points among three adjacent planes. In this case, if the number of left and right walls is x in a building with one room, the number of groups generated is 2x 2 . These results occur because the number of left and right walls and the number of front and rear walls are the same, and only one ceiling and only one floor exist in the case of the polyhedron-shaped interior.

Calculation of Tangent Points
The tangent points are calculated among three planes grouped in the previous section. One group includes each one of the left and right walls (N1 in Figure 5), front and back walls (N2 in Figure 5), and the ceiling and floor (N3 in Figure 5). The tangent point is calculated by using Equation (1) based on a center point (x N , y N , z N in Equation (1)) and the normal vector ( − − → nx N , −−→ ny N , − − → nz N in Equation (1)) of each plane (N1, N2, N3), as shown in Figure 5. The number of tangent points is the same as the number of groups (2x 2 ), and those tangent points become the candidates for the vertex of the main structural member. These tangent points include the room data, group of planes, and 3D coordinate geometry data (x, y, z in Equation (1)).

Calculation of Tangent Points
The tangent points are calculated among three planes grouped in the previous section. One group includes each one of the left and right walls (N1 in Figure 5), front and back walls (N2 in Figure  5), and the ceiling and floor (N3 in Figure 5). The tangent point is calculated by using Equation (1) based on a center point ( , , in Equation (1)) and the normal vector ( , , in Equation (1)) of each plane (N1, N2, N3), as shown in Figure 5. The number of tangent points is the same as the number of groups (2 ), and those tangent points become the candidates for the vertex of the main structural member. These tangent points include the room data, group of planes, and 3D coordinate geometry data (x, y, z in Equation (1)).

Selection of the Vertex
In Section 3.3.3, the vertex comprising the main structural members is selected from the calculated tangent points. Although this process is not necessary for a single hexahedron-shaped room, the shape of the room in this study is a complex-shaped polyhedron that consists of multiple rooms, thereby serving as an essential process in this case.
The selection of the vertex is conducted for the main structural members. To avoid the error caused by a shape difference between the vertical structural members and the horizontal structural members, this study sets the priority of vertex selection for the vertical structural members. The vertex is selected through a hierarchical process in which the vertex for the floor or ceiling is selected after each vertical structural member, i.e., wall, is selected. A hierarchical process is a new approach for solving the complexity of multi-rooms because vertical members only have a rectangular shape while horizontal members have an irregular polygon shape.
In this study, the vertex selection for the left wall is chosen as the priority among other walls. The selection of vertex for the left wall (shown in Figure 6A) from the candidates is conducted. First, as shown in Figure 6A, the left wall (A) is divided into four regions: upper left region (1 in Figure  6B), upper right region (2 in Figure 6B), lower right region (3 in Figure 6B), and lower left region (4 in Figure 6B). The distance between each vertex with the center point of three planes that participate in vertex calculation is estimated and stored to select the nearest point. Second, T1, T2, T3, and T4 in

Selection of the Vertex
In Section 3.3.3, the vertex comprising the main structural members is selected from the calculated tangent points. Although this process is not necessary for a single hexahedron-shaped room, the shape of the room in this study is a complex-shaped polyhedron that consists of multiple rooms, thereby serving as an essential process in this case.
The selection of the vertex is conducted for the main structural members. To avoid the error caused by a shape difference between the vertical structural members and the horizontal structural members, this study sets the priority of vertex selection for the vertical structural members. The vertex is selected through a hierarchical process in which the vertex for the floor or ceiling is selected after each vertical structural member, i.e., wall, is selected. A hierarchical process is a new approach for solving the complexity of multi-rooms because vertical members only have a rectangular shape while horizontal members have an irregular polygon shape.
In this study, the vertex selection for the left wall is chosen as the priority among other walls. The selection of vertex for the left wall (shown in Figure 6A) from the candidates is conducted. First, as shown in Figure 6A, the left wall (A) is divided into four regions: upper left region (1 in Figure 6B), upper right region (2 in Figure 6B), lower right region (3 in Figure 6B), and lower left region (4 in Figure 6B). The distance between each vertex with the center point of three planes that participate in vertex calculation is estimated and stored to select the nearest point. Second, T1, T2, T3, and T4 in Figure 6B are chosen as the vertices for the left wall based on the aforementioned information of distance.     Lastly, the vertices of the ceiling and the floor are selected by using the vertices of the left, right, front, and back walls. The vertices for the ceiling (see Figure 8) are selected; the vertices of all of the left and right walls and all of the front and back walls in this figure, connecting to the ceiling, are selected, and the vertices of the floor are selected following the same process. The 3D geometric representation of the structural members is generated by storing the vertices (V 1 , V 2 , V 3 , V 4 , V 5 , and V 6 in Figure 8) corresponding to the ceiling among the vertices (Vs).
Appl. Sci. 2020, 10, x FOR PEER REVIEW 8 of 13 Lastly, the vertices of the ceiling and the floor are selected by using the vertices of the left, right, front, and back walls. The vertices for the ceiling (see Figure 8) are selected; the vertices of all of the left and right walls and all of the front and back walls in this figure, connecting to the ceiling, are selected, and the vertices of the floor are selected following the same process. The 3D geometric representation of the structural members is generated by storing the vertices ( , , , , , and in Figure 8) corresponding to the ceiling among the vertices (Vs).

Case Study Overview
A case study is conducted to verify the algorithm in this study. The scanning target area is located in Hwaseong, Gyeonggi-do, South Korea, and the PCD are captured by a BLS. The PCD are obtained from the building with a total of six rooms (Figure 9), and the total number of points in the PCD is 14,784,164. The characteristics of the dataset used in the case study are illustrated in Table 1.

Location
Gyeonggi

Case Study Overview
A case study is conducted to verify the algorithm in this study. The scanning target area is located in Hwaseong, Gyeonggi-do, South Korea, and the PCD are captured by a BLS. The PCD are obtained from the building with a total of six rooms (Figure 9), and the total number of points in the PCD is 14,784,164. The characteristics of the dataset used in the case study are illustrated in Table 1.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 8 of 13 Lastly, the vertices of the ceiling and the floor are selected by using the vertices of the left, right, front, and back walls. The vertices for the ceiling (see Figure 8) are selected; the vertices of all of the left and right walls and all of the front and back walls in this figure, connecting to the ceiling, are selected, and the vertices of the floor are selected following the same process. The 3D geometric representation of the structural members is generated by storing the vertices ( , , , , , and in Figure 8) corresponding to the ceiling among the vertices (Vs).

Case Study Overview
A case study is conducted to verify the algorithm in this study. The scanning target area is located in Hwaseong, Gyeonggi-do, South Korea, and the PCD are captured by a BLS. The PCD are obtained from the building with a total of six rooms (Figure 9), and the total number of points in the PCD is 14,784,164. The characteristics of the dataset used in the case study are illustrated in Table 1.   Figure 9. Point cloud data.
The implementation of this case study was conducted in MATLAB R2020a. The PCD were automatically imported by the algorithm, and then data processing was conducted to verify the accuracy of the study. To verify the algorithm, this case study calculated the included angles of each building components comparing to the ground of the real scene (X-Y plane with the [0, 0, 0] normal vector) after aligning the geometric representation to three coordinate planes (i.e., X-Y, X-Z and Y-Z planes). The parameters used in this case study are presented in Table 2. The maximum distance of the model in RANSAC is an error caused by equipment (±30 mm) [20], and the number of points for normal estimation is determined by the capacity of hardware (32 Gigabyte RAM).  Table 2. Parameters used in the case study.

Maximum distance of model in RANSAC (mm) 60
The number of points for normal estimation 100

Results of the Case Study
The 3D geometry applied with the algorithm proposed in this study is shown in Figure 10, and the 3D geometric representation and error rate are listed in Table A1. The implementation of this case study was conducted in MATLAB R2020a. The PCD were automatically imported by the algorithm, and then data processing was conducted to verify the accuracy of the study. To verify the algorithm, this case study calculated the included angles of each building components comparing to the ground of the real scene (X-Y plane with the [0, 0, 0] normal vector) after aligning the geometric representation to three coordinate planes (i.e., X-Y, X-Z and Y-Z planes). The parameters used in this case study are presented in Table 2. The maximum distance of the model in RANSAC is an error caused by equipment (±30 mm) [20], and the number of points for normal estimation is determined by the capacity of hardware (32 Gigabyte RAM).

Parameter Value
Maximum distance of model in RANSAC (mm) 60 The number of points for normal estimation 100

Results of the Case Study
The 3D geometry applied with the algorithm proposed in this study is shown in Figure 10, and the 3D geometric representation and error rate are listed in Table A1. From the case study, an application range of the algorithm is expanded from a rectangle to an irregular polygon of which all sides are either perpendicular or parallel. In particular, the size of the raw PCD is remarkably decreased to 0.0000243%, the original number of raw PCD is 14,784,164, and the number of refined PCD is 36. The average error rate between the ground-truth and the result of the algorithm from this case study is only 0.113255%, even with the number of raw PCD being drastically reduced. From the case study, an application range of the algorithm is expanded from a rectangle to an irregular polygon of which all sides are either perpendicular or parallel. In particular, the size of the raw PCD is remarkably decreased to 0.0000243%, the original number of raw PCD is 14,784,164, and the number of refined PCD is 36. The average error rate between the ground-truth and the result of the algorithm from this case study is only 0.113255%, even with the number of raw PCD being drastically reduced.

Analysis of the Results
The members which featured over one degree of geometric representation generated by the proposed algorithm are wall 3 and wall 10 of room 2, wall 10 of room 3, and wall 4 of room 4. As presented in Section 1, the topological feature of the indoor environment is that the structural members are parallel or perpendicular to other members. Based on the feature, the included angle must be zero degrees. However, the non-zero included angle has several reasons why that member is not zero. In this case study, the reasons mainly have three reasons; first, the real member is inclined. Second, the number of points located in the member is insufficient to derive the geometric representation. Lastly, the member has over two other members, which caused the error of the case study.
First, the included angles of wall 4 of room 4 (1.260249 degrees) and wall 10 of room 3 (1.027251 degrees) are not zero because the walls are inclined. The walls are non-structural members that just separate the adjacent rooms; thus, the member did not have to be perpendicular with the floor. In particular, room 4 has a non-rigid shape composed of inclined walls since the room is a warehouse detached from the whole house, which makes the average error of room 4 (0.564577 degrees) larger than other rooms. Second, wall 3 of room 2 has 1.260596 degrees because the number of points on that wall is 2545. The reasons why the wall has insufficient points are that room 2 is connected with stairs and wall 3 is located in the encounter place, thus the real member has a minimal area among the members. In addition, the potential error caused by the movement of the scanner must be increased if the number of points are insufficient to extract the plane [21]. Finally, the included angle of wall 10 of room 2 (1.493584 degrees) was caused by the convergence of different members in one object. In that wall, the window covered with curtain is scanned, and then the points located in that curtain are captured through the scanner. Accordingly, the difference between the surfaces of the wall and curtain induced the included angle. The error can be minimized by removing the covers of opening (e.g., door, window, mirror).
Compared to the wall, the horizontal structural members (i.e., floor and ceiling) had a lower error (0.352327 degrees) than other vertical members (0.435682 degrees). In particular, the average included angle of horizontal members except for members in room 4 was 0.294404 degrees because room 4 was detached from the house. The error means that the included angle in room 2, which had the largest width of the room (11,500 mm), causes the gap (59 mm) between the real floor and the generated floor. However, the gap is lower than the possible error caused by the potential error of the scanner (±30 mm); thus, it would not be an error of the proposed algorithm. Consequently, this study can generate a geometric representation of an indoor environment with consistent accuracy using PCD capture through MLS.

Conclusions
This study analyzed the limitations of previous studies and generated improvements by presenting a new algorithm for the 3D geometric representation of indoor environments. The mean error of the 3D geometric representation generated through the case study is 0.407719 • , which is an error of 16.3 mm when considering the vertical height of the building interior at 2.3 m. Given the ±30 mm error caused by the feature of the BLS used in this study, the algorithm proposed in this study proves to be suitable for generating the 3D indoor geometric representation.
The benefits of this study in the AEC industry are as follows; first, the 3D geometric representation derived by the proposed algorithm can improve the efficiency of as-built building information modeling (BIM) generation. In the process of BIM generation, the executor who generates the structural members as BIM compares real structural member and detected members to increase the accuracy. Based on the accuracy of the proposed algorithm, the executor can use the information derived by this study for generating as-built BIM faster than the traditional method using iterative checking. In particular, a generation error caused by missing points is reduced by minimizing additional processes for confirming the existence of a structural member. Second, the result of this study supports decision making for retrofitting the interior building condition. The reconstructed members generated by the proposed algorithm can distinguish movable objects from an indoor environment to optimize the position of members. An owner who wants to retrofit an existing building decides the location of furniture by using the data derived from the indoor PCD. Lastly, the proposed algorithm-based 3D scanning makes it possible to assess several buildings using MLS. The existing methods for reconstructing the indoor environment use fixed 3D scanning methods to acquire rich data that have sufficient information for detecting members. In contrast, the proposed algorithm uses the topological feature of members, which compensates for the lack of information in MLS-based scanning. The moving scanning can acquire the indoor PCD faster than the fixed method, thus more of the indoor environment is obtained in the same scanning time.
The current limitations of this algorithm are that it is difficult to use the proposed methods in irregular structures and to accurately determine the sizes and positions of openings in a building such as windows and doors. Future research will be necessary to decrease errors in generating openings and increase the applicability to irregular objects by diversifying the types of recognizable objects.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.