Efficient and high-fidelity mesh generation method for implicit volumes
By constructing an octree and using Tikhonov regularization to solve the quadratic error function, combined with MarchingCubes lookup tables, the problems of sharp feature fidelity and manifoldness when converting implicit volumes to triangular meshes are solved, achieving efficient and stable mesh generation.
Patent Information
- Application Number
- CN202611426092.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-11-17
AI Technical Summary
Existing techniques struggle to maintain high fidelity of sharp features when converting implicit volumes to triangular meshes, and cannot generate seamless manifold meshes, resulting in insufficient computational efficiency and numerical robustness.
By dividing the implicit volume space into uniform background mesh cells and retaining boundary mesh cells, an octree is constructed and adaptively subdivided. The dual vertex positions are determined by solving the quadratic error function using Hermite data and Tikhonov regularization. The isosurfaces are extracted by combining MarchingCubes lookup tables, and the triangular patches are merged and duplicate vertices are eliminated.
It achieves high-fidelity capture of sharp features, generates manifold triangular meshes, improves computational efficiency and ensures numerical stability, reduces the number of meshes, and is suitable for large-scale parallel computing.
Smart Images

Figure CN123118970A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional digital model processing technology, and in particular to a method for generating high-fidelity meshes for implicit volumes. Background Technology
[0002] Implicit volumes are 3D solid models defined by implicit functions, whose geometric boundaries are determined by the isosurfaces of scalar field functions. Compared to parametric surfaces and polygonal mesh representations, implicit volumes can efficiently determine the relationship between any point in space and the model, naturally represent models with complex topological structures, and have inherent advantages in smooth model blending and deformation animation. Therefore, they are widely used in computer graphics, computer-aided design, scientific visualization, and computational fluid dynamics. However, in engineering practice and downstream geometric processing, when the designed implicit volume needs to be output to subsequent processing flows, such as 3D printing slicing and support generation, finite element mesh generation and numerical simulation, geometric model exchange and sharing, and data interfacing with CAD / CAE software systems, an explicit polygonal mesh representation is required. The existing algorithms, software toolchains, and data exchange standards relied upon by these downstream processing steps are all based on explicit meshes as the basic data structure and cannot directly process implicit function representations. Therefore, efficiently and faithfully converting implicit volumes into high-quality explicit polygonal meshes constitutes a core technical problem that urgently needs to be solved in this field.
[0003] Currently, existing technologies for converting implicit volumes into triangular mesh digital models mainly include the MarchingCubes algorithm and the DualContouring algorithm. The MarchingCubes algorithm superimposes a uniform, regular mesh onto the spatial region containing the implicit volume, dividing the space into several cubic voxels of the same size. For each cubic voxel, the intersection with isosurfaces is determined based on the sign of the implicit function values at its eight vertices, and the corresponding triangulation pattern is determined by looking up a table. Then, triangular faces are generated within each intersecting voxel through linear interpolation, and finally, all triangular faces are merged to obtain an approximation of the implicit volume's triangular mesh. However, the MarchingCubes algorithm, with its linear interpolation and fixed triangulation template mechanism, cannot accurately reproduce geometric discontinuities such as edges and corners, leading to over-smoothing of sharp features and producing step-like artifacts. In severe cases, even holes and fragments appear, resulting in severely insufficient feature fidelity. Furthermore, the MarchingCubes algorithm requires a uniform mesh as input and cannot be directly applied to adaptive data structures such as octrees. It also produces cracks and geometric discontinuities at different resolutions of adjacent voxels, failing to generate seamless manifold meshes.
[0004] The DualContouring algorithm is an isosurface extraction method based on Hermite data. This algorithm constructs a quadratic error function using the precise intersection points of the isosurfaces with the mesh edges and the surface normal information at those points. It then determines the optimal vertex position inside the cube by unconstrained minimization of this quadratic error function. The vertices inside the cube are then connected in a dual manner to form a triangular mesh. Because vertices can be freely placed inside the cube rather than restricted to its edges, the DualContouring algorithm effectively captures and reproduces sharp features in implicit volumes. However, by unconstrainedly minimizing the quadratic error function, the DualContouring algorithm allows vertices to be freely placed in 3D space without imposing any restrictions on vertex positions. When the unconstrained optimal solution falls outside the voxels, the dual elements degenerate into non-convex polyhedra, leading to intersecting triangular faces and inconsistent normals during the triangulation stage. This ultimately generates a mesh containing non-manifold edges and non-manifold vertices, posing a serious obstacle to subsequent downstream processing stages such as rendering, normal calculation, finite element analysis tetrahedral mesh generation, CAD manufacturing, and 3D printing. During the quadratic error function solution stage, the DualContouring algorithm needs to handle a system of linear equations. When the Hermite data is of poor quality or numerically ill-conditioned, the matrix may become ill-conditioned, pushing the unconstrained optimal solution to a position extremely far from the true isosurface, resulting in severely distorted triangles or even algorithm collapse. In other words, the DualContouring algorithm is highly sensitive to the quality of the input data and lacks robustness under low-quality or noisy conditions.
[0005] In summary, existing digital model generation technologies struggle to simultaneously meet engineering application requirements across multiple dimensions, including feature fidelity, manifold guarantee, computational efficiency, data dependency, and numerical robustness. Summary of the Invention
[0006] This invention provides an efficient and high-fidelity mesh generation method for implicit volumes, which solves the problem that sharp features cannot be captured with high fidelity during the implicit volume conversion process in the prior art.
[0007] On one hand, the present invention provides an efficient and high-fidelity mesh generation method for implicit volumes, comprising: The spatial region where the implicit volume is located is divided into multiple uniform background grid units. The implicit function values at the sampling points in each background grid unit are obtained. Based on the sign of the implicit function values at the sampling points, the boundary grid units are retained. An octree is constructed with the boundary grid cell as the root node. A local quadratic error function is constructed within the current node. The octree is adaptively subdivided to the leaf node voxel based on the error value of the local quadratic error function. Obtain signed distance field data and gradient data at the voxel vertices of each leaf node to construct Hermite data; Based on the Hermite data, the position of the dual vertex within each leaf node voxel is determined by solving the quadratic error function through Tikhonov regularization with voxel internal constraints. Based on the global octree spatial adjacency relationship, a dual mesh is constructed from the dual vertices within each leaf node voxel; The MarchingCubes lookup table, which is used for disambiguation processing, extracts isosurfaces from the dual mesh, merges triangular patches, eliminates duplicate vertices, and outputs a manifold triangular mesh.
[0008] Optionally, the step of discarding internal and external mesh cells and retaining boundary mesh cells based on the implicit function value sign at the sampling point includes: If the implicit function values of the sampling points within the background grid cell are all positive, then it is determined to be an external grid cell; If the implicit function values of the sampling points within the background grid cell are all negative, then it is determined to be an internal grid cell; If the implicit function values of the sampling points within the background grid cell are both positive and negative, then it is determined to be a boundary grid cell.
[0009] Optionally, the step of constructing a local quadratic error function within the current node, and adaptively subdividing the octree to leaf node voxels based on the error value of the local quadratic error function, includes: Multiple sampling points are generated within the current node. The implicit function value and gradient value at each sampling point are calculated, and the isosurface normal estimate at each sampling point is determined based on the gradient value. Using the position of the dual vertex to be optimized within the current node as an unknown, a local quadratic error function is constructed. The local quadratic error function is used to measure the sum of squared distances from the position of the dual vertex to the tangent plane at each sampling point. If the minimum value of the local quadratic error function is less than the preset error threshold, then the current node is designated as a leaf node. Otherwise, the current node is divided into eight child nodes along each of the three coordinate axes, and the process of generating multiple sampling points within the current node is returned until the minimum value of the local quadratic error function of all leaf nodes is less than the preset error threshold or the preset maximum subdivision depth is reached.
[0010] Optionally, obtaining the signed distance field data and gradient data at the voxel vertices of each leaf node includes: When the implicit volume is expressed by an analytical implicit function, the function value of the analytical implicit function at the vertex is used as signed distance field data, and the analytical implicit function is analytically differentiated or the gradient data is obtained by the finite difference method. When the implicit volume is represented by a polygonal mesh, the nearest point from the vertex to the polygonal mesh is queried through the bounding volume hierarchy. The shortest signed distance is calculated based on the nearest point, and the unit direction vector from the nearest point to the vertex is multiplied by the sign factor to obtain the gradient data.
[0011] Optionally, constructing Hermite data includes: For each edge of a leaf node voxel, if the signed distance field data at the two endpoints of the edge have opposite signs, then the intersection of the isosurface with the edge and the normal at the intersection are determined by linear interpolation to form Hermite data.
[0012] Optionally, the step of solving the quadratic error function based on the Hermite data using Tikhonov regularization with voxel interior constraints includes: Construct the coefficient matrix and right-hand vector corresponding to the quadratic error function based on the Hermite data; Based on the coefficient matrix and the right-hand vector, a regularization equation is constructed and solved to obtain the regularization solution. The first few terms of the regularization are used as the positions of the dual vertices, and the positions of the dual vertices are constrained to the voxel of the current leaf node.
[0013] Optionally, the construction of a dual mesh based on the dual vertices within each leaf node voxel, according to the global octree spatial adjacency relation, includes: Based on the spatial adjacency relationship of the global octree, the adjacency relationship between voxels of each leaf node is determined; Based on the adjacency relationship, the dual vertices within adjacent leaf node voxels are connected to form dual units; When adjacent voxels have different subdivision levels, the leaf node with the lower subdivision level is passed as a parameter to the adjacent voxel with the higher subdivision level.
[0014] Optionally, the MarchingCubes lookup table based on disambiguation processing performs isosurface extraction on the dual mesh, merges triangular patches, and eliminates duplicate vertices, including: For each dual unit, construct an index code based on the implicit function value symbols of its eight vertices; Use the index code to look up the MarchingCubes lookup table for face ambiguity resolution and obtain the corresponding edge identifier and triangulation mode; Based on the edge markings, interpolation yields the intersection point and normal of the isosurface and the edge. According to the triangulation pattern, the interpolated isopleths are connected to form triangular patches; Merge all triangular patches generated by dual units; Remove duplicate vertices from the triangular facets.
[0015] Optionally, the isosurface normal estimate is expressed as: ; in, For the first Isosurface normal estimation for each sampling point; For implicit functions at sampling points The gradient; It is an implicit function; For the first The location of each sampling point; Let be the magnitude of the gradient vector.
[0016] Optionally, the local quadratic error function can be expressed as: ; in, It is a local quadratic error function; This is the current octree node; The position of the dual vertex to be optimized; N is the number of sampling points; This is the index for the sampling points.
[0017] This invention provides an efficient and high-fidelity mesh generation method for implicit volumes. By eliminating internal and external mesh elements and retaining only boundary mesh elements, the number of meshes involved in the calculation is reduced, thus improving computational efficiency. By constructing an octree with boundary mesh elements as root nodes and adaptively subdividing to leaf voxels based on the error value of the local quadratic error function, the optimal allocation of computational resources and geometric accuracy is achieved. By solving the quadratic error function with voxel internal constraints using Tikhonov regularization, the positions of dual vertices are determined, ensuring that dual vertices are constrained within voxels while capturing sharp features, thus guaranteeing numerical stability and the convexity of dual elements. By constructing dual meshes based on the spatial adjacency relationship of the global octree, dual elements at the boundaries of adjacent background meshes share consistent vertices and edges, achieving seamless splicing of isosurfaces. By extracting isosurfaces and merging and deduplicating them based on the MarchingCubes lookup table to eliminate surface ambiguity, a manifold triangular mesh is output, achieving high-fidelity capture of sharp features and significant reduction in mesh size. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1This is a flowchart illustrating the efficient and high-fidelity mesh generation method for implicit bodies provided in this embodiment of the invention. Figure 2 The cubes were extracted using the Marching Cubes algorithm; Figure 3 This is a schematic diagram of octree subdivision when extracting isosurfaces of a cube, provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of the dual grid constructed when extracting the isosurface of a cube according to an embodiment of the present invention; Figure 5 This is an octree and dual grid cross-sectional diagram of the extraction of cubic isosurfaces provided in an embodiment of the present invention; Figure 6 The cubic isosurface is extracted by the method proposed in the embodiments of the present invention; Figure 7 It is the classic Bunny model extracted by the proposed method provided in the embodiments of the present invention; Figure 8 The mechanical parts are extracted by the method proposed in the embodiments of the present invention; Figure 9 It is a mechanical part after Gyroid lattice filling extracted by the method proposed in the embodiments of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0021] Figure 1 This is a flowchart illustrating the efficient and high-fidelity mesh generation method for implicit bodies provided in this embodiment of the invention.
[0022] See Figure 1 An efficient and high-fidelity mesh generation method for implicit volumes may include the following steps 101 to 106.
[0023] Step 101: Divide the spatial region where the implicit volume is located into multiple uniform background grid cells, obtain the implicit function values at the sampling points in each background grid cell, and retain the boundary grid cells according to the sign of the implicit function values at the sampling points.
[0024] Step 102: Construct an octree with the boundary grid cell as the root node, construct a local quadratic error function in the current node, and adaptively subdivide the octree to the leaf node voxels according to the error value of the local quadratic error function.
[0025] Specifically, a schematic diagram of the octree adaptive subdivision for cube isosurface extraction can be found in [reference needed]. Figure 3 The blue outline in the image illustrates the hierarchical distribution of the spatial grid. It's clear that the grid density varies with the complexity of the regional features: the grid is dense and fine in key areas such as the cube's edges and central axis, while it remains sparse and coarse in flat or interior regions. This well-balanced structure intuitively demonstrates the algorithm's mechanism for automatically adjusting accuracy based on geometric features. It aims to achieve high-fidelity capture of complex geometric details with minimal computational resources, representing a crucial spatial partitioning step in the efficient generation of digital models from implicit volumes.
[0026] Step 103: Obtain the signed distance field data and gradient data at the voxel vertices of each leaf node, and construct Hermite data.
[0027] Step 104: Based on Hermite data, solve the quadratic error function using Tikhonov regularization with voxel internal constraints to determine the position of the dual vertex within each leaf node voxel.
[0028] Step 105: Based on the global octree spatial adjacency relationship, construct a dual mesh from the dual vertices within each leaf node voxel.
[0029] Figure 4 This diagram illustrates the dual grid constructed during the extraction of isosurfaces from a cube, as provided in this embodiment of the invention. The diagram visually demonstrates the dual grid topology constructed by recursively tracing the hierarchical subdivision relationships between octree voxels and connecting the dual vertices within each voxel. As can be seen from the diagram, because adjacent voxels in the octree can be at different subdivision levels, the constructed dual grid exhibits unstructured characteristics—the vertex degree and unit shape of each dual unit vary with the differences in voxel adjacency relationships, rather than being uniformly and regularly arranged. This dual grid, as the input grid for isosurface extraction, provides a topological connection skeleton for subsequent Marching Cubes lookup triangulation, laying the topological foundation for the transformation from discrete voxel representation to continuous geometric surfaces.
[0030] Step 106: Extract isosurfaces from the dual mesh using the MarchingCubes lookup table for unambiguous surface processing, merge triangular patches and eliminate duplicate vertices, and output the manifold triangular mesh.
[0031] In this embodiment, by retaining boundary grid cells, the number of grids involved in the computation is reduced, thus improving computational efficiency. By constructing an octree with boundary grid cells as root nodes and adaptively subdividing it to leaf voxels based on the error value of the local quadratic error function, the optimal configuration of computational resources and geometric accuracy is achieved. The dual vertex positions are determined by solving the quadratic error function with voxel internal constraints, ensuring that the dual vertices are constrained within the voxels while capturing sharp features, thus guaranteeing numerical stability and the convexity of the dual cells. By constructing the dual grid based on the spatial adjacency relationship of the global octree, the dual cells at the boundaries of adjacent background grids share consistent vertices and edges, achieving seamless splicing of isosurfaces. The isosurfaces are extracted from the dual grid using a Marching Cubes lookup table based on surface ambiguity elimination and merged to remove duplicates, resulting in a manifold triangular mesh. This significantly simplifies the triangular patches while ensuring high-fidelity capture of sharp features.
[0032] In one embodiment of this specification, based on the sign of the implicit function value at the sampling point, internal and external mesh cells are eliminated, and boundary mesh cells are retained. This may include: If the implicit function values of the sampling points within the background grid cell are all positive, then it is determined to be an external grid cell; If the implicit function values of the sampling points within the background grid cell are all negative, then it is determined to be an internal grid cell; If the implicit function values of the sampling points within the background grid cell are both positive and negative, then it is determined to be a boundary grid cell.
[0033] In this embodiment, it can be understood that uniform background mesh cells are those with the same size. The signed distance function of the implicit volume can be obtained in advance. The external and internal mesh cell culling strategy adopted in this embodiment can significantly reduce the number of meshes involved in fine calculations without sacrificing geometric accuracy. Since each background mesh cell is independent and undependent, each boundary mesh cell can be allocated to multiple parallel computing nodes or threads for independent processing, achieving large-scale parallel acceleration of the isosurface extraction process.
[0034] In one embodiment of this specification, a local quadratic error function is constructed within the current node, and the octree is adaptively subdivided to leaf node voxels based on the error value of the local quadratic error function. This may include: Step 1: Generate multiple sampling points within the current node, calculate the implicit function value and gradient value at each sampling point, and determine the isosurface normal estimate at each sampling point based on the gradient value; The isosurface normal estimate is expressed as formula (1): (1); in, For the first Isosurface normal estimation for each sampling point; For implicit functions at sampling points The gradient; It is an implicit function; For the first The location of each sampling point; Let be the magnitude of the gradient vector; Step 2: Using the position of the dual vertex to be optimized within the current node as the unknown, construct a local quadratic error function. The local quadratic error function is used to measure the sum of squared distances from the position of the dual vertex to the tangent plane at each sampling point. The local quadratic error function is expressed as formula (2): (2); in, It is a local quadratic error function; This is the current octree node; The position of the dual vertex to be optimized; N is the number of sampling points; For sampling point index; Step 3: If the minimum value of the local quadratic error function is less than the preset error threshold, then the current node is designated as a leaf node. Step 4: Otherwise, divide the current node into eight child nodes along each of the three coordinate axes, and recursively execute the above steps to generate multiple sampling points within the current node until the minimum value of the local quadratic error function of all leaf nodes is less than the preset error threshold or reaches the preset maximum subdivision depth.
[0035] In this embodiment, the subdivision depth is determined based on the QEF error criterion using random sampling. This QEF metric measures candidate vertices. The sum of squared distances to the tangent plane at each sampling point. If the isosurface within the current voxel is approximately planar, there exists a vertex that results in a smaller QEF value; if the isosurface is severely curved or has sharp features, the QEF value is larger. Subdivision is stopped in flat areas of the isosurface to control the mesh size, while automatic refinement is performed in areas with sharp features or drastic curvature changes to ensure geometric accuracy, achieving an optimal allocation of computational resources and geometric accuracy. An implicit function value is a scalar value calculated by substituting the coordinates of any point in space into the implicit function. Its sign indicates whether the point is inside or outside the implicit volume, and the absolute value (when it is a signed distance function) represents the shortest distance from the point to the surface of the implicit volume. Implicit functions are tools for defining 3D shapes using mathematical expressions. For any point in space, the function value is calculated to determine whether the point is inside, outside, or on the surface of the shape.
[0036] In one embodiment of this specification, obtaining the signed distance field data and gradient data at the voxel vertices of each leaf node may include: When the implicit volume is expressed by an analytical implicit function, the function value of the analytical implicit function at the vertex is used as the signed distance field data, and the analytical implicit function is analytically differentiated or the gradient data is obtained through the finite difference method. When the implicit volume is represented by a polygonal mesh, the nearest point from the vertex to the polygonal mesh is queried through the bounding volume hierarchy. The shortest signed distance is calculated based on the nearest point, and the unit direction vector from the nearest point to the vertex is multiplied by the sign factor to obtain the gradient data.
[0037] In this embodiment, for implicit volumes expressed by analytical implicit functions, their SDF data can be directly obtained by calculating the implicit function values; their gradient data is obtained by analytically differentiating the implicit function. For implicit functions that are black-box functions, non-smooth functions, or where analytical differentiation is too complex, the finite difference method is used. For implicit volumes expressed in polygonal mesh formats, such as STL and OBJ, the closed entity enclosed by the mesh implicitly determines its interior, exterior, and surface. In this case, the SDF data is defined as the shortest signed distance from any point in space to the surface of the mesh; the SDF data is obtained through a variant of the BVH (Bounding Volume Hierarchies) data structure; its gradient data is defined as the unit direction vector from the nearest point in the mesh to the query point, multiplied by a sign factor. The sign factor is determined through an internal / external property check.
[0038] In this embodiment, the invention can simultaneously support two input forms: analytical implicit functions and polygonal meshes. Regardless of the input form, it can uniformly obtain the signed distance field data and gradient data at the voxel vertices of each leaf node, ensuring the compatibility and consistency of subsequent Hermite data construction, quadratic error function solution, and isosurface extraction with different input sources.
[0039] In one embodiment of this specification, constructing Hermite data may include: For each edge of a leaf node voxel, if the signed distance field data at the two endpoints of the edge have opposite signs, the intersection point of the isosurface and the edge is obtained by linear interpolation of the signed distance field data at the two endpoints, and the normal at the intersection point is obtained by linear interpolation of the gradient data at the two endpoints. The intersection point and the normal constitute Hermite data.
[0040] Hermite data is represented by formula (3): (3); in, For the first The location of each Hermite data point; For the first Normal of each Hermite data point; The edge numbering that satisfies the intersection condition when traversing the twelve edges of a voxel; This represents the total number of Hermite data points.
[0041] In this embodiment, the present invention determines whether the signs of the signed distance field data at the two endpoints are opposite for each edge of each leaf node voxel. When the signs are opposite, linear interpolation is used to determine the intersection of the isosurface and the edge and the normal at the intersection to form Hermite data, thus ensuring the data integrity and sharp feature capture accuracy of the dual vertex localization process.
[0042] In one embodiment of this specification, solving the quadratic error function based on Hermite data using Tikhonov regularization with voxel interior constraints may include: Step 1: Construct the coefficient matrix corresponding to the quadratic error function based on the Hermite data. and the right-hand vector Where R is the set of real numbers; The coefficient matrix is represented by formula (4): (4); in, For the first The normal vector at each Hermite data point x Quantity; For the first The y-component of the normal vector at each Hermite data point; For the first The z-component of the normal vector at each Hermite data point; The vector on the right is represented by formula (5): (5); The quadratic error function QEF is equivalent to a least squares problem, expressed as formula (6): (6); The corresponding normal equation is formula (7): (7); remember , .
[0043] Step 2: Construct and solve the regularized equation based on the coefficient matrix and the right-hand vector to obtain the regularized solution; When the Hermite data within a voxel are coplanar, collinear, or the data is insufficient, the matrix is singular, and the QEF solution is not unique. This invention introduces a Tikhonov regularization term to construct a regularized least squares problem, expressed as formula (8): (8); The corresponding regularized equation is expressed as formula (9): (9); Step 3: Take the first few terms of the regularization as the positions of the dual vertices and constrain the positions of the dual vertices to be within the voxel of the current leaf node.
[0044] In the above formula, Let be the unknown vector to be solved; The QEF is in least squares form; For regularization parameters; This is a Tikhonov regularization term; It is the identity matrix; Let be the coefficient matrix of the normal equation; Given a 4-dimensional column vector, the corresponding normal equation is... The right-hand item.
[0045] In this embodiment, wherein For regularization parameters, It is an identity matrix. Because... With the addition, Strictly positive definite, for any All solutions have a unique solution. Solving the above equations using Cholesky decomposition or SVD decomposition yields a canonical solution. The first three terms are the three-dimensional coordinates of the dual vertices. The smaller the value, the higher the QEF fitting accuracy. The dual vertices can move freely to the vicinity of edges and corners to capture sharp features, but when the matrix is ill-conditioned, the solution is prone to divergence, leading to patch disorder. The larger the value, the more stable the solution, and the dual vertices tend to converge towards the voxel center, but the ability to capture sharp features decreases. This invention employs an adaptive adjustment strategy based on the matrix condition number and the octree depth, using a smaller value when the matrix is well-state. It captures sharp features to the maximum extent; it automatically increases when the matrix is ill-conditioned or singular. Prioritizing numerical stability of the solution. Through this adaptive mechanism, the present invention achieves a dynamic optimal balance between feature fidelity and mesh manifold, without requiring manual adjustment by the user.
[0046] In this embodiment, the dual vertices can be constrained within the voxel while capturing sharp features such as edges and corners, avoiding distorted triangles or algorithm collapse caused by solution divergence due to matrix ill-conditioning, thus ensuring the numerical stability of the solution and the convexity of the dual unit.
[0047] In one embodiment of this specification, a dual mesh is constructed from the dual vertices within each leaf node voxel based on the global octree spatial adjacency relationship, which may include: Based on the spatial adjacency relationship of the global octree, the adjacency relationship between voxels of each leaf node is determined; Based on the adjacency relationship, connect the dual vertices within adjacent leaf node voxels to form dual units; When adjacent voxels have different subdivision levels, the leaf node with the lower subdivision level is passed as a parameter to the adjacent voxel with the higher subdivision level to achieve matching between voxels with different subdivision levels.
[0048] In this embodiment, a four-layer recursive traversal algorithm is used to construct the dual mesh: the node processing function recursively traverses each node in the octree; the face processing function processes adjacent voxel pairs sharing the same face; the edge processing function processes voxel groups sharing the same edge; and the vertex processing function extracts all leaf node voxels sharing the same octree vertex, using the dual vertices of these voxels as corner points to form a dual unit. During the recursion, if adjacent voxels at different subdivision levels are encountered, logical voxel matching and completion are achieved by repeatedly passing leaf nodes as parameters. This recursive mechanism ensures that the construction of the dual unit is strictly based on the global spatial adjacency relationship of the octree, naturally transcending the artificial boundaries of the initial background mesh. The leaf node dual vertices generated by adjacent background meshes are included in the same dual unit at the intersection because they share the same octree vertex, thus ensuring vertex consistency and edge correspondence of the dual mesh at the boundary. Seamless splicing of isosurfaces is achieved.
[0049] In one embodiment of this specification, isosurface extraction of the dual mesh based on the MarchingCubes lookup table for disambiguation processing, merging triangular patches and eliminating duplicate vertices may include: For each dual unit, construct an index code based on the implicit function value symbols of its eight vertices; Use the index code to look up the MarchingCubes lookup table for face ambiguity resolution and obtain the corresponding edge identifier and triangulation mode; Based on the edge markings, interpolation yields the location of the intersection point between the isosurface and the edge, as well as the normal direction. Based on the triangulation pattern, the interpolated isopleths are connected to form triangular patches; Merge all triangular patches generated by dual units; Remove duplicate vertices from the triangular facets.
[0050] In this embodiment, an 8-bit binary index code is constructed based on the implicit function value symbols of the eight vertices of the dual element. This index code is used to search the Marching Cubes lookup table, which has undergone face ambiguity resolution. This lookup table is an extension table of 23 basic configurations generated solely using rotational symmetry, eliminating the reflection symmetry transformations found in traditional schemes. This configuration ensures that adjacent dual elements employ a completely consistent triangulation pattern on shared surfaces, fundamentally eliminating the ambiguity in triangulation caused by symmetry transformations.
[0051] Figure 5 This is a cross-sectional view of the octree and dual grid used for extracting cubic isosurfaces according to an embodiment of the present invention. Blue represents the subdivided octree mesh, with high-density recursive subdivision at the four corner points, while the central region maintains a coarse-grained structure. Red represents the constructed dual grid.
[0052] The invention will now be described through some specific examples.
[0053] Example 1: This implementation example illustrates the advantages of the proposed solution by extracting a cube expressed by an analytic implicit function. First, a cube centered at the origin with a side length of... The analytic implicit function of a cube is expressed by formula (10): (10); In this example, take To verify the effectiveness of the technical solution of this invention, isosurface extraction was performed on the same implicit volume using both the traditional MarchingCubes algorithm and the method proposed in this invention. For example... Figure 2 As shown, Figure 2 The right side of the image is an enlarged view of the M4 region on the left. In the result of extracting the implicit isosurfaces of the cube using the traditional Marching Cubes algorithm, the sharp features at the cube's edges are excessively smoothed, failing to effectively capture the original geometric edges. Furthermore, the mesh is densely distributed, with a total of 14,695 triangular faces. (Refer to...) Figure 6 , Figure 6 The right side of the diagram is an enlarged view of region M5 on the left side. Using the method proposed in this invention to extract the implicit isosurfaces of the same cube, sharp features at the cube's edges are accurately captured. Triangular facets are concentrated in the sharp feature regions, while their distribution in the planar regions is sparse. A total of 5907 triangular facets are present, a 60% reduction compared to the traditional Marching Cubes algorithm. Comparative results show that the method proposed in this invention, compared to the traditional Marching Cubes algorithm, achieves significant mesh simplification while maintaining high fidelity in sharp feature extraction, demonstrating the superiority of this invention.
[0054] Example 2: To further verify the wide applicability and engineering practical value of the method proposed in this invention, the classic Stanford Bunny model and a mechanical part model containing circular and linear edges were used as input objects. These were imported into STL file format, converted to implicit volume representation, and then isosurfaces were extracted using the method of this invention. The extraction results are shown below. Figure 7 and Figure 8 As shown.
[0055] Figure 7 The isosurface extraction results of the Stanford Bunny model are shown. Figure 7 'a' represents the entity rendering effect. Figure 7 b represents a wireframe mesh structure. (From...) Figure 7 As can be seen, the method of the present invention fully reproduces all the geometric details of the input STL model surface, including the curved transition region and local concave and convex features, and the triangular facets are adaptively sparsely distributed. In the region where the curvature changes gently, the coarse-grained mesh is maintained, and in the region where the geometric details are rich, the mesh is automatically refined, which fully demonstrates the ability of the method of the present invention to process models with different topological complexities.
[0056] Figure 8 The results of isosurface extraction of the mechanical part model are shown. Figure 8 a represents the original mechanical part model; Figure 8 b represents the isosurface extraction result of the mechanical part model. This model contains typical sharp geometric features such as circular and linear edges, a common configuration in engineering CAD models. Figure 8 As can be seen, the method of the present invention accurately captures all circular and linear edge features, with sharp edges clearly and completely without excessive smoothing; at the same time, triangular facets adaptively concentrate in sharp feature areas, while maintaining a sparse distribution in planes and smooth curved surfaces, achieving accurate reproduction of the geometric features of the input STL file, while also achieving significant simplification of triangular facets.
[0057] The experimental results above demonstrate that the method of this invention exhibits good applicability and robustness to input models of different types and complexities. Compared to traditional uniform mesh methods, this invention significantly reduces the mesh size while maintaining geometric accuracy, providing a high-quality, lightweight mesh data foundation for subsequent downstream geometric processing steps such as Boolean operations on implicit bodies, lattice filling, finite element mesh generation, and 3D printing slice preprocessing, thus showing promising engineering application prospects.
[0058] Example 3: To further demonstrate the practical application value of the method proposed in the field of lattice filling, in order to... Figure 8The mechanical part model shown is used as the matrix. After converting it into an implicit volume representation, the matrix is filled with a Gyroid lattice in a TriplyPeriodic Minimal Surface (TPMS). The isosurface mesh after filling is then extracted using the method of this invention. The analytical implicit function of the Gyroid lattice is expressed as formula (11): (11); Among them, parameters The volume fraction of the lattice is controlled. In this embodiment, the period size of a single Gyroid lattice is set to 2 mm, and the matrix is filled with these lattice units arranged periodically. The isosurface extraction results after filling are as follows: Figure 9 As shown. By Figure 9 As can be seen, the method proposed in this invention completely extracts the composite isosurface of the matrix contour and the internal Gyroid lattice structure. The matrix boundary is clear and complete, and the internal lattice structure is continuous, smooth, and without breaks. Statistically, the number of triangular facets in the lattice-filled model is reduced by about 60% compared to the traditional uniform mesh method, and the mesh quality is good with no obvious distorted elements.
[0059] The above results show that the method proposed in this invention can effectively support complex lattice filling operations based on implicit volume representation, and can completely reproduce the multi-scale geometric features of the matrix and lattice structure composite. The generated lightweight mesh directly meets the input requirements of downstream engineering links such as finite element analysis, additive manufacturing path planning and 3D printing slice preprocessing, providing reliable technical support for lattice structure design and analysis for additive manufacturing.
[0060] Compared with the prior art, the present invention has the following significant advantages: (i) Significantly improved computational efficiency, supporting large-scale parallel computing: This invention removes 60%–80% or more of invalid internal and external grid cells through coarse screening of the background grid. Combined with a completely independent parallel computing architecture for each grid cell, octree construction, adaptive subdivision, Hermite data acquisition, and QEF solving can all be executed in large-scale parallelism on multi-core CPUs or GPUs. Compared to the serial exhaustive traversal scheme of Marching Cubes, computational efficiency is significantly improved, making it particularly suitable for large-scale implicit volume models.
[0061] (II) Coordinated optimization of mesh lightweighting and geometric accuracy: This invention employs an octree-based adaptive subdivision mechanism based on the QEF error criterion, which allows for dense sampling only in regions with high isosurface complexity and maintains coarse-grained sampling in flat regions, thus achieving automatic optimization of voxel resolution. Compared to uniform mesh schemes, this reduces the number of triangular faces by more than 60% while achieving the same geometric accuracy.
[0062] (III) The unity of high-fidelity capture of sharp features and manifold guarantee: This invention employs a feature isolation strategy based on Tikhonov regularization in QEF, allowing dual vertices to freely move to the vicinity of edges and corners when the matrix is well-formed. This effectively overcomes the defect of over-smoothing sharp features in schemes that fix dual vertices at voxel centers. Simultaneously, voxel spatial constraints and convex dual elements ensure that triangulation does not generate self-intersections or non-manifold edges. This invention is the first to achieve both the feature capture capability of Dual Contouring and the deterministic guarantee of manifold meshes within the same framework, and the automatic adjustment of regularization parameters dynamically balances the priorities of these two aspects based on the quality of the input data.
[0063] (iv) A mechanism to ensure seamless boundary splicing, with no triangle mismatch: This invention employs a two-layer decoupled architecture—"background mesh for parallel computation of dual vertex coordinates and global dual mesh for unified topological connections"—along with a four-layer recursive traversal algorithm and 23 types of rotationally symmetric Marching Cubes lookup tables. This ensures that dual cells at the boundaries of adjacent background meshes share identical vertices and edges and adopt consistent triangulation decisions, fundamentally eliminating boundary mismatches, cracks, and T-shaped connections, and achieving a natural, seamless splicing of isosurfaces.
[0064] (v) It exhibits strong numerical robustness and adapts well to low-quality input data: This invention utilizes Tikhonov regularization (adaptive) The dual mechanism of adjustment and voxel spatial constraint forces the QEF solution to be confined within the voxel. Even if Hermite data has errors, coplanar normals, or singular / ill-conditioned matrices, the algorithm can still output a stable solution located within the voxel. This effectively overcomes the shortcomings of the Dual Contouring algorithm, which is highly sensitive to the quality of input data and produces distorted meshes or even algorithm collapses under noisy or ill-conditioned conditions.
[0065] (vi) Good input format compatibility and wide engineering applicability: This invention supports both analytical implicit functions and polygonal meshes as inputs, and can be widely used in multiple engineering fields such as computer graphics, CAD model mesh re-division, 3D printing slicing preprocessing, and finite element analysis preprocessing, with good prospects for industrial application.
[0066] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. An implicit volume refers to a three-dimensional solid model defined by implicit functions.
[0067] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0068] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for high-fidelity mesh generation of implicit bodies, characterized in that, include: The spatial region where the implicit volume is located is divided into multiple uniform background grid units. The implicit function values at the sampling points in each background grid unit are obtained. Based on the sign of the implicit function values at the sampling points, the boundary grid units are retained. An octree is constructed with the boundary grid cell as the root node. A local quadratic error function is constructed within the current node. The octree is adaptively subdivided to the leaf node voxel based on the error value of the local quadratic error function. Obtain signed distance field data and gradient data at the voxel vertices of each leaf node to construct Hermite data; Based on the Hermite data, the position of the dual vertex within each leaf node voxel is determined by solving the quadratic error function through Tikhonov regularization with voxel internal constraints. Based on the global octree spatial adjacency relationship, a dual mesh is constructed from the dual vertices within each leaf node voxel; The MarchingCubes lookup table, which is used for disambiguation processing, extracts isosurfaces from the dual mesh, merges triangular patches, eliminates duplicate vertices, and outputs a manifold triangular mesh.
2. The method of claim 1, wherein, The step of eliminating internal and external mesh cells and retaining boundary mesh cells based on the implicit function value sign at the sampling point includes: If the implicit function values of the sampling points within the background grid cell are all positive, then it is determined to be an external grid cell; If the implicit function values of the sampling points within the background grid cell are all negative, then it is determined to be an internal grid cell; If the implicit function values of the sampling points within the background grid cell are both positive and negative, then it is determined to be a boundary grid cell.
3. The method according to claim 1, characterized in that, The step of constructing a local quadratic error function within the current node, and adaptively subdividing the octree to leaf node voxels based on the error value of the local quadratic error function, includes: Multiple sampling points are generated within the current node. The implicit function value and gradient value at each sampling point are calculated, and the isosurface normal estimate at each sampling point is determined based on the gradient value. Using the position of the dual vertex to be optimized within the current node as an unknown, a local quadratic error function is constructed. The local quadratic error function is used to measure the sum of squared distances from the position of the dual vertex to the tangent plane at each sampling point. If the minimum value of the local quadratic error function is less than the preset error threshold, then the current node is designated as a leaf node. Otherwise, the current node is divided into eight child nodes along each of the three coordinate axes, and the process of generating multiple sampling points within the current node is returned until the minimum value of the local quadratic error function of all leaf nodes is less than the preset error threshold or the preset maximum subdivision depth is reached.
4. The method according to claim 3, characterized in that, The acquisition of signed distance field data and gradient data at the voxel vertices of each leaf node includes: When the implicit volume is expressed by an analytical implicit function, the function value of the analytical implicit function at the vertex is used as signed distance field data, and the analytical implicit function is analytically differentiated or the gradient data is obtained by the finite difference method. When the implicit volume is represented by a polygonal mesh, the nearest point from the vertex to the polygonal mesh is queried through the bounding volume hierarchy. The shortest signed distance is calculated based on the nearest point, and the unit direction vector from the nearest point to the vertex is multiplied by the sign factor to obtain the gradient data.
5. The method according to claim 1, characterized in that, The construction of Hermite data includes: For each edge of a leaf node voxel, if the signed distance field data at the two endpoints of the edge have opposite signs, then the intersection of the isosurface with the edge and the normal at the intersection are determined by linear interpolation to form Hermite data.
6. The method according to claim 1, characterized in that, The process of solving the quadratic error function based on the Hermite data using Tikhonov regularization with voxel interior constraints includes: Construct the coefficient matrix and right-hand vector corresponding to the quadratic error function based on the Hermite data; Based on the coefficient matrix and the right-hand vector, a regularization equation is constructed and solved to obtain the regularization solution. The first few terms of the regularization are used as the positions of the dual vertices, and the positions of the dual vertices are constrained to the voxel of the current leaf node.
7. The method according to claim 1, characterized in that, The construction of a dual mesh based on the dual vertices within each leaf node voxel, using the global octree spatial adjacency relation, includes: Based on the spatial adjacency relationship of the global octree, the adjacency relationship between voxels of each leaf node is determined; Based on the adjacency relationship, the dual vertices within adjacent leaf node voxels are connected to form dual units; When adjacent voxels have different subdivision levels, the leaf node with the lower subdivision level is passed as a parameter to the adjacent voxel with the higher subdivision level.
8. The method according to claim 7, characterized in that, The MarchingCubes lookup table based on disambiguation processing extracts isosurfaces from the dual mesh, merges triangular patches, and eliminates duplicate vertices, including: For each dual unit, construct an index code based on the implicit function value symbols of its eight vertices; Use the index code to search the MarchingCubes lookup table for face ambiguity resolution and obtain the corresponding edge identifier and triangulation mode; Based on the edge markings, interpolation yields the intersection point and normal of the isosurface and the edge. According to the triangulation pattern, the interpolated isopleths are connected to form triangular patches; Merge all triangular patches generated by dual elements; Remove duplicate vertices from the triangular facets.
9. The method according to claim 3, characterized in that, The isosurface normal estimate is expressed as: ; in, For the first Isosurface normal estimation for each sampling point; For implicit functions at sampling points The gradient; It is an implicit function; For the first The location of each sampling point; Let be the magnitude of the gradient vector.
10. The method according to claim 9, characterized in that, The local quadratic error function is expressed as: ; in, It is a local quadratic error function; This is the current octree node; The position of the dual vertex to be optimized; N is the number of sampling points; This is the index for the sampling points.
