# Real-Time 3D Reconstruction Pipeline for Room-Scale, Immersive, Medical Teleconsultation
## 4 Dual Contouring for Voxelized Point Clouds
### Connectivity Properties and Interior Mesh Generation  
With the extensions for diagonal connections, all combinations of four voxels sharing a common corner in the immediate neighborhood are connected. Thus, our method will only generate holes, where the voxel mesh of all leaf cells would contain holes. One disadvantage of this approach is the lack of discernability between interior and surface mesh parts, which is particularly significant if mixed voxel sizes are combined. For a power of two resolution border \(2^{c}\), at least \(2^{c}+1\) empty, high-resolution voxels must be present between two surfaces to prevent the closing of the wrong gaps (Figure 9a).  
Figure 6: Diagonal EdgeProc Subprocedures. Three examples of possible diagonalEdgeProc subprocedures: (**a**) shows 1 of 12 subprocedures in cellProc, (**b**) shows 1 of 8 subprocedures in faceProc, and (**c**) shows 1 of 2 two recursions of diagonalEdgeProc on itself.  
Figure 7: CornerProc Cases. Three examples of possible cornerProc cases in cellProc: there are (**a**) 6 cases in total where 2 pairs of nodes share an edge, (**b**) 24 cases where just 1 of the nodes is not aligned with the 3 others, and (**c**) 2 situations where 2 nodes are criss-cross on different sides. In sum, this amounts to 32 cases.  
If the voxel size is uniform, faulty connections still occur, when, for example, a corner is smoothed and hidden by the additional diagonal face (Figure 8(b)). Discerning these cases is challenging because if the exterior connections were not indicated as in the example of Figure 8(b), this case may also be a small manifold object. We omit to filter these cases since the internal faces in a uniform voxel are limited to crossing a single diagonal voxel.  
If two layers of voxels are supplied as input, a wasteful interior mesh is also generated. For two close-by opposing surfaces (Figure 9(a)), which are physically unlikely to capture with depth cameras, we only allow connections between vertices with normals that are pointing in the same direction (i.e., only vertices where the angles between all normals of a face are smaller than e.g., 120 deg), like that used in other direct meshing methods, such as greedy projection triangulation by [PERSON], [PERSON], and [PERSON] [69]. The case in Figure 9(b) will happen regardless of noise, if the splitting plane of the octree is badly placed and generates many insignificant interior triangles. We propose solving this problem by merging vertices with normals \(n_{1},n_{2}\) across a dual edge of unit direction \(d\), if  
\[n_{1}\cdot n_{2}>cos(\delta_{n})\ \ \text{and}\ \ \left|\frac{n_{1}+n_{2}}{ \left\|n_{1}+n_{2}\right\|}\cdot d\ \right|>cos(\delta_{d}) \tag{1}\]  
Thus, \(\delta_{n}\) specifies the maximum angle between merged vertices, and \(\delta_{d}\) denotes the maximum angle between the average normal and the dual edge direction. The two vertices are merged by moving one to the average position and marking the other as deleted with reference to update all face indices later. With this step, we can significantly reduce the number of duplicate triangles if low-quality voxelization is used (Figure 11).  
Figure 8: CornerProc Subprocedures. Three examples of cornerProc subprocedures: (**a**) shows 1 of 32 subprocedures in faceProc, (**b**) shows 1 of 18 subprocedures in faceProc, and (**c**) is the recursion for cornerProc.  
Figure 9: Connectivity Properties during Mesh Generation. (**a**) Faulty internal mesh connections, which do not follow the underlying surface across a resolution border and (**b**) in a uniform voxel grid.