# Combination Constraints of Multiple Fields for Implicit Modeling of Ore Bodies
## 4 Combination Constraints
### Multiple Fields
#### 4.1.2 Bounding Box  
To visualize an implicit function, the surface reconstruction method (e.g., the marching cubes method [34]) is used to extract isosurface by polygonizing a specified bounding box (e.g., a rectangle bounding box). As the function values outside the bounding box will not be evaluated, the bounding box can be also used to limit the interaction range of the implicit function field.  
For the multi-labeled implicit function, we can specify a rectangle bounding box based on the corresponding sampling data for each sub-field. The implicit field of bounding box can be expressed by a signed distance function using the distance computation from a target point to the surface \(\mathbf{S}\) of bounding box. The bounding box of the \(i\)-th sub-field can be defined as  
\[B_{f_{i}}(\mathbf{x})=\pm Dist(\mathbf{x},\mathbf{S}) \tag{8}\]  
where \(Dist(\mathbf{x},\mathbf{S})\) is the minimum distance from \(\mathbf{x}\) to \(\mathbf{S}\). The sign of \(B_{f_{i}}(\mathbf{x})\) indicates whether the evaluation point is inside or outside the bounding box. The range of the sub-field is limited to the interior of the bounding box. Therefore, the \(i\)-th labeled implicit function \(f_{i}(\mathbf{x})\) works only if \(B_{f_{i}}(\mathbf{x})\leq 0\). Besides limiting the range of sub-fields, the bounding box is useful to accelerate the evaluation speed of function values for the combined implicit function \(F(\mathbf{x})\).  
The minimum bounding box of a field can be automatically calculated by the sampling data and scaled by a certain scale factor. There are two different types of bounding boxes, axis-aligned bounding box (AABB) and oriented bounding box (OBB) [35]. Compared with the axis-aligned bounding box, the oriented bounding box is beneficial to further improve the efficiency of evaluating the implicit function \(F(\mathbf{x})\). The oriented bounding box follows the shape of the ore body well, especially for the thin ore bodies. It reduces the number of locations where the implicit function in surface reconstruction is evaluated. For the multi-labeled implicit function, it is good to avoid unnecessary calculations of some sub-fields in certain locations. We will discuss the evaluation efficiency in the Implementation section.  
The optimal oriented bounding box can be calculated by the principal component analysis (PCA) method [36; 37]. The basic idea of the PCA method is to construct a \(3\times 3\) covariance matrix \(\mathbf{C}\) by using the coordinate differences of the sampling points with respect to the centroid in the direction of three coordinate axes. The eigenvectors of the covariance matrix are the three main directions of the optimal oriented bounding box. Given a set of \(N\) sampling points \(\{\mathbf{p}_{k}|\mathbf{p}_{k}=(p_{k,1},p_{k,2},p_{k,3}),k=1,2,\ldots,N\}\), the ij-th component of the corresponding covariance matrix \(\mathbf{C}\) can be computed as  
\[\mathbf{C}_{ij}=\frac{1}{N}\sum_{k=1}^{N}(p_{k,j}-c_{i})\Big{(}p_{k,j}-c_{j}\Big{)},\ 1\leq i,j\leq 3 \tag{9}\]  
where \(\mathbf{c}=(c_{1},c_{2},c_{3})\) is the centroid of the sampling points.