# Three-Dimensional Geological Modeling Method Based on Potential Vector Fields
## 2 Materials and Methods
### Generalized Marching Cubes Algorithm  
The traditional marching cubes algorithm is limited to generating two-region interfaces, while geological interfaces may involve multi-region intersections. A generalized marching cubes algorithm is proposed to represent multi-region interfaces, with the three-region intersection used as an example. First, the entire modeling region is discretized into a grid, with each cube in the grid computed independently. Figure 1 illustrates the spatial relationships among vertices (V\({}_{0}\sim\) V\({}_{7}\)), edges (E\({}_{0}\sim\) E\({}_{1}\)), and faces (F\({}_{0}\sim\) F\({}_{5}\)) within a cubic structure. As shown in, within each cube, the stratigraphy at each vertex P\({}_{\text{V}q}\) (where \(q=0,\ldots,7\)) is sequentially calculated as follows:  
\[k_{\text{V}q}=\underset{i}{\text{arg max}}\big{\{}f_{i}(\mathbf{x}_{\text{V}q}) \big{\}}(i=1,\ldots,l) \tag{10}\]  
where \(\mathbf{x}_{\text{V}q}\) is the coordinates of the vertex P\({}_{\text{V}q}\). In Equation (10), which is derived from Equation (3), the component of \(\mathbf{f}(\mathbf{x}_{\text{V}q})\) with the maximum value is identified, and its index is stored as \(k_{\text{V}q}\). As shown in Figure 1, there are 18 possible intersection points in the cube: 12 edge-intersection points P\({}_{\text{E}0}\sim\) P\({}_{\text{E}11}\), where the interfaces intersect the 12 edges of the cube, and 6 face-intersection points P\({}_{\text{P}0}\sim\) P\({}_{\text{F}5}\), where the intersection between interfaces intersect the 6 faces of the cube. Within each cube, depending on the stratum in which each vertex is located, there may be \(3^{8}=6561\) possible configurations. However, due to the rotational invariance of the cube and the rotational symmetry of the vertices, these configurationscan be reduced to 72 unique cases. Figure 2 illustrates the triangular facets within the cube for these 72 cases, where the red, green, and blue points are vertices located in different regions, and the gray triangles simply indicate the presence of triangular facets without including coordinate information. After determining the existence of the triangular facets, the next step is to identify the vertices of the triangles, i.e., the coordinates of all intersection points within the cube. For convenience, let \(\mathrm{P_{V0}P_{V3}}\parallel x\)-axis, \(\mathrm{P_{V0}P_{V1}}\parallel y\)-axis, and \(\mathrm{P_{V0}}\sim\mathrm{P_{V4}}\parallel z\)-axis. 1. For the intersection points \(\mathrm{P_{E0}}\sim\mathrm{P_{E11}}\)  
The calculation method for the coordinates of these points is based on Equation (4). Let the coordinates of the two vertices of an edge be \(x_{1}\) and \(x_{2}\), located in strata \(k_{1}\) and \(k_{2}\), respectively. The coordinates of the intersection point \(x_{E}\) are then calculated using linear interpolation. Let  
Figure 1: The positional relationship between the vertices and the intersection points. Figure 2: Depiction of 72 cases with vertices and internal triangular facets. We use a mineral deposit area as the study area, with an east-west length of 6112.8 m and a north-south length of 13,310.2 m. A total of 100 borehole data points were collected, and the region was divided into five stratigraphic layers. The distribution of the boreholes is shown in Figure 5. Different strata are represented by distinct colors in the boreholes. The borehole depths are much smaller than the horizontal span of the region, so the \(z\)-axis is scaled proportionally by a factor of \(A=10\) to enhance the visual representation of both the borehole data and the final modeling results. Throughout the modeling process, the key issues addressed are as follows:  
1. Data Point Acquisition from Borehole Data  
The borehole data for the study area includes the following: (a) Basic borehole information: This dataset records the geographical location and depth information of each borehole, including geodetic coordinates, borehole elevation, and borehole depth.