STL Triangular Mesh Generation Based on SAT Model

: Mesh generation is a fundamental technique in multiple domains. In this study, a STL triangular mesh generation method based on SAT model is proposed. Two novel triangulation methods, the constrained Delaunay algorithm and the grid subtraction algorithm, are employed on the multi-loop planer regions and the curved surfaces respectively. For the use of node adjustment, the mesh nodes on the surface boundary are strictly matched, with no cracks created on the joint of model surfaces. Experiments show that the proposed solution works effectively and high quality of the mesh model is achieved.


INTRODUCTION
Triangular Mesh models have been widely applied in many areas, such as computational geometry, virtual reality, reverse engineering, FEA, et al.Generally, due to the high complexity of modeling, it's difficult for the users to construct the meshes directly; the most frequently used generation method is usually based on the conversion of CAD model.Nowadays, Most CAD systems (e.g., Pro/Engineer, Solid Works) have developed interfaces to convert 3D geometric information into specific mesh files, such as STL, VRML, FLT et al.However, considering the commercial profits, the CAD vendors are unwilling to open their native file format and generative mechanism.Although most CAD platforms have provided API functions, the users' full access to manipulate the CAD model directly still remain limited.During the past few years, considerable research efforts have been invested on the neutral files, which provide a systemindependent format for the transmission from CAD system to mesh models.Wang et al. (2007) present a new arithmetic of transforming IGES file to STL file, by which the surfaces of the model are trianglated correctly according to the geometry and topology information recorded in the IGES file.A similar work has been presented by Wang et al. (2006) who developed a automatic mesh generation technologies for 3D surface finite element meshes from STEP files.
In most cases, mesh characters such as shape, quentity, quality and distribution, as well as the efficiency, are the main factors that used to validate the functionalities of triangular algorithms.Recently, many approaches have been proposed relating to the physical properties of the mesh.Through the research of combining interpolating surface modelling with the traditional Delaunay triangulation algorithm, Deng and Wang (2009) present a new surface mesh generation scheme which can achieve better shape and size of the FE mesh.A recent research (Zhang et al., 2009) introduces a three dimensional grid division encryption rule.Compared with traditional method, the algorithm has obvious superiority in computation and accuracy and the triangular results can accurately describe the physical characteristic distribution of the mesh.
In this study, related to the research on the above techniques, a triangular mesh generation method is proposed to transform the neutral file format of SAT to STL.Firstly, necessary information of entities (e.g., coordinates of the vertex, mathematical expressions of the edge and the face et al.) of the model are extracted from the SAT file, then using mapping approach, the surface region are presented as closed planer polygons on the parametric domain.After that, different triangular schemes are implemented on the planer surfaces and curved surfaces.Finally, through inverse mapping method, all the triangles are projected to the three-dimensional domain and stored in STL file format.With this solution, the CAD model is reconstructed in trianglular meshes form and no cracks created on the joint of model surfaces.Experiments show that the proposed algorithm is successful in controling the quality of model meshes compared with the commercial CAD software.
Framework of the triangulation: Currently, most main-stream CAD vendors have developed their own native CAD file format.Although the data structures of the CAD models are quite different, B-rep (i.e., boundary representation), as a primitive presentation rule, has been widly adopted to create solid models of physical objects.Topologically, a boundary model of Step 1: Read the topological and geometrical information from the SAT file and extract necessary entities to discrete the border curves on the model surface according to a setting accuracy.Then, the boundary polygons, which include a discrete point set on the curve, are projected to the parametric domain in relation to the surface equation.
Step 2: In the closed UV parametric domain, the constrained Delaunay algorithm which is flexible for arbitrary multi-loop regions triangulation is applied to the model planes.
For the curved surface, grid subtraction algorithm with node adjustment operation is employed, so as to avoid the mesh cracks occuring on the joint of model surfaces.
Step 3: When the surface triangulation is completed on the parametric domain, all the triangles will be projected to the three-dimensional domain and normalized facets data (i.e., coordinates of the nodes and normal vector of the triangle) will be written to the STL file.
Constrained Delaunay triangulation for multi-loop region: As a classic algorithm, Delaunay triangulation is widely used in mesh generation field.For the unique empty circumcircle property, Delaunay triangles with large internal angles are selected over ones with small internal angles, which consequently provide the shape quality of overall meshes.In this study, we address a constrained Delaunay triangulation algorithm for the multi-loop region.
Firstly, in parametric domain, the nodes on the outer loop are arranged counter-clockwise and the nodes on the inner loop are arranged clockwise.At the same time, all edges information will be stored in a chained list.After that, two endpoints on the first edge are taken out as references to decide the third point for a triangle.In order to find the appropriate node, edges between the given endpoints and the candidate node are defined firstly.Then, the best candidate is determined by the following principles: the two defined edges do not intersect with the primary edges set and the angle between the two edges is maximum.
Next, new triangles will be constructed successively using the iteration method.At the end of each iteration, if the number of the rest nodes is less 3, the task will be terminated immediately.Finally, the multi-loop region is covered with a serious of triangles, with no overlaps and cracks created.
As shown in Fig. 2, the planer region is bounded by 1 outer loop and 5 inner loops, with 84 nodes on the polygons.After the constrained Delaunay triangulation, the region is covered with 92 triangles.Referring to theoretical formula (Min and Tang, 1996): T (92) = V b (84)-2+2H (5), the triangulation result is precise and controllable.
Grid Subtraction algorithm: The Delauny trianglulation algorithm, which has been successfully implemented on the planer surface, is not suitable for the curved surface.In order to keep the vary appropriation of the surface, a novel grid subtraction algorithm is proposed.The common triangulation steps are described as follows: Step 1: Uniform grids are created on the parametric region according to the boundary limitation of the surface.Meanwhile, information of the grids will be stored in a bi-directional chained list, as shown in Fig. 3.
Step 2: At each grid, an iteration method is adopted to determine its final shape, based on the position comparsion with the boundary polygons.If the grid is located outside of the boundary polygons, it will be removed from the chained list.Besides, boolen trimming operation will be implemented in case that the grid and the boundary polygons are intersected.In addition, the grid will be divided into two triangles directly on condition that it is verified inside of the polygons.
Step 3: The Delaunay triangulation algorithm, which has been described in the above section, will be used to subdivide the polygon of the trimmed grid into several triangles.Subsequently, the node adjustment algorithm is adopted, by which the boundary nodes on different surfaces can coincide together.
Step 4: Finally, all the triangles are projected to the three-dimensional domain and written into the STL file.
Figure 4 illustrates how the adjustment algorithm works during the triangulation process.As shown in the figure, the nodes number of grid p has changed to 6 after the boolen trimming operation.With the subsequent Delaunay triangulation, the region will be divided into four parts.However, triangle node no.1 is not identical with node no.7 on the boundary polygon, which will lead to a clearance between two adjacent surfaces.To solve this problem, a "ratio priority" principle is adopted to adjust the node position.Here, polygon nodes no.7, no.2 and no.3 are used for reference.Subsequently, triangle node no.1 is moved to coincide with node no.7 and no.4 with no.3.Finally, there are 3 triangles left, without excessive nodes or gaps on the region.Figure 5 show the triangulation result of a spline surface.

CASE STUDY
A data exchange interface from SAT to STL is developed by the Visual C++ 6.0 and ACIS.To verify the proposed algorithm, the interface will be compared with Pro/Engineer and Solid Works. Figure 6 shows four mesh models of a supporter, generated from different platforms.
Table 1 and 2 illustrate the experimental results of the supporter.From the data in Table 1, we can find that under the same precision circumstances, the number of the triangles is very close.
The quality of triangular mesh model has crucial influence on engineering applications and the regularity is the main factor that determines the quality of a triangle.In practical, an equilateral triangle is optimal, with the regularity valued at 1.Meanwhile, the regularity value of the long and narrow triangle is close to zero, which will decrease the total quality of the model.
In this experiment, three regularity measurement rules, based on angle evaluation (Hamann, 1994), area evaluation (Gueziec, 1997) and edge evaluation (Zhang et al., 2004), are adopted to assess the mesh model quality.Detail comparisons of the regularity are given in Table 2. From the statistic data, we can see that, though the average value is not so high, the amount within the regularity range of 0.0~0.005 is very small and the total quality of meshes has been partly improved, which proves the superiority of the proposed method, compared with Pro/Engineer and Solid Works.

CONCLUSION
Mesh generation is a key technique that employed in a variety of fields, such as virtual reality, reverse engineering, FEA, mechanical manufacturing, et al.This study provides a feasible way to achieve STL model from the SAT file, which is proved to be effective and applicable in mesh generation.Different from the conventional solution, two algorithms are adopted in this study, corresponding to the model surfaces types.For the planer surfaces, the constrained Delaunay method is adopted, which shows high performance in the triangulation of multi-loop region.At the same time, the grid subtraction method is used for the curved surface, so as to guarantee the discrete presicion.Due to the node adjustment algorithm, all the adjacent surfaces can be matched perfectly, without cracks created on the mesh model.Experiments show that the meshes quality is respectively improved.Since B-rep models share a common topological structures, the proposed method can be used in other similar generation works, such as the conversion of IGES, STEP formats.

Fig. 1 :
Fig. 1: Basic steps of mesh conversion: (a) three dimensional surface, (b) triangulation on parametric region and (c) three dimensional meshes

Fig. 6 :
Fig. 6: Supporter models generated from different platforms: (a) SAT model, (b) STL model exported from Pro/E, (c) STL model exported from SolidWorks, (d) STL model generated by the proposed solution

Table 1 :
Mesh quantity comparison

Table 2 :
Regularity comparison of different mesh models Quantity of specific intervals