# Combination Constraints of Multiple Fields for Implicit Modeling of Ore Bodies
## 4 Combination Constraints
### Combined Representations  
Besides the implicit representation, combination constraints can be also used to blend the modeling results of explicit representation and parametric representation.  
The basic idea of combined representations is that the modeling result can be converted as an implicit function field. For example, the modeling result of explicit modeling can be converted into a signed distance field by computing the minimum distance between an evaluating point and the nearest point on the mesh. The distance is signed according to the mesh normal direction. For a closed surface, the region pointed by the positive direction of the mesh normal is outside the surface (the sign of the function value is positive), and the region pointed by the negative direction of the mesh normal is inside the surface (the sign of the function value is negative). Different modeling methods have their own advantages and disadvantages. For the modeling results using different modeling methods, it is necessary to blend the reconstructed meshes into the implicit representation of orebody.  
Based on the idea of a signed distance field, some geometry functions composed of simple geometry equations can be used to construct signed distance functions naturally. Compared with the interpolation constraints, the geometry constraints can be used to limit or extend the interpolation trend of orebody model more efficiently.  
(1) Plane constraint  
The signed distance from a point to a plane can be represented as a simple implicit function  
\[f(\mathbf{x})=\frac{n_{x}(x-x_{0})+n_{y}(y-y_{0})+n_{z}(z-z_{0})}{\sqrt{n_{x}^{2}+n_{ y}^{2}+n_{z}^{2}}} \tag{16}\]  
where \(\mathbf{x}=(x,y,z)\) is an evaluation point in the distance field, \(\mathbf{x}_{0}=(x_{0},y_{0},z_{0})\) is a point on the plane and \(\mathbf{n}=\left(n_{x},n_{y},n_{z}\right)\) is the normal vector of the plane. The sign of \(f(\mathbf{x})\) indicates whether the evaluation point is inside or outside the model. The bounding box is used to define the extent of the plane. Clearly, the region pointed to by the positive direction of the normal is exterior, and the region pointed to by the negative direction of the normal is interior.  
(2) Line constraint  
To distinguish the exterior and interior of a distance field constructed by a line, define a plane passing through a given line as a projection plane. Construct a 2D coordinate system on a projection plane. Then, the signed projection distance from a point to the line in a specified projection plane can be represented as a simple implicit function  
\[f(\mathbf{x})=\frac{n_{x}(x^{\prime}-x_{0})+n_{y}(y^{\prime}-y_{0})}{\sqrt{n_{x}^{2 }+n_{y}^{2}}} \tag{17}\]  
where \(\mathbf{x}^{\prime}=(x^{\prime},y^{\prime})\) is the 2D projection coordinate of the projection plane with respect to the evaluation point \(\mathbf{x}=(x,y,z)\), \(\mathbf{x}_{0}=(x_{0},y_{0},z_{0})\) is a point on the line and \(\mathbf{n}=\left(n_{x},n_{y}\right)\) is the 2D normal vector of the line on the projection plane. The bounding box is used to define the extent of the line.  
(3) Surface constraint  
Some common primitive objects can be also used to construct signed distance functions. Taking the sphere as an example, the signed distance from a point to the surface of a sphere can be represented as a simple implicit function  
\[f(\mathbf{x})=\sqrt{\left(x-x_{0}\right)^{2}+\left(y-y_{0}\right)^{2}+\left(z-z_{ 0}\right)^{2}}-R \tag{18}\]  
where \(\mathbf{x}=(x,y,z)\) is an evaluation point in the distance field, \(\mathbf{x}_{0}=(x_{0},y_{0},z_{0})\) is the center of the sphere and \(R\) is the radius of the sphere.