Efficient Construction of Voxel Models for Ore Bodies Using an Improved Winding Number Algorithm and CUDA Parallel Computing

: The three-dimensional (3D) geological voxel model is essential for numerical simulation and resource calculation. However, it can be challenging due to the point in polygon test in 3D voxel modeling. The commonly used Winding number algorithm requires the manual setting of observation points and uses their relative positions to restrict the positive and negative solid angles. Therefore, we proposed the Winding number with triangle network coding (WNTC) algorithm and applied it to automatically construct a 3D voxel model of the ore body. The proposed WNTC algorithm encodes the stratum model by using the Delaunay triangulation network to constrain the index order of each vertex of the triangular plane unit. GPU parallel computing was used to optimize its computational speed. Our results demonstrated that the WNTC algorithm can greatly improve the efficiency and automation of 3D ore body modeling. Compared to the Ray casting method, it can compensate for a voxel loss of about 0.7%. We found the GPU to be 99.96% faster than the CPU, significantly improving voxel model construction speed. Additionally, this method is less affected by the complexity of the stratum model. Our study has substantial potential for similar work in 3D geological modeling and other relevant fields.


Introduction
Computer vision, computer graphics, and related fields have opened up new possibilities for analyzing data using geographic information systems (GIS).Three-dimensional modeling technology has revolutionized traditional 2D GIS into 3D GIS modeling [1].Three-dimensional GIS modeling is an innovative technique that entails the construction of a model with geospatial data in a virtual 3D space using 3D software or development tools [2,3].The application of 3D GIS in geological research is essential for geotechnical engineering and exploration work [4,5].Geologists can use 3D visual models to display geological structures and visualize and analyze geological data effectively [6][7][8].Complex ore bodies pose a challenge for 3D modeling, making these tasks a common difficulty in practical work [9][10][11].
When creating 3D models of ore bodies, two methods are commonly used: triangulation irregular network (TIN) and generalized tri-prism (GTP).These methods are crucial for modeling ore bodies and have been improved to address issues such as building complex models of ore bodies [12,13].TIN has proven to be effective in creating surface models of strata [14,15].On the other hand, GTP is great for quickly and accurately fitting complex geological bodies like faults and lenses [15].However, GTP requires that the strata of the same geological layer be divided into multiple GTP units, which means that the GTP model has more data components than the TIN model.The Delaunay triangulation network is a classic algorithm used in TIN, which is widely applied in various research fields.For example, it is applied to data analysis of meteorological stations in 2D GIS [16], the field of 3D printing, reinforcement of printed objects [17], and 2D data conversion to generate data keys for data encryption [18].
The consecutive and vector models have limitations in describing mining entities, and their application range is narrow.This makes it difficult to estimate mine reserves and simulate actual mining effects.To overcome these limitations, the geological block method is crucial for building an ore body model and analyzing geology data [19].The essence of this method lies in the construction of voxel models, which are similar to pixels in threedimensional space and comprise spatial voxels [20].
The 3D voxel model has good geometric characteristics, with adjacent voxels and flexible particle sizes.Masoumi et al. used the voxel model to simulate the mine in blocks to describe the mineral distribution with complex geometric boundaries [21].The voxel unit can contain attribute information suitable for data analysis in 3D space.Navarro et al. used the model combined with the strength-grade factor in an overall rock factor to automatically assess rock structure, strength, and waste/ore identification [22].The voxel model is conducive to providing an intuitive description of ore blocks planned to be caved over the life of the mine [23], which is beneficial to the application of the model in mining engineering.On the other hand, voxel model is used in many 3D modeling fields.Lei et al. [24] realized the construction of Chicago's urban three-dimensional voxel model through elastic grid-scale voxel units.In addition, the application of voxels also includes medical workpiece processing and other fields [25,26].
Despite its poorer edge-fitting effect in comparison to the GTP model, each voxel unit of the 3D voxel model can record ore body data, such as mineral phase and content, making it convenient for data analysis.Therefore, constructing the voxel model is integral to the current mine application model construction [27].For example, Chang et al. and Jia et al. used voxels to analyze and predict the distribution of ore-forming points of ore bodies in combination with mathematical models [28,29].They constructed an information-based three-dimensional ore body model to realize mineralization information mining.In addition, Wang et al. compared the interpolation effects of different mineral contents through the 3D voxel ore body model [30].It can be seen that the voxel model is beneficial to constructing and analyzing the three-dimensional model of the ore body.An essential problem to be solved in the voxelization of a 3D model is the point in polygon test.
The problem of point in polygon has its roots in the early days of geometric graphics [31].Today, as computer graphics have become essential in many fields, many scholars continue to discuss this problem [32,33].With the application of three-dimensional geometry, the problem has expanded to include discussions of methods, improvements, and efficiency.It is also a research hotspot for applying three-dimensional point clouds [34].Among the solutions to this problem, scholars often study the Ray casting method, also known as the odd-even method [35,36].This method can make quick and intuitive judgments but requires discussing many specific issues.It can be challenging to summarize various exceptional cases of rays passing through three-dimensional geometry in the expansion of the three-dimensional space algorithm.Other methods, such as the Voronoi tessellations, can solve the point in polygon test in a convex polygon [37].These methods can better handle the edges of graphics and exhibit better operational efficiency.However, these methods have limited effectiveness with non-convex polygons.Furthermore, threedimensional geometry is more complex than two-dimensional plane graphics, and handling arbitrary polygons in three-dimensional space expansion is challenging.
The Winding number algorithm is a valuable geometric technique for solving the point in polygon test in 2D GIS.By calculating the winding number of a point around a polygon, it can determine whether the point is inside or outside the polygon.While scholars have explored the discrimination of 3D non-convex polygon models with self-intersections, holes, or degeneracies [38,39], the Winding number remains a mathematical concept that is still being studied in complex analysis.In this field, it counts the number of complex roots of a polynomial [40].Kodama et al. [41,42] extended the Winding number algorithm into 3D space by summing solid angles to determine whether a point is inside or outside a non-convex polyhedron.This method can implement shape classification in 3D space by support vector machine (SVM).However, as the algorithm lacks a calculation method to determine the positive and negative of the solid angle based on the relative position of the observation point, it requires an artificial setup.While the Winding number algorithm is practical and easy to implement in 2D space, 3D space presents unique challenges due to the triangle face direction that cannot be unified by clockwise or counterclockwise rearrangement in 2D.Therefore, it is necessary to overcome these challenges when extending the algorithm to 3D space.
To address the drawbacks of the traditional Ray casting method and Winding number algorithm, our research introduces a novel method for network coding, Tri-Coding, which utilizes a triangulation model.Therefore, we proposed an improved Winding number with a Tri-Coding (WNTC) algorithm using the Delaunay triangulation model for voxelization model construction.The WNTC algorithm solves the problem by constraining the positive and negative values calculated by the internal and external directions of the triangular normal vector.The proposed WNTC algorithm eliminates the need for manual intervention in the modeling process, which makes it more conducive to 3D modeling program automation performance.
The proposed WNTC algorithm in this study uses many inverse trigonometric functions to model a three-dimensional ore body model.As a result, it is a computationally intensive process.Fortunately, advancements in GPU technology [43] have made it much more efficient than traditional CPU computing.To improve the process's efficiency, we used GPU instead of CPU to execute some of the operations.In parallel programming, subroutines can perform functions independently, and appropriate thread allocation can improve CPU utilization and operation speed [44].NVIDIA's Compute Unified Device Architecture (CUDA) is a powerful computing platform that allows programs to transfer computing processes to GPU, reducing the time spent on tedious and repetitive computing [45,46].This architecture can significantly boost the computing efficiency of large data volumes when other factors, such as CPU control time, occupy less computing time of the program.
In summary, our study offers an effective solution to the point in polygon test in 3D modeling.We proposed the WNTC algorithm and applied it to create practical voxel models of three-dimensional ore body models.Furthermore, we utilized the CUDA programming method to boost the computing speed of the WNTC algorithm, thereby improving the modeling efficiency of the model.

Data and Experimental Environment
The borehole data used in this study consist of 258 locations, and the boreholes are collected according to 9 nearly parallel planes and a total of 30 layers of data is collected.The boreholes are widely distributed, with a range of 1455.34 m in the x-direction, 1561.61m in the y-direction, and a height difference of 263.67 m.
Once the surface model of each layer is constructed using Delaunay triangulation, it contains the most significant number of triangular faces in the layer of 1032 triangles.Assuming that the particle size of a voxel is set to 12×12×4 m, approximately 1.02 million discrete points need to be processed during discretization.These points must be evaluated as point in polygon with different layer models.

Construction and Voxelization of Ore Body Surface Model
The ore body surface model was constructed by Delaunay triangulation.Based on the Delaunay model, the voxel model can be constructed by discretizing the model's bounding box, obtaining the undetermined points, and judging the position relationship between the binding points and the model body.The steps of the voxel modeling are as follows, as shown in Figure 1.
Calculate the position relationship between each point and the surface models.That is, take the point in polygon test which needs to be able to handle non-convex geometry.The standard methods are the Ray casting method and the Winding number algorithm.
The Ray casting method is challenging in three-dimensional space.When the ray passes through the intersection lines or the vertex of triangular surfaces, the number of faces the ray passes through will be an uncertain result and the odd-even result will become unreliable.

Winding Number Algorithm
The Winding number algorithm as shown in Figure 2 is a method to judge whether a point exists inside the polygon in two-dimensional space by calculating the sum of the angles between one polygon and one point.This method makes it easier to generalize the case mentioned in the above ray method, which is suitable for convex and non-convex polygons.As shown in Figure 3, the extending Winding number algorithm in 3D can introduce the concept of a solid angle instead of a directed angle in the 2D plane to realize the expansion of the algorithm in 3D space.
The solid angle is formed between the point  and the triangular faces of the polyhedron to be measured in the Winding number algorithm in 3D, and the sum of the values of these solid angles gives the position relation of the point inside or outside the geometry.One solid angle   can be obtained by Formula (1), where the  is one dihedral angle constituting the   .
It is known that the surface area of a sphere with radius 1 ( = 1) is 4.Therefore, the cumulative value  of   is calculated, as shown in Figure 3.When  is inside the polygon (Figure 3a),  is precisely the surface area of the unit sphere, then  = 4.When  is outside the geometry (Figure 3b), according to the above principle of the sum of solid angles, it is easy to know that the relation between the relative positions of the face  and the other three faces is opposite.Its projected area on the unit sphere  is equal to the sum of the projected areas of the other three faces, then  = 0.This method is not limited to tetrahedrons but also applies to any polyhedrons in 3D space.Therefore, the diagnosis formula can be given by the Formula (2): in Formula (2) represents the number of triangular faces of the test polyhedron.Then the time complexity of the method is ().

Tri-Coding
This algorithm is sensitive to edge order and requires vertices to be encoded in an order (clockwise or counterclockwise) in 2D.Unlike the two-dimensional polygon, it is challenging to generate the "same direction" of the spatial triangles through vertex ordering for three-dimensional geometry.This study uses the Delaunay triangulation network method to build the stratum surface model, and it is expected that this positive and negative relationship can be given through the regularity shown in Figure 4. Thus, our study proposes a method named Tri-Coding, which codes each triangular face to realize the constraint on the direction of normal vectors.In Figure 5, we can quickly know that for any two triangles with common sides, when their vertices are arranged in a counterclockwise or clockwise rotation, the direction of their common sides is reversed in the two triangles, and their normal vectors are pointing to one side.Therefore, we can encode an obj model data composed of triangle faces through the common edge relationship of adjacent triangles to obtain model data that can satisfy the calculation, that is the Tri-Coding algorithm.The algorithm's pseudo-code is shown in Algorithm 1, where Δ  is a data set of triangles read from the OBJ model.Δ  is the encoded set from Δ  by Tri-Coding. is one triangle from Δ  and  is its vertex id. is one edge of one triangle to judge the  swaps order or not and  is its vertex id.if there exists a triangle  = ( 1 ,  2 ,  3 ) ∈ Δ  that contains edge  then 4: Extract  from Δ

35:
Initialize Δ  = ∅ and  as an arbitrary edge of any triangle in Δ

37:
Output: Δ  38: end procedure Regard the first triangle as the reference triangle, and the algorithm will recursively search the other triangle with common edge .If the target triangle  is found, the vertices of its common edge  are judged to assess whether the vertex sequence of  is the same as that of the reference triangle.If so, the two vertices id of the same common edge  in the target triangular surface  are exchanged.If the reverse is true, the swap is not performed.
For example, in the part of the triangulation network in Figure 6, when Tri-Coding algorithm takes triangle  1  2  8 and triangle  1  7  8 as the reference triangle the two coding results of the vertex sequence and the normal vector direction obtained are indicated as shown in the columns of Figure 6b,c.It can be seen that if the normal vector of the first triangle detected by the program is pointing outside the model.After coding, the other normal vectors point outside the model.Similarly, when the normal vector of the first triangle points inside, the other normal vectors will all point inside.

WNTC: Winding Number with Tri-Coding
Based on the Tri-Coding algorithm proposed in this study, the Winding number algorithm in 3D is improved, and named the Winding Number with Tri-Coding (WNTC) algorithm.In this algorithm, the normal vector of the spatial triangle forming the model has a normal vector with the same direction.At this time, the angle relation between the vector from a point to any point of the spatial triangle and the normal vector of the spatial triangle can be adopted.The signed value   is calculated as shown in Figure 7, when the angle between  0 ⃗⃗⃗⃗ and  ⃗⃗ is acute or obtuse.Introduce variable , to mark the symbol of   .When  = 1,   > 0, and when  = −1,   < 0. The value of  is as follows Formula (3).
Then combine the formula of solid angle   (Formula (1)) with Formula (3) and let  = 1, so the value of   is as follows: As mentioned in Section 2.3.2, the Tri-Coding algorithm may cause that   is all less than 0 or the cumulative value S = −4π due to the direction of the spatial triangle used as the coding basis.In order to simplify the diagnosis,  can be processed with absolute value in Formula (3).The input data can be expressed as two matrices  1 and  2 in Formulas ( 6) and ( 7), where  1 is the matrix of target points, the size of which is  × 3,  is the number of the points, and each row of   is the coordinate of each point (, , );   represents the information of each triangular face of the three-dimensional geometry, the size is  × 9,  is the number of triangular faces of the geometry, and each row of  2 represents the coordinates of the three vertices of each triangular face [( 1 ,  1 ,  1 ), ( 2 ,  2 ,  2 ), ( 3 ,  3 ,  3 )].
The Winding number algorithm can then be expressed as: In Formula (8), function  represents the WNTC algorithm for calculating the dihedral angle solid angles of points and triangular faces, and   is a matrix of  ×  size, representing the result after calculating solid angles between  points and  triangles, respectively, each row represents a point, and each column corresponds to a triangular face.
Then each row of   is summed, and the discriminant matrix is set to   in Formula (10) which derived from Formula (5).
During the above operations,   operations are independent of each other, therefore, in the design of CUDA, the operation of   is taken as the kernel function, and the thread grid and thread block are divided according to two-dimensional logic, so  ×  threads can be created, and each thread calculates a   .
The correlation operation of one   is taken as an atomic operation, and its time complexity is set to (1).Then, the time complexity to complete the voxel modeling of geometry is as follows: The calculation time is obviously affected by the number of points and the complexity of the stratum model.Through the CUDA parallel computing design, our study takes advantage of its excellent performance of simultaneous computing with a lot of threads to improve modeling efficiency.Assuming that the number of thread grid and thread blocks used in CUDA programs are  and , respectively,  ×  threads will perform computation at the same time, and its time complexity is as follows: When ( • ) = ( • ), the running time of this algorithm will be almost unaffected by the number of points to be measured and the complexity of the model, but relatively speaking, the space complexity will increase.

Comparison of Methods
Figure 9a shows that a simple non-convex geometry was used to verify the improved effect of the proposed Winding Number with Tri-Coding (WNTC) algorithm.The information for the obj model of this geometry is presented in Figure 9b.As can be seen from Table 1, when the positive and negative solid angles are not distinguished, the   values are all positive, It is impossible to distinguish the relative positive and negative relationships between   corresponding to face 6 ( 1  2  5 ) located in the non-convex position of the geometry and other triangular faces, and the obtained summing results cannot correctly judge whether the point is inside or outside the geometry.And it indicates that through Tri-Coding, each   will obtain the correct relative positive and negative relationship, and the cumulative value  can be correctly calculated.

The Voxel Models Effect
As shown in Figure 10, compared with the proposed WNTC algorithm in this study (Figure 10c), the voxel model generated by the Ray casting method has certain defects (the red circle in Figure 10b).The specific differences are described in detail in Figure 11.And the JC03, KC03-52, and KC03-6 indicate a number to distinguish different formations in Figure 11. Figure 11a-c show the explicit model effects of the JC01, KC03-52, and KC03-6 strata, respectively.Figure 11d-f illustrate the voxel model created using the Ray casting method.The number of voxels included are 18,674, 12,376, and 13,604, respectively, and the voxel size is 12 × 12 × 4m.It can be seen from the model effect that some voxels are missing.
On the other hand, Figure 11g-i display the voxel models generated by the WNTC algorithm proposed in this study using the above stratum models.The number of voxels included are 18,681, 12,411 and 13,711, respectively.It is evident from the model effect that the voxel model generated by the proposed WNTC algorithm is more accurate.
Figure 11.The model effect of some single strata, the effect diagrams of the explicit model and the voxel models constructed by the Ray casting method and the WNTC algorithm in this study.The missing voxels in the models constructed by Ray casting method have been marked in red circles.
Compared with the model developed by the WNTC algorithm, the model built by the Ray casting method requires an additional 107 voxels.This means that the model developed by the Ray casting method has some missing voxels.In contrast, the WNTC algorithm proposed in this study can compensate for a voxel loss of about 0.7%, effectively improving the accuracy of the voxel model.

Comparison of Efficiency
To effectively compare the efficiency improvement effect of CUDA parallel computing, the experiment conducted measurements on about 430,000 points under both CPU and GPU, as shown in Table 2.For different parts of the stratum, the proposed WNTC algorithm was used for each group of experiments.The time taken for sequential operations in the CPU and parallel processes in the GPU were calculated.The results in Table 2 are sorted in ascending order by the number of model vertices and model triangle faces.And Figure 12 shows the running time of CUDA application design on GPU and CPU.According to the data presented in Figure 12 and Table 2, it is evident that the CUDA application runs much faster on GPU than on CPU.The results of the tests show that, on average, the GPU takes up only 0.04% of the time taken by the CPU to complete the computation.Moreover, the highest ratio of GPU running time to CPU running time is a mere 0.65%, which tremendously improves the overall efficiency and is not significantly affected by the number of triangle faces.

Discussion
When modeling ore bodies, there are two common methods: implicit construction and explicit modeling.With implicit construction, an implicit function is used to represent the surface of the stratum, which covers the surface points of the ore body model.Explicit modeling, on the other hand, involves determining vertex coordinates and establishing connections between them, such as fitting triangular faces to the geological stratum surface.This results in a regular and easily manageable model.When building the voxel model, it is necessary to judge the point in polygon test.In the geometric method, it is easy to calculate the position relationship between the point and the space triangles (implicit function).The main issue discussed in this study is the construction method of the voxel model of ore bodies, so explicit modeling methods are used for research and validation.
Compared with the existing 3D ore body voxel modeling research, this paper presents an automated modeling scheme using the Winding number algorithm.Through the design and application of the Tri-Coding algorithm, the modeling process no longer needs artificial control.
The limitations of the methods proposed in this paper could be argued as follows: (1) The Winding number with the Tri-Coding algorithm proposed in this paper only discusses the structure of the model, which is composed of triangular faces.When constructing a computer visualization model, polygons outside of triangles are allowed.
The parameter structure must be adjusted accordingly if the algorithm is applied to a model constructed by polygons with more than three edges.This may involve increasing the number of calculations for the solid and dihedral angle.The Winding number algorithm in 3D provides a more accessible alternative than the traditional ray casting method.However, the WNTC algorithm, which relies on inverse trigonometric functions, demands higher operation accuracy.(2) Our study's GPU thread grid and block are relatively direct.The number of triangular faces of the stratum model used in this experiment is up to about 1000, which does not exceed the hardware environment limit of this experiment, so the number of triangles is directly used as the number of GPU thread grids to verify the effect of CUDA parallel computing design on the improvement in program running speed.
Given the above limitations, the following possible effective solutions are proposed: (1) When the model body is made up of polygons other than triangles, additional steps can be taken to adapt the algorithm using the abovementioned method.Alternatively, the polygons can be divided into triangles to meet the algorithm's parameters outlined in this paper.The latter method is more straightforward.However, it may increase the amount of data in the model depending on the number and structure of the non-triangular polygons.Handling calculation accuracy with care during program design is crucial to avoid any mistakes in the final judgment.(2) When a model consists of a large number of triangular surface elements that exceed the capability of the GPU's hardware environment to handle thread meshes, the required threads can be grouped using software control.The CUDA parallel computing process is then performed, with part of the host memory allocated to set registers, save pre-calculated results, and complete the operation via CPU coordinated control.

Conclusions
In this study, we propose the Winding number with Tri-Coding (WNTC) algorithm, which combines Tri-Coding and the Winding number algorithm in 3D.To efficiently voxel model 3D explicit models, our study also combined CUDA program design and optimized the implementation process of the proposed WNTC algorithm.Through theoretical analysis and experimental verification, we found that the proposed WNTC algorithm can better constrain the positive and negative winding number during voxel modeling.It is better and faster than the traditional Ray casting method in the voxelization of the model.
The innovation offered in this paper lies in the design of a triangulation network coding (Tri-Coding) for the Winding number algorithm based on the following rules: Through the sequence relationship of the vertices of two triangles with common edges in the storage structure of the computer program, it is found that when their vertices are surrounded in a clockwise or counterclockwise direction, the common edges are arranged in the opposite order in their respective vertex sequence lists.The algorithm realizes the constraint of the normal vector of the triangular surface of the model so that it points to the internal and external of the model to improve the Winding number algorithm in 3D.This is conducive to more adequately describing the spatial relationship between points and triangles in the Winding number algorithm.The Winding number in the 3D algorithm no longer needs to deal with the positive and negative association of the solid angle in the operation process.It solves the problem of the computer's weak perception of the relative position relationship between points and polyhedrons in 3D space.In addition, it makes the model's surface in 3D space directional, which is conducive to the expansion of certain 2D geometric processing algorithms in 3D space.
The proposed WNTC algorithm suits any 3D model with an explicit surface model structure.Additionally, our proposed method is not limited to voxel modeling of the ore body model and has strong applicability for other application fields with general explicit model voxel requirements.
In future research, we will discuss the data processing method of drilling data under specific conditions.If there are complex geological conditions, such as faults and lenses, in the region, more geological exploration data should be introduced.We will also carry out operations on the drilling data to improve the model shape.

Figure 1 .
Figure 1.Schematic diagram of voxel modeling (Red and blue dots represent the model's upper and lower surface vertices, respectively; black lines represent the model's edges, and the green box represents the bounding box to be calculated.Black points represent the generated isometric discrete points in the green bounding box.).

Figure 2 .
Figure 2. Winding number in 2D. is the target point. is the vertex of the polygon. is the directed angle of the directed edge, and the  2 is clockwise, others are counterclockwise.

Figure 3 .
Figure 3. Winding number in 3D.Target point P is inside (a) or outside (b) the tetrahedron ABCD formed by the triangle faces.The shadow represents the projection of the corresponding solid angle.

Figure 4 .
Figure 4.When the normal vector  ⃗ of the space triangle  points away from the point  (a),   is positive; otherwise, when  ⃗ points to  (b),   is negative.The direction of  ⃗ follows the right-hand rule.

Figure 5 .
Figure 5.The relationship of the directed edges in a triangular pyramid expansion diagram (The vertex sequences of the triangles in the figure are arranged counterclockwise, as shown by the red and blue arrows in the figure, where the vertex sequences at the common sides of the triangles are in reverse order in their respective triangles.For instance, the edge  is  ⃗⃗⃗⃗⃗⃗ in triangle  and is  ⃗⃗⃗⃗⃗⃗ in triangle .).

Figure 6 .
Figure 6.Part of the triangulation network and normal vectors.the vertex order of the triangulation network is the subsequence of the vertex ordering given sequence  1 →  2 →  3 →  4 →  5 →  6 →

Figure 7 .
Figure 7.The direction of  0⃗⃗⃗⃗ and  ⃗⃗ .The red vector  0 ⃗⃗⃗⃗ is the vector formed by point  pointing to any point on the space triangle , and the blue vector  ⃗⃗ is the normal vector of the triangle.When the direction of  0 ⃗⃗⃗⃗ and  ⃗⃗ is close to the same, the angle is acute (a), and when the direction of  0 ⃗⃗⃗⃗ and  ⃗⃗ is close to the opposite, the angle is obtuse (b).

4 .
Improved Algorithm Efficiency Based on CUDABased on the proposed WNTC algorithm, the CUDA parallel program is designed, and the overall process of the program is shown in Figure8.In the experimental section of this study, a part of the model is tested.The number of discrete points in the bounding box is about 430,000, calculated with the stratum model data.According to the WNTC algorithm, CUDA parallel program is designed.

Figure 10 .
Figure 10.A part of the model with different modeling methods showing the effect diagrams of the explicit model of some stratum (different colors indicate different stratum) (a), the voxel models constructed by Ray casting method (b) and the proposed WNTC algorithm in this study (c).The missing voxels in the models constructed by Ray casting method have been marked in red circles.

Figure 12 .
Figure 12.The running time of CUDA application design on GPU and CPU.

Table 1 .
The Calculation result   and  by Winding number algorithm with or without Tri-Coding in Figure9.

Table 2 .
Running time of voxel modeling in different stratum models by the CUDA.