# Repair of Voids in Multi-Labeled Triangular Mesh
## 4 Method
### Judgment Rules of Voids  
To distinguish different searching results, we call the set of connected triangular facets with zero labels as quasi-void. If the directions of the triangular facets are consistent, then pos and neg labels should be considered. In this case, the quasi-void is a set of connected triangular facets whose pos labels are zero.  
According to the internal and external position relationship of the model between different materials, quasi-voids can be divided into three types: exterior boundary, interior boundary and void, as shown in Figure 5. Among them, the exterior boundary is a quasi-void adjacent to the external region of the multi-labeled mesh. The interior boundary and void are quasi-voids located inside the exterior boundary of the multi-labeled mesh. The difference is that the triangular facet set of the interior boundary contains only one type of non-zero label, while the triangular facet set of the void contains two or more non-zero labels, as shown in Figure 5. In the searching process, we can find all the quasi-voids. Then the judgment rules of voids are used to distinguish the types of quasi-voids, so that the true voids can be filled by the repairing method.  
To distinguish the types of searched quasi-voids, we use the methods of comparing corresponding bounding boxes and comparing corresponding volumes to determine the true voids. For a connected multi-labeled mesh, the volume comparison method is based on the natural fact that the volume of the closed mesh that composes the interior boundary or the void is smaller than the volume of the mesh that composes the exterior boundary. To accelerate the speed of judgment, the bounding box comparison method is used to distinguish the quasi-voids. For a connected multi-labeled mesh, the bounding box comparison method is based on the similar fact that the bounding box (such as the rectangular bounding box) of the void or the interior boundary is contained in the bounding box of the exterior boundary. Therefore, when the bounding box of the searched triangular facets \(\mathcal{S}_{T}\) is smaller than the bounding box of the exterior boundary, the triangular facets \(\mathcal{S}_{T}\) is a void or an inner boundary. Then, whether \(\mathcal{S}_{T}\) is a void can be directly determined by the number of non-zero labels in \(\mathcal{S}_{T}\). In special cases, when the bounding box of the searched triangular facets set \(\mathcal{S}_{T}\) is exactly equal to the bounding box of the exterior boundary, it is necessary to use the volume comparison method to further determine whether \(\mathcal{S}_{T}\) is a true void.  
It is worth noting that the judgment rules of voids based on the bounding box comparison method and the volume comparison method are applicable to a connected multi-labeled mesh. For an unconnected multi-labeled mesh, the judgment rules of voids are no longer applicable. Therefore, to apply the judgment rules of voids, we should first separate the unconnected multi-labeled mesh into several connected sub-graphs based on the idea of graph theory, which ensures that the bounding box of the exterior boundary is the largest one for each connected sub-graph.