## 3 Space Matching Process Using Multi-Resolution Cube Grid
### Implementation of Space Matching Algorithm  
The engineering software \"MATLAB,\" developed by \"Math Works,\" provides functions that enable numerical analysis and programming environment. MATLAB supports calculations based on a matrix and provides such features as floor plan figures with functions, data, and algorithm implementation through relevant programming. For these capabilities, MATLAB was used in this study to implement the space matching algorithm as discussed above.  
The space matching process implemented through MATLAB is as follows:  
1. Set the range of space coordinates--the size of the total coordinate system must be defined and checked before applying 3D grids. Therefore, the maximum and minimum values of the coordinate system must be set.
2. Apply 3D grids--this process checks if there is any point cloud that is classified as data in the corresponding block when applying the 3D grids. If there is point cloud data in the block, the block is wrapped around by colored surfaces for visual identification.  
The scan data are segmented by the unit values defined by the user, and the existence of data in the segmented node is determined, in which case the node is marked as having data. Table 3 below shows the results from that process.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Space**} & \multirow{2}{*}{**Unit**} & \multirow{2}{*}{**Matching to Availability**} & \multicolumn{2}{c}{**Matching Example (Figure 3)**} \\ \cline{3-4}  & & & **Space** & **Unit** \\ \hline \(\bigcirc\) & \(\bigcirc\) & Available & A2 & 1 \\ \(\bigcirc\) & \(\bullet\) & Available & A2 & 5 \\ \(\bullet\) & \(\bigcirc\) & Available & E5 & 1 \\ \(\bullet\) & \(\bullet\) & Impossibility & E5 & 5 \\ \hline \hline \end{tabular} \(\bigcirc\): data absence/\(\bullet\): data exists.  
\end{table}
Table 2: Matching conditions, space, and unit.  
\begin{table}
\begin{tabular}{c c c} \hline \hline \multicolumn{1}{c}{**Point Cloud Data**} & \multicolumn{1}{c}{**3D Grid Data (Transparent Data)**} \\ \hline \hline \end{tabular}
\end{table}
Table 3: 3D grids algorithm application.  
(3)  
Apply the matching verification algorithm--the algorithm for verifying the possibility of matching is applied using the 3D grid application data outlined in the previous step.  
The algorithm for verifying the possibility of matching is applied as described above using the data created from the 3D grids in the previous step. Space data must be matched at the bottom because different equipment is installed on the floor of the space. For equipment data, all the data must be included in the algorithm because every node that has data must be checked.  
Next, the equipment data are moved to the first node of the space model and matching is checked. When the matching process is started, the parameter FailCase is set and one is added to this parameter whenever the matching fails. The FailCase value is checked at the end of matching verification. If this value is 0, it means that every matching is successful. In this case, the corresponding matching coordinate is saved in the text file to which the results are outputted and the algorithm moves on to the next matching node. On the other hand, if the FailCase value is not 0, the algorithm moves on to the next matching node without saving the node coordinate in the text file. Figure 4 shows the result value outputted after verification by the matching algorithm. The coordinate pairing occurs in the horizontal direction. From left to right, the user-defined unit value, x coordinate, y coordinate, and z coordinate are displayed. The figure also shows the visual expression of one of the coordinates that can be matched. For space data, only the edges are outputted for visual expression. The facilities data are outputted by colored surfaces.