Hybrid tetrahedral mesh generation method based on ray tracing and a15 lattice

By using a hybrid tetrahedral mesh generation method combining ray tracing and A15 lattice, the problems of inaccurate surface reduction and high computational complexity in existing technologies are solved, achieving efficient and high-quality mesh generation.

CN121010731BActive Publication Date: 2026-04-10SHANDONG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG UNIV
Filing Date
2025-10-27
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing tetrahedral mesh generation algorithms cannot accurately reproduce the geometric features of the model surface during surface reconstruction, and have high computational complexity and large storage overhead, making them unsuitable for large-scale problems.

Method used

A hybrid tetrahedral mesh generation method based on ray tracing and A15 lattice is adopted. By combining spatial partitioning, region partitioning, octree construction and ray filling method with Delaunay method, efficient surface reconstruction and sharp feature preservation are achieved, reducing computational complexity and storage overhead.

Benefits of technology

It achieves high-quality mesh generation, reduces computational complexity and storage overhead, improves mesh quality and generation efficiency, and is suitable for complex 3D models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010731B_ABST
    Figure CN121010731B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of data processing, and particularly relates to a hybrid tetrahedral mesh generation method based on ray tracing and A15 lattice, which comprises the following steps: S1, space division and intersection detection; S2, region division and filling object; S3, octree construction and ray filling method; and S4, hierarchical mesh generation. The method has the advantages that the technical problems that the existing mesh filling method cannot accurately restore sharp surface features, and the sign distance field method has low calculation efficiency and large storage overhead are solved, high-quality and high-efficiency tetrahedral mesh generation is achieved, and a reliable mesh discretization solution is provided for finite element analysis and engineering simulation of a complex three-dimensional model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of data processing, and particularly relates to a hybrid tetrahedral mesh generation method based on ray tracing and A15 lattice. BACKGROUND

[0002] The classical tetrahedral mesh generation algorithms mainly include the Delaunay method and the front propagation method. Although the Delaunay method has a good theoretical basis, it inevitably produces low-quality tetrahedrons called "thin elements", and it is difficult to stably generate high-quality meshes. The time complexity of the front propagation method is relatively high, and when dealing with complex models, front propagation conflicts are prone to occur, leading to problems of element quality degradation and convergence, and the robustness is insufficient.

[0003] In order to overcome the limitations of classical algorithms, in recent years, scholars have proposed mesh filling methods. Among them, the isosurface filling method based on signed distance field proposed by Labelle and Shewchuk is representative. This method fills the model interior with a predefined set of high-quality tetrahedrons, and shows significant advantages in mesh quality, generation efficiency and robustness.

[0004] However, the existing mesh filling method still faces two major challenges: first, it relies heavily on the accuracy of the model signed distance field during surface reduction, and cannot preserve sharp edges and sharp corner features, and is only suitable for smooth surfaces or scenarios where surface details do not need to be considered; second, the construction cost of the signed distance field is high, as it needs to calculate the distance from each spatial grid point to the surface and determine the inside and outside properties, and also needs to store a large amount of grid point information, resulting in huge computational and memory overhead, making it difficult to apply to large-scale problems.

[0005] Therefore, there is an urgent need for a tetrahedral mesh filling method that can accurately restore the geometric features of the model surface and has high efficiency and low storage overhead to meet the demand for high-quality mesh generation. SUMMARY

[0006] In view of the defects and deficiencies of the existing mesh filling method, the application provides a hybrid tetrahedral mesh generation method based on ray tracing and A15 lattice, and the technical scheme is as follows:

[0007] A hybrid tetrahedral mesh generation method based on ray tracing and A15 lattice, comprising the following steps:

[0008] S1. Space division and intersection detection: divide the space of the input target model into cubic grids, and determine the intersection relationship between the surface triangles and the spatial cubic grids;

[0009] S2. Region division and filling object: based on the mixed strategy, the space is divided into regions, the internal region is filled with A15 lattice, and the boundary region is filled with Delaunay method to realize surface reduction and sharp feature preservation;

[0010] S3. Octree construction and ray filling method: construct octree acceleration structure, use ray tracing method to quickly identify internal filling region, and generate filling line segment to determine the position of A15 lattice filling;

[0011] S4. Hierarchical grid generation.

[0012] Preferably, the space is divided into a cubic grid in step S1, and the specific steps are as follows:

[0013] After reading the input target model, the preset grid step size is calculated according to the model size The three-dimensional space where the model is located is uniformly divided into a cubic grid, and the space division process needs to meet two key constraints: boundary buffer setting and four multiple alignment requirements;

[0014] According to the model bounding box, the basic grid span in each coordinate direction is calculated:

[0015] ;

[0016] Wherein is the length of the model in the first coordinate direction, is the grid step size;

[0017] The number of grids is calculated according to the formula: ;

[0018] Wherein is the four multiple alignment compensation term, and the formula is as follows:

[0019] .

[0020] Preferably, the intersection detection step in step S1 is as follows:

[0021] Step one, traverse each triangle in the surface triangular mesh, and for the three vertices of the triangle , construct its axis-aligned bounding box, and expand a grid step size in each direction to ensure that the bounding box can cover all grid units that may intersect with the triangle;

[0022] Step two, based on the expanded bounding box to determine the range of grid units that need to be detected, convert the bounding box coordinates to grid index, and calculate the range of involved grid index:

[0023] ;

[0024] ;

[0025] wherein, and are the minimum and maximum coordinates of the extended bounding box respectively, is the origin of the grid, is the edge length of the grid cell;

[0026] Step three, detect each grid cell in the determined range one by one: for a cell with grid coordinates (x, y, z), construct its corresponding bounding box, and adopt a two-level detection strategy:

[0027] The first level performs fast intersection detection between bounding boxes, including the judgment of intersection, inclusion and other geometric relationships;

[0028] The second level uses the separate axis theorem to perform accurate intersection detection between triangles and bounding boxes for the grid cells screened by the first level;

[0029] Step four, store the detected intersection information in the form of {grid coordinates, triangle index}, and sort it in lexicographical order according to the grid coordinates, so as to facilitate fast query and access in the subsequent processing stage.

[0030] Preferably, step S2 adopts a hybrid strategy for region division: according to the relative position relationship between the grid cell and the geometric boundary of the model, the space is divided into a boundary region and an internal filling region; for the internal filling region, directly adopt A15 lattice for regular filling, the specific implementation is: translate the coordinates of the 27 vertices of the lattice according to the target grid position, and then fill the 46 tetrahedral cells into the corresponding position, the coordination number of all edges of A15 lattice is 5 or 6, so that the filled tetrahedral cells can be closest to the ideal regular tetrahedron configuration; for the boundary region, adopt Delaunay method to realize the tetrahedral grid generation in this region.

[0031] Preferably, step S3 adopts octree data structure to perform spatial hierarchical division on the triangular mesh of the model surface; the octree construction adopts a non-uniform subdivision strategy, which performs adaptive division according to the spatial distribution density of the geometric model, and the steps are as follows:

[0032] First, calculate the axis-aligned bounding box of the root node by traversing all the triangle vertices;

[0033] Then, perform recursive spatial segmentation, which uniformly divides the current node into 8 subcubes, and the triangles are distributed to the corresponding child nodes according to the barycentric position;

[0034] Finally, the bounding box of the leaf node is recalculated to ensure that it completely contains all the triangles in the node, and the bounding boxes of all parent nodes are updated recursively to maintain the geometric consistency of the entire octree structure. The recursive splitting terminates when the number of node triangles is less than a preset value or the maximum depth is reached.

[0035] Preferably, the ray filling method in step S3 is to quickly identify the internal filling area by constructing a regular light array, and the steps are as follows:

[0036] A regular light array is constructed on the X-Z plane with the Y-axis as the light incidence direction, and the starting point coordinates of the light are represented as:

[0037] Wherein is the index coordinate of the X-Z plane grid center point, which satisfies , that is, the light interval is to ensure that the grid size required when filling the subsequent A15 lattice is consistent.

[0038] Preferably, for each light beam constructed, an octree-accelerated ray tracing algorithm is used to perform surface intersection detection, and the algorithm uses a recursive strategy to traverse the octree structure, and the steps are as follows:

[0039] First, perform ray-bounding box intersection test in the internal node, and use the flat layer intersection method to quickly eliminate the non-intersecting space region;

[0040] Then, in the leaf node, the Möller-Trumbore algorithm is used to perform accurate ray-triangle intersection detection on the stored surface triangles to obtain the intersection point parameters and coordinates; since the model surface is closed, the number of intersection points of each light beam with the surface must be even, and the grid index corresponding to the intersection point is calculated using the coordinate conversion formula , wherein is the intersection point coordinate, is the grid origin, and the grid index corresponding to the intersection point can be calculated;

[0041] Finally, after pairing the adjacent intersection points to form a filling line segment, the grid alignment processing is performed on the line segment endpoints, and the specific processing strategy is as follows: according to the relative position of the intersection point and the grid center, there are the following processing conditions: for the starting endpoint of the line segment, when the intersection point is located before the grid center, the starting endpoint is adjusted to the current grid; when the intersection point is located after the grid center, the starting endpoint is adjusted to the next grid. For the terminal endpoint of the line segment, when the intersection point is located before the grid center, the terminal endpoint is adjusted to the previous grid; when the intersection point is located after the grid center, the terminal endpoint is adjusted to the current grid;

[0042] ​​If the initial endpoint index is greater than the terminal endpoint index, it is marked as invalid and is processed by the Delaunay method.

[0043] Preferably, a transitional bridging A15 lattice variant is introduced between adjacent hierarchical grids to achieve smooth transition and topological connection between A15 lattices of different scales, and a hierarchical merging strategy is adopted to coarsen the grids layer by layer to generate hierarchical tetrahedral grids based on A15 lattices, that is, the boundary grids of the current hierarchical level need to be reserved as bridging structures during the merging process to ensure the continuity and geometric consistency between low-level and high-level grids, and the strategy includes two links of boundary grid identification and bottom-up hierarchical merging.

[0044] Preferably, based on the characteristics of the ray filling method, a boundary grid identification strategy is proposed, which is as follows:

[0045] The endpoints of the filled line segment are directly classified into the boundary set to ensure the integrity of the boundary; for the middle part of the line segment, it is detected whether there are adjacent filled line segments in four directions, if any direction lacks adjacent line segments, the grid corresponding to the middle part is classified into the boundary set; otherwise, the grid is detected one by one;

[0046] In the grid-by-grid detection, the neighborhood integrity of each grid in six directions is evaluated: the grid with a missing direction is classified into the boundary set, and the grid completely surrounded by the neighborhood is classified into the interior set.

[0047] Preferably, the merging step is: the interior grid is subdivided into potential merging grids and unused grids, the potential merging grid needs to meet the coordinate constraint condition to ensure that the directionality of the merged grid remains consistent with the ray filling, and can continue to be combined into a line segment form to provide a basis for recursive merging; for each potential merging position, search the grid block around it, including the position itself, verify whether the remaining 7 grid units exist completely; if the condition is met, merge them into a large grid, and represent and store the connected large grids at the same ray position in the form of a line segment;

[0048] After the merging is completed, the boundary identification and potential merging point detection are performed again for the newly generated hierarchical level to form a recursive processing flow until one of the following termination conditions is met: there is no mergable grid block or the grid density of the current hierarchical level meets the preset requirement.

[0049] Compared with the prior art, the application has the following advantages:

[0050] The method not only maintains the advantages of the grid filling method in terms of calculation efficiency and grid quality, but also effectively solves the problems of surface restoration and sharp feature preservation of the existing method, and significantly reduces the calculation complexity and storage overhead of region identification through ray tracing technology, thereby providing a complete technical solution for high-quality grid discretization of complex three-dimensional models. BRIEF DESCRIPTION OF DRAWINGS

[0051] Figure 1 Illustration of the Stanford Bunny model space partitioning (Y-Z section);

[0052] Figure 2 Flowchart of surface triangle and grid cell intersection detection;

[0053] Figure 3 Illustration of the A15 lattice structure;

[0054] Figure 4 Illustration of the Stanford Bunny model region partitioning (Y-Z section);

[0055] Figure 5 Illustration of the Stanford Bunny model octree space partitioning;

[0056] Figure 6 Illustration of the Stanford Bunny model ray array incidence (Y-Z section);

[0057] Figure 7 Illustration of the ray fill segment endpoint alignment processing (Y-Z section);

[0058] Figure 8 A15 lattice variants for transition stitching (partial);

[0059] Figure 9 Illustration of adjacent fill segment existence detection;

[0060] Figure 10 Illustration of adjacent grid existence detection;

[0061] Figure 11 Illustration of bottom-up layer-by-layer merging (Y-Z section);

[0062] Figure 12 "Fandisk" results using TetGen, Gmsh; shown content includes tetrahedral mesh, dihedral angle distribution (blue) and aspect ratio distribution (green);

[0063] Figure 13 "Fandisk" results using TetMesh of the present application; shown content includes tetrahedral mesh, dihedral angle distribution (blue) and aspect ratio distribution (green);

[0064] Figure 14 "Stanford Bunny" results using TetGen, Gmsh; shown content includes tetrahedral mesh, dihedral angle distribution (blue) and aspect ratio distribution (green);

[0065] Figure 15The "Stanford Bunny" result obtained using the TetMesh of the present application; the content shown includes a tetrahedral mesh, a distribution of dihedral angles (blue) and a distribution of aspect ratios (green);

[0066] Figure 16 A comparison of the mesh generation efficiency of the TetMesh of the present application with Gmsh and TetGen on a simple model;

[0067] Figure 17 A comparison of the mesh generation efficiency of the TetMesh of the present application with Gmsh and TetGen on a complex model;

[0068] Figure 18 A flowchart of the process of the present application. DETAILED DESCRIPTION

[0069] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0070] A hybrid tetrahedral mesh generation method based on ray tracing and A15 lattice, comprising the following steps:

[0071] S1. Space division and intersection detection:

[0072] After reading the input target model (such as the geometric model of a cube, a sphere, etc.) surface triangular mesh, according to the set mesh step Cube mesh division is performed on the space where the model is located. In order to ensure that the calculation domain has sufficient boundary buffer and meets the four-fold alignment requirement when filling the A15 lattice, the following formula is used to calculate the calculation domain size.

[0073] First, calculate the basic mesh span in each direction according to the model bounding box:

[0074] ;

[0075] In the formula, is the length of the model in the th coordinate direction, is the mesh step.

[0076] Considering the four-fold alignment requirement of the filled mesh and the setting requirement of the boundary buffer of the present application, the calculation formula of the final mesh quantity in each direction is:

[0077] ;

[0078] where, is compensated by a multiple of four:

[0079] .

[0080] To facilitate the understanding of the division strategy of the cubic grid, a Stanford Bunny model with a span of 1 cm is taken as an example, and the grid step is set to 0.1 cm. As shown in FIG. 2A, the yellow area represents the set boundary buffer grid, which is used to ensure the stability of the value when processing the boundary condition; the purple area is the multiple of four alignment compensation grid, which is used to meet the alignment constraint of the number of grids of the present application; and the green area is the effective grid unit actually occupied by the model. Figure 1 It should be noted that although the space is divided by discretization with small cubic units with a step of , considering the characteristics that the A15 lattice structure occupies 4 small cubic units in the x, y and z directions respectively, 4x4x4 small cubic units are combined into one large cubic unit to improve the detection efficiency and meet the filling requirements of the A15 lattice.

[0081] Intersection detection:

[0082] In order to accurately identify the intersection relationship between the model surface and the space grid unit, a triangle-grid intersection detection algorithm based on bounding box is adopted. This algorithm establishes the mapping relationship between the surface geometry and the discrete grid by detecting the intersection between the model surface triangle and the grid unit one by one.

[0083] The specific process of intersection detection is shown in FIG. 2B. First, each triangle in the surface triangular grid is processed. For the three vertices of the triangle, an axis-aligned bounding box is constructed, and the distance in each direction is expanded by a grid step

[0084] to ensure that the bounding box can cover all grid units that may intersect with the triangle. Figure 2 Next, based on the expanded bounding box, the range of grid units that need to be detected is determined. Since is used as the basic scale of the grid unit, the bounding box coordinates need to be converted to grid indices to calculate the range of grid indices involved:

[0085] where, and are the minimum and maximum coordinates of the expanded bounding box,

[0086] respectively.

[0087] where, and are the minimum and maximum coordinates of the expanded bounding box, The grid origin is set as (0, 0, 0). The length of the grid unit is set as 1.

[0088] Then, each grid unit in the determined range is detected one by one. For a unit with grid coordinates (x, y, z), a corresponding bounding box is constructed, and a two-stage detection strategy is adopted: the first stage performs fast intersection detection between bounding boxes, including intersection, inclusion, and other geometric relationship judgments; the second stage performs accurate triangle and bounding box intersection detection using the Separating Axis Theorem (SAT) for grid units screened by the first stage. SAT detects whether the projections of the triangle and the bounding box on each coordinate axis overlap to determine the intersection relationship, ensuring the accuracy of the detection result.

[0089] Finally, the detected intersection information is stored in the form of {grid coordinates, triangle index} and sorted in lexicographical order of grid coordinates, facilitating fast query and access in the subsequent processing stage.

[0090] S2. Region division and filling object:

[0091] Region division:

[0092] According to the relative position relationship between the grid unit and the model geometric boundary, the solution domain is divided into two different regions: the boundary grid region and the internal filling region. Figure 4 Take the Y-Z cross section of the Stanford Bunny model as an example. The orange grid represents the boundary grid region intersecting the model surface, and the purple grid represents the filling region completely located inside the model.

[0093] The core of this region division strategy is to use corresponding grid generation algorithms for different regions. For the internal filling region, since the grid unit is completely located inside the model and far away from the geometric boundary, A15 lattice is directly used for regular filling. The specific implementation is: the coordinates of the 27 vertices of the lattice are translated according to the target grid position, and then 46 tetrahedral units are filled into the corresponding position. For the boundary grid region, in order to accurately restore the model surface and maintain sharp features, Delaunay method is used to realize tetrahedral grid generation in this region.

[0094] Delaunay method (also known as Delaunay triangulation) is a method of generating triangulation based on geometric criteria. Its core is to ensure that no other input points are contained in the circumcircle of each triangle, thereby improving numerical stability and calculation accuracy.

[0095] Filling object:

[0096] The internal filling region uses A15 lattice structure for spatial filling. For example,Figure 3 As shown, the structure consists of 27 vertices and 46 tetrahedra, belonging to the close-packed tetrahedral coordination (TCP) structure, which can achieve efficient tetrahedral tiling of the model's internal regions. All edges of the A15 lattice have a coordination number of 5 or 6, which allows the filled tetrahedral units to approximate the ideal regular tetrahedral configuration as closely as possible, ensuring mesh quality.

[0097] S3. Octree construction and light filling method.

[0098] Octree construction:

[0099] Since traditional ray tracing requires a large number of ray-triangle intersection tests, an octree data structure is used to spatially hierarchically divide the triangular mesh on the model surface to improve intersection detection efficiency. The octree construction adopts a non-uniform subdivision strategy, which adaptively divides the model according to the spatial distribution density of the geometric model: dense areas of the model are subdivided into smaller spatial units to improve query accuracy, while sparse areas are kept in larger spatial units to reduce storage overhead.

[0100] The construction process comprises three key steps: First, the axis-aligned bounding box of the root node is calculated by traversing all triangle vertices; then, recursive spatial partitioning is performed, uniformly dividing the current node into eight sub-cubes, with triangles assigned to their respective child nodes based on their centroid positions; finally, the bounding boxes of leaf nodes are recalculated to ensure they completely contain all triangles within the node, and the bounding boxes of all parent nodes are recursively updated upwards to maintain the geometric consistency of the entire octree structure. The recursive partitioning terminates when the number of triangles in a node is less than a preset value or when the maximum depth is reached. This spatial organization method based on model distribution significantly reduces the computational complexity of intersection testing and optimizes memory usage efficiency. Figure 5 A schematic diagram of the octree space partitioning of the Stanford Bunny model is shown.

[0101] Light filling method:

[0102] Based on the relative positional relationship between the mesh elements and the model's geometric boundaries, the solution domain is divided into a boundary mesh region and an internal filling region. The boundary mesh region is obtained through intersection detection, while the internal mesh region is efficiently determined using ray tracing. By constructing an array of incident rays on a specified plane, the internal filling region is directly determined using the intersection information of the rays with the model surface. In terms of storage overhead, this method only needs to store the coordinates of the endpoints of the line segments representing the filling region, significantly reducing memory consumption compared to methods based on signed distance fields, which require storing distance values ​​for each mesh point.

[0103] like Figure 6 As shown, we take the Y-axis as the incident direction of the light ray, in Construct a regular array of rays on a plane. The plane light ray coordinates can be expressed as:

[0104] .

[0105] where is the index coordinate of the X-Z plane grid center point, satisfying . That is, taking as the light ray interval, it ensures that the grid size required when filling the subsequent A15 lattice is consistent, is a sufficiently small negative value, which ensures that the light ray starting point is located outside the model.

[0106] For each light ray constructed, we use a ray-surface intersection detection method accelerated by an octree structure. The method uses a recursive strategy to traverse the octree structure: first, perform a ray-Bounding Box intersection test at each internal node to quickly eliminate spatial regions that do not intersect with the light ray; then recursively access the intersected child nodes until the leaf nodes are reached. In the leaf nodes, perform an accurate ray-triangle intersection detection on the stored surface triangles, record the parameter values , intersection coordinates, and corresponding triangle index of the effective intersection points.

[0107] where the Slab Method is used in the ray-Bounding Box intersection test, which regards the axis-aligned bounding box as the intersection of three pairs of parallel slabs, and determines whether the light ray intersects with the bounding box by calculating the entry and exit parameters of the light ray with each pair of slabs. The ray-triangle intersection detection uses the Möller-Trumbore algorithm.

[0108] Through ray tracing, all intersection points of the light ray with the model surface during propagation can be obtained. Since the model is a closed surface, the number of intersection points must be even. Using the coordinate transformation formula:

[0109] .

[0110] where is the intersection point coordinate, is the grid origin. The grid index corresponding to the intersection point can be calculated.

[0111] After pairing adjacent intersection points to form a filling line segment, the line segment endpoints need to be grid-aligned to ensure the accuracy of the filling position. For example, Figure 7As shown in (1) and (2), according to the relative position of the intersection point and the center of the grid, there are the following processing cases: for the starting point of the line segment, when the intersection point is located before the center of the grid, the starting point is adjusted to the current grid; when the intersection point is located after the center of the grid, the starting point is adjusted to the next grid. For the termination point of the line segment, when the intersection point is located before the center of the grid, the termination point is adjusted to the previous grid; when the intersection point is located after the center of the grid, the termination point is adjusted to the current grid.

[0112] After the end point adjustment, an abnormal situation may occur that the starting point index is greater than the termination point index, such as Figure 7 As shown in (3) and (4). This phenomenon usually occurs in the narrow area of the model, and the characteristic size is smaller than the grid resolution, which causes the filling grid to not be completely inside the model. For such degenerate line segments, they are marked as invalid and discarded, and the corresponding area will be processed by the Delaunay method. Finally, all valid line segments are sorted in ascending order according to the starting point index value to ensure the orderliness of the subsequent filling process.

[0113] S4. Hierarchical grid generation.

[0114] The present application proposes a hierarchical grid generation method based on A15 lattice, which realizes hierarchical grid generation in the internal filling area through A15 lattice variant design and hierarchical region merging strategy, effectively controls the grid size while maintaining the grid quality.

[0115] A15 lattice variant:

[0116] Due to the geometric complexity and irregularity of the A15 lattice structure, it is not possible to realize the direct connection between grids of different scales through simple scaling transformation operation. To solve this problem, the concept of bridge connection lattice is proposed, that is, a transitional bridge A15 lattice variant is introduced between the grids of adjacent levels to realize the smooth transition and topological connection between A15 lattices of different scales.

[0117] In the hierarchical grid generation process, each bridge A15 lattice variant needs to be connected with A15 lattices in six adjacent directions (back, front, right, left, down, up). Since there may be A15 lattices of the same level or the next level in the adjacent positions, that is, there are two connection states in each direction, there are different adjacent configurations. In order to realize effective connection under different configurations, 64 kinds of A15 lattice variants are designed as bridge structures. For example, Figure 9As shown, by grid refinement and vertex position adjustment on the original A15 lattice connection interface, variants of different adjacent conditions are generated. At the same time, in order to facilitate identification and application, 6-bit binary coding is used to identify these variants, and the coding order is arranged in the order of back, front, right, left, down and up. In the actual grid filling process, the present application automatically determines and selects the corresponding variant type by detecting the lattice distribution in six directions of the current position.

[0118] Boundary identification and level merging:

[0119] In order to generate hierarchical tetrahedral grid based on A15 lattice, the level merging strategy is adopted to coarsen the grid layer by layer. Due to the size difference between grids in different levels, direct merging will lead to topological discontinuity, so the boundary grid of the current level needs to be preserved as a bridge structure to ensure the continuity and geometric consistency between low-level and high-level grids. This strategy includes two links of boundary grid identification and bottom-up level merging.

[0120] (1) Boundary grid identification strategy:

[0121] As shown in Figure 10 , based on the characteristics of the ray filling method, a boundary grid identification strategy is proposed. First, the end points of the filling line segment are directly classified into the boundary set to ensure the integrity of the boundary. For the middle part of the line segment, it is detected whether there is an adjacent filling line segment in four directions (right, left, down, up), if any direction lacks an adjacent line segment, the grid corresponding to the middle part is classified into the boundary set; otherwise, the grid is detected.

[0122] As shown in Figure 11 , in the grid-by-grid detection, the present application evaluates the neighborhood integrity of each grid in six directions: the grid with missing direction is classified into the boundary set, and the grid completely surrounded by the neighborhood is classified into the internal set. This classification method based on neighborhood integrity ensures the accuracy of boundary identification.

[0123] (2) Bottom-up layer-by-layer merging strategy:

[0124] In order to realize efficient merging, the internal grid is subdivided into potential merging grid and unused grid. The potential merging grid needs to satisfy the coordinate constraint condition , which ensures that the merged grid is consistent with the directionality of the ray filling, and can continue to be combined into a line segment form, providing a basis for recursive merging. For each potential merging position, search the 2x2x2 grid block (including the position itself) around it, verify whether the remaining 7 grid units exist completely. If the condition is met, it is merged into a large grid, and the connected large grids at the same ray position are represented and stored in the form of line segments.

[0125] After the merging is completed, the application re-executes the boundary identification and potential merging point detection on the newly generated level, forming a recursive processing flow until one of the following termination conditions is met: there are no mergable mesh blocks or the mesh density of the current level meets the preset requirements. Figure 11 A schematic diagram of the bottom-up layer-by-layer merging strategy is shown.

[0126] To verify the effectiveness of the application, surface triangles are used as input, and the application method (named TetMesh) is compared with mainstream tetrahedral mesh generation software (Gmsh, TetGen). The comparison verification includes mesh quality evaluation and generation efficiency analysis.

[0127] The application is implemented in C++ and enabled with optimized compilation. All results shown by the application are obtained on a desktop computer equipped with a 12th Inteli5-12400F 4.4GHz processor and 32GB DDR4 memory to ensure consistency of hardware settings and thus fair comparison.

[0128] In terms of tetrahedral mesh generation quality:

[0129] Compared with mainstream mesh generation software, the application has a significant advantage in mesh quality. Two key parameters are used for mesh quality evaluation: tetrahedral aspect ratio (ratio of longest side to shortest side) and dihedral angle. See Table 1 for specific quality comparison data, and the generated tetrahedral mesh is as shown in Figures 12 to 15 .

[0130] Table 1. Comparison of tetrahedral mesh quality

[0131] .

[0132] In Table 1, is the number of tetrahedral meshes, is the smallest dihedral angle in the mesh, is the largest dihedral angle in the mesh, is the average value of all dihedral angles, is the percentage of dihedral angles less than , is the percentage of dihedral angles within the quality range, is the percentage of dihedral angles greater than , is the average aspect ratio of all tetrahedrons, is the average aspect ratio of all tetrahedrons.

[0133] The experimental results show that under the condition of generating a similar number of tetrahedral meshes, the TetMesh of the application is significantly better than the comparison software in terms of mesh quality. In the quality dihedral angle range of In terms of distribution, the average proportion of TetMesh is 71.72%, which is about 2 times of TetGen (36.31%) and 2.3 times of Gmsh (30.54%), and the grid quality is obviously improved.

[0134] In terms of aspect ratio, TetMesh not only has the smallest average aspect ratio, but also has an average proportion of high-quality tetrahedrons (1.0-2.0) of more than 74%, which is significantly better than TetGen's 28.37% and Gmsh's 13.59%, effectively improving the quality of element shape. In terms of key extreme angle control, TetMesh also performs well, with the minimum dihedral angle always maintaining above 2°, compared with TetGen's 0.364° and Gmsh's 0.777°, which are close to singular values. This effectively avoids the generation of severely degenerated tetrahedrons, improving the stability of numerical calculation.

[0135] In addition, TetMesh with layer-by-layer merging strategy can significantly reduce the grid size while maintaining grid quality, with an average reduction of about 35% (Box: 26%, Sphere: 32%, Fandisk: 44%, Bunny: 27%), achieving a good balance between quality and efficiency. These results fully demonstrate that the hybrid tetrahedral mesh generation method based on ray tracing and A15 lattice is superior to traditional methods in key quality indicators, and can generate high-quality tetrahedral meshes more suitable for finite element analysis and engineering simulation.

[0136] In terms of tetrahedral mesh generation speed:

[0137] To objectively evaluate the grid generation efficiency of TetMesh, we generated 8 groups of tetrahedral meshes of different sizes for each test model and recorded the corresponding generation time. Due to the algorithm implementation differences between different programs, we generated as many tetrahedral meshes as possible to ensure fair time comparison analysis. Figures 12 to 17 The time-consuming situation of each model under different sizes is shown, as well as the time ratio of other software relative to TetMesh.

[0138] The experimental results show that TetMesh based on hybrid strategy performs well in grid generation efficiency, with overall performance comparable to TetGen, and gradually showing advantages as the grid size increases. At the same time, on all test models, the average generation speed of TetMesh is about 4.65 times that of Gmsh.

[0139] Specifically, compared with TetGen: on simple geometric models, the efficiency of the cubic model is improved when the tetrahedral size is ; the Sphere model is improved Efficiency improvement at tetrahedral scale The advantage of TetMesh is more significant on complex geometry models: Fandisk model (a model object whose surface is composed of triangles) achieves 4.29 times and 4.63 times average speed improvement on the simple cube and Stanford bunny model respectively. Efficiency improvement at tetrahedral scale , the Stanford bunny model achieves 4.29 times and 4.63 times average speed improvement on the simple cube and Stanford bunny model respectively. Efficiency improvement at tetrahedral scale .

[0140] Compared with Gmsh, the efficiency advantage of TetMesh is extremely prominent. The simple model cube and sphere achieve 4.48 times and 4.22 times average speed improvement respectively, and the complex model Fandisk and Stanford bunny achieve 5.29 times and 4.63 times average speed improvement respectively. In all test scenarios, the maximum efficiency improvement can reach 6.85 times, fully embodying the efficiency advantage of the hybrid method.

[0141] These results show that TetMesh is more suitable for large-scale mesh generation tasks of complex models while ensuring high-quality mesh generation. Combined with the quality evaluation results, TetMesh achieves a good balance between mesh quality and generation efficiency.

[0142] Through the coordination of the above four steps, the present application realizes high-quality and high-efficiency tetrahedral mesh generation. The method not only maintains the advantages of mesh filling method in calculation efficiency and mesh quality, but also effectively solves the problems of surface restoration and sharp feature preservation of existing methods, and significantly reduces the calculation complexity and storage overhead of region identification through ray tracing technology, providing a complete technical solution for high-quality mesh discretization of complex three-dimensional models.

Claims

1. A hybrid tetrahedral mesh generation method based on ray tracing and A15 lattice, characterized in that, Comprising the following steps: S1. Space partitioning and intersection detection: cube grid partitioning is performed on the input object's geometric model space, and the intersection relationship between surface triangles and space cube grids is determined; The detected intersection information is stored in the form of {grid coordinates, triangle index}, and sorted in lexicographical order of grid coordinates, facilitating fast query and access in subsequent processing stages; S2. Region division and filled object: based on the hybrid strategy, the space is divided into regions, the internal region is filled with A15 lattice, and the boundary region is restored to the surface and the sharp feature is maintained by Delaunay method; S3. Octree construction and ray filling method: construct octree acceleration structure, use ray tracing method to quickly identify internal filling area, and generate filling line segment to determine the position of A15 lattice filling; The ray filling method is to quickly identify the internal filling area by constructing a regular light array, and the steps are as follows: With Y axis as the light incident direction, in A regular light array is constructed in the plane, and the light starting point coordinates are represented as: ; wherein is the grid step size, is the index coordinate of the center point of the X-Z plane grid, satisfying , i.e., taking as the light interval, to ensure consistency with the required grid size when filling the subsequent A15 lattice. For each light beam constructed, an octree accelerated ray tracing algorithm is used to detect surface intersection, which uses a recursive strategy to traverse the octree structure, and the steps are as follows: First, perform ray-Bounding Box intersection test in internal node, and use flat layer intersection method to quickly eliminate non-intersecting space regions; Then, in the leaf node, the Moller-Trumbore algorithm is used to perform accurate ray-triangle intersection detection on the stored surface triangles to obtain intersection parameters and coordinates; since the model surface is closed, the number of intersections between each ray and the surface must be even, and the coordinate conversion formula The grid index corresponding to the intersection point is calculated, wherein The grid index corresponding to the intersection point is calculated, wherein The grid index corresponding to the intersection point is calculated, wherein Finally, after pairing the adjacent intersection points to form the filling line segment, the grid alignment processing is performed on the line segment endpoints, and the specific processing strategy is as follows: according to the relative position of the intersection point and the grid center, there are the following processing conditions: for the starting endpoint of the line segment, when the intersection point is located before the grid center, adjust the starting endpoint to the current grid; when the intersection point is located after the grid center, adjust the starting endpoint to the next grid; for the terminal endpoint of the line segment, when the intersection point is located before the grid center, adjust the terminal endpoint to the previous grid; when the intersection point is located after the grid center, adjust the terminal endpoint to the current grid; If the starting endpoint index is greater than the terminal endpoint index, mark it as invalid and hand it over to the Delaunay method for processing; S4. Hierarchical grid generation.

2. The method of claim 1, wherein the method is based on a hybrid tetrahedral mesh generation method combining ray tracing and A15 lattice. In step S1, the space is partitioned into a cube grid, and the specific steps are as follows: After reading the input target model, according to the preset grid step The three-dimensional space where the model is located is uniformly divided into cubic grids, and the space division process needs to meet two key constraints: boundary buffer setting and quadruple alignment requirement; Calculate the basic grid span in each coordinate direction according to the model bounding box: ; wherein is the length of the model in the coordinate direction, is the grid step size; The number of grids is according to the formula: ; wherein is a four-fold multiple alignment compensation term, which is given by the formula: 。 3. The method of claim 1, wherein the method is based on a hybrid tetrahedral mesh generation method combining ray tracing and A15 lattice. The intersection detection step in step S1 is as follows: Step one, traverse each triangle in the surface triangular mesh, for the three vertices of the triangle , construct its axis-aligned bounding box, and expand a grid step length in each direction to ensure that the bounding box can cover all grid cells that may intersect with the triangle; ​ Step two, determine the range of grid cells that need to be detected based on the extended bounding box, convert the bounding box coordinates to grid indexes, and calculate the range of grid indexes involved: ; ; wherein, and are the minimum and maximum coordinates of the extended bounding box, respectively, is the grid origin, is the edge length of the grid cells; Step three, detect each grid cell in the determined range one by one: for a cell with grid coordinates (x, y, z), construct its corresponding bounding box, and use a two-level detection strategy: The first level is the fast intersection detection between bounding boxes, including the judgment of intersection, inclusion and other geometric relationships; The second level uses the Separating Axis Theorem to accurately detect the intersection between triangles and bounding boxes for grid cells that pass the first level screening; Step four, store the detected intersection information in the form of {grid coordinates, triangle index}, and sort it in lexicographical order of grid coordinates, facilitating fast query and access in subsequent processing stages.

4. The method of claim 1, wherein the method is based on a hybrid tetrahedral mesh generation method combining ray tracing and A15 lattice. Step S2 adopts a hybrid strategy for region division: the space is divided into boundary regions and internal filling regions according to the relative position relationship between the grid cells and the geometric boundaries of the model; for the internal filling regions, A15 lattice is directly used for regular filling, and the specific implementation is: the 27 vertex coordinates of the lattice are translated according to the target grid position, and then 46 tetrahedral cells are filled into the corresponding position, and the coordination number of all edges of the A15 lattice is 5 or 6, so that the filled tetrahedral cells can be closest to the ideal regular tetrahedral configuration; for the boundary region, Delaunay method is used to realize the tetrahedral grid generation in the region.

5. The method of claim 1, wherein the method is based on a hybrid tetrahedral mesh generation method combining ray tracing and A15 lattice. Step S3 adopts octree data structure to perform spatial hierarchical division on the triangular mesh of the model surface; the octree construction adopts a non-uniform subdivision strategy, and is adaptively divided according to the spatial distribution density of the geometric model, and the steps are as follows: Firstly, the axis-aligned bounding box of the root node is calculated by traversing all the triangular vertices; Then, the current node is uniformly divided into 8 sub-cubes by recursive spatial segmentation, and the triangles are distributed to the corresponding sub-nodes according to the barycentric position; Finally, the bounding box of the leaf node is recalculated to ensure that it completely contains all the triangles in the node, and the bounding boxes of all parent nodes are recursively updated to maintain the geometric consistency of the entire octree structure; the recursive segmentation is terminated when the number of triangular meshes in the node is less than a preset value or the maximum depth is reached.

6. The method of claim 1, wherein the method is based on a hybrid tetrahedral mesh generation method combining ray tracing and A15 lattice. The transitional bridging A15 lattice variant is introduced between adjacent levels of grids to realize the smooth transition and topological connection between different scale A15 lattices, and a hierarchical merging strategy is adopted to coarsen the grid layer by layer based on the A15 lattice, that is, the boundary grid of the current level needs to be preserved as a bridging structure during the merging process to ensure the continuity and geometric consistency between the low-level and high-level grids. This strategy includes two links of boundary grid identification and bottom-up level merging.

7. The method of claim 1, wherein the method is based on a hybrid tetrahedral mesh generation method combining ray tracing and A15 lattice. Based on the characteristics of the ray filling method, a boundary grid identification strategy is proposed, which is as follows: The end points of the filling line segment are directly classified into the boundary set to ensure the integrity of the boundary; for the middle part of the line segment, it is detected whether there is an adjacent filling line segment in four directions, if there is a lack of adjacent line segment in any direction, the grid corresponding to the middle part is classified into the boundary set; otherwise, the grid is detected one by one; In the grid-by-grid detection, the neighborhood integrity of each grid in six directions is evaluated: the grid with missing direction is classified into the boundary set, and the grid completely surrounded by the neighborhood is classified into the internal set.

8. The method of claim 1, wherein the method is based on a hybrid tetrahedral mesh generation method combining ray tracing and A15 lattice. The merging step is: the internal grid is divided into potential merging grid and unused grid, the potential merging grid needs to meet the coordinate constraint condition to ensure that the directionality of the merged grid remains consistent with the ray filling, and can continue to be combined into a line segment form to provide a basis for recursive merging; for each potential merging position, search the grid block around it, including itself, verify whether the remaining 7 grid units are completely present; if the condition is met, merge them into a large grid, and represent and store the connected large grids at the same ray position in the form of a line segment; After the merging is completed, boundary identification and potential merging point detection are re-executed on the newly generated level, forming a recursive processing flow until one of the following termination conditions is met: there is no mergable grid block or the grid density of the current level meets the preset requirements.

Citation Information

Patent Citations

  • FDTD mesh generation method and system based on ray tracing

    CN115935673A

  • STL model Monte Carlo particle transport simulation method based on octree neighborhood search

    CN118313014A