Tetrahedral mesh generation method for three-dimensional image
By extracting boundary structure information from a three-dimensional background Cartesian mesh and using the constraint Delaunay algorithm, the problem of complex boundary processing in three-dimensional images is solved, and a tetrahedral mesh that meets the constraints is quickly generated, which improves the reliability and applicability of the method.
Patent Information
- Application Number
- CN202510069299.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-16
AI Technical Summary
It is difficult to quickly generate tetrahedral mesh of three-dimensional images that meet constraints, especially in the fields of geological engineering, geoscience and medicine, and it is difficult to process complex boundaries of three-dimensional images.
By defining a three-dimensional background Cartesian mesh, the boundary structure information is extracted, and the tetrahedral mesh is generated using the constraint Delaune algorithm to realize the intersection detection of the Vino polygon and the boundary constraints, ensuring that the generated mesh meets the constraint conditions.
The method of quickly generating tetrahedral mesh in three-dimensional images is realized, which avoids the difficulty of complex boundary processing, improves the reliability and applicability of generating mesh, and reduces labor time costs.
Smart Images

Figure CN119888130A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the fields of computational geometry, computer graphics, mathematical geology, numerical simulation and calculation, and in particular to a tetrahedral mesh generation method for three-dimensional images. Background Art
[0002] Delaunay tetrahedral mesh is a general term for tetrahedral meshes generated using the Delaunay criterion. The Delaunay criterion is also known as the empty circle / empty sphere criterion, which means that in the mesh, the circumscribed circle / circumscribed sphere of any triangle or tetrahedron does not contain any other vertices in the mesh. Since the Delaunay criterion is associated with the mathematical Voronoi diagram, the use of the Delaunay algorithm to generate tetrahedral meshes has a strict mathematical definition and a complete theoretical basis. The generated tetrahedral mesh has a series of provable excellent properties such as the empty circumscribed circle / sphere property and the minimum angle maximum property. Therefore, it has a wide range of applications in finite element analysis, scientific computing visualization and other fields.
[0003] The existing constrained Delaunay tetrahedral mesh generation method uses the Delaunay criterion to first generate the Delaunay tetrahedral mesh of the constraint point set, and all the constraint points are used as the vertices of the tetrahedral mesh. Then the constraint curve is processed so that it is approximated by a set of line segments composed of some edges of the tetrahedral mesh. Finally, the constraint surface is processed so that it is approximated by a set of facets composed of some triangular side surfaces in the tetrahedral mesh, and the vertices of these triangular side surfaces are all on the constraint surface. In this process, by detecting the intersection between the Voronoi polygon and the constraint conditions, the topological closed sphere property of the approximate unit is maintained by adding points to refine and maintain to ensure that the set of these approximate constraint curves and surfaces is topologically consistent with the constraint curves and surfaces. This method can improve and refine the mesh by systematically adding internal vertices, and has high reliability and stability. The quality, scale and transition of the final mesh can be effectively controlled and theoretically guaranteed.
[0004] Numerical simulation is an important research method in the fields of geological engineering, earth science and medicine. In these fields, three-dimensional images of rock cores or organs can usually be obtained, so how to quickly generate tetrahedral mesh models from three-dimensional images has become an important research direction. Summary of the invention
[0005] To solve the above technical problems, the present invention provides a tetrahedral mesh generation method for three-dimensional images. First, the three-dimensional image is processed, and the boundary surface, boundary line and boundary point that can be used as constraints are obtained by defining a three-dimensional background Cartesian grid. On this basis, the intersection detection method of the Voronoi polygon and the boundary constraint is implemented. Then, the existing constrained Delaunay tetrahedral mesh generation method is used to generate a tetrahedral mesh under the above constraint conditions.
[0006] To achieve the above object, the technical solution adopted by the present invention is:
[0007] A tetrahedral mesh generation method for three-dimensional images, which is applied in the fields of geological exploration, earth science research, numerical simulation, and medical imaging, comprises the following steps:
[0008] Step A, reading the three-dimensional image stored in the external file into the memory;
[0009] Step B, processing the three-dimensional image to obtain boundary structure information in the image volume;
[0010] Step C, based on the extracted boundary structure information, determine the number of boundary faces, the number of boundary lines, the number and coordinates of boundary points, and the adjacency topological relationship between the boundary faces, boundary lines and boundary points, and realize the intersection of the Voronoi polygon and the extracted boundary;
[0011] Step D: Generate a tetrahedral mesh of the three-dimensional image using the constrained Delaunay algorithm.
[0012] Furthermore, the step A specifically includes: the three-dimensional image stored in the external file is a binary image after image processing, with voxels as units, each voxel is a cubic unit, and the attribute value inside each voxel can be defined as 0 or 1.
[0013] Furthermore, any two voxels with different values are adjacent to each other through a common rectangular face.
[0014] Furthermore, the binary distribution connected regions of the voxels are marked to obtain boundary structure information for tetrahedral mesh generation.
[0015] The step B specifically includes: according to the three-dimensional image volume inputted in step A, a three-dimensional background Cartesian grid is initialized, the grid is 1 unit length, the number of grid units in the X, Y, and Z directions is the same as the resolution of the three-dimensional image, and the attribute of each unit in the three-dimensional Cartesian grid is set to the value of the voxel block in the three-dimensional image at the same position, and the background grid is used to record the boundary surface, boundary line, boundary point and corresponding connected domain mark; mark the three-dimensional connected domain, the two-dimensional connected domain and the one-dimensional connected domain respectively dimension by dimension; mark multiple three-dimensional connected regions according to the adjacent units with a value of 1 in the three-dimensional background grid, corresponding to multiple connected bodies in the three-dimensional image volume, and extract the two-dimensional rectangular surface on the boundary of each three-dimensional connected body inside the background grid, that is, the two-dimensional rectangular surface with inconsistent attribute values on both sides between the background grid units as the internal two-dimensional connected region. At the same time, the side connected regions of each three-dimensional connected body on the six end faces of the background grid are marked as boundary two-dimensional connected regions. The common grid unit edges between the boundary two-dimensional connected regions and the internal connected regions are marked as one-dimensional connected regions according to the connectivity relationship. Through all the connected domain mark combinations, the internal and boundary connected areas constitute the boundary surface, the one-dimensional connected area constitutes the boundary line, and the common mesh vertices between two one-dimensional connected areas constitute the boundary points. The boundary structure information is obtained, including the marked boundary surface, boundary line and boundary point and their topological relationship, and the obtained boundary structure information is used as a constraint condition for generating a tetrahedral network.
[0016] The step C specifically includes: based on the extracted boundary structure information, the number of boundary lines and boundary surfaces is determined according to the connectivity information of the boundary surfaces and boundary lines on the background Cartesian grid, and the inclusion topological relationship between the boundary surface and the boundary line and the boundary point, and the inclusion topological relationship between the boundary line and the boundary point is recorded, and the geometric position of the boundary surface is defined by the two-dimensional rectangular surface set of the background Cartesian grid units constituting the boundary surface, and the geometric position of the boundary line is defined by the Cartesian grid unit edges constituting the boundary line. At the same time, the geometric position of the boundary point is determined according to the Cartesian grid vertices constituting the boundary point. On the basis of marking and defining the boundary surface, boundary line and boundary point in the above-mentioned background Cartesian grid, a corresponding Voronoi polygon, i.e., a boundary edge of a convex polygon plane on the geometry and a rectangle in the boundary surface in the Cartesian grid can be realized, as well as a method for detecting the intersection of the Voronoi polygon plane and the boundary edge in the Cartesian grid.
[0017] Step D specifically includes: using the boundary point geometry obtained in step C as the initial constraint point set, generating a Delaunay tetrahedron mesh of the constraint point set, and then detecting the existence of boundary line constraints and boundary surface constraints in the Delaunay tetrahedron mesh of the boundary point set in turn according to the constrained Delaunay tetrahedron mesh generation method, wherein the intersection detection result of each Voronoi polygon and the boundary surface or boundary line in the existence detection process is realized according to the boundary intersection detection method described in step C, completing the constrained Delaunay tetrahedron mesh generation method to ensure that the set of these approximate constraint curves and surfaces is consistent with the topology of the constraint boundary curves and surfaces extracted in step B, and outputting the tetrahedron mesh of the three-dimensional image.
[0018] The principle of the present invention is as follows: firstly, the boundary of the three-dimensional image is subjected to boundary extraction processing, and the information required by the algorithm such as the processed boundary surface, line, point and their topological relationship is recorded on the background grid, and the geometric positions of the boundary surface, boundary line and boundary point extracted from the image body are defined by using the units of the background Cartesian grid. Then, the tetrahedral grid of the point set is generated by using the mature constrained Delaunay tetrahedral grid generation technology, and the intersection detection result of the boundary surface or boundary line and the Voronoi polygon required in the constrained Delaunay tetrahedral grid generation process is realized by using the geometric information defined by the background Cartesian grid, and finally the tetrahedral grid of the three-dimensional image is generated.
[0019] The beneficial effects of the present invention are:
[0020] The method of the present invention is easy to implement, and uses a mature tetrahedral mesh generation method to directly generate tetrahedral meshes from three-dimensional images, avoiding the problem that it is difficult to directly extract complex boundaries from a three-dimensional image volume and the method cannot be directly used to constrain the Delaunay tetrahedral mesh generation method. The method has good reliability, is more applicable to complex three-dimensional image problems, and effectively reduces labor time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flow chart of a tetrahedral mesh generation method for three-dimensional images according to the present invention;
[0022] Figure 2 This is an example of binarization of a porous medium three-dimensional image;
[0023] Figure 3 This is an example of the boundary structure of a three-dimensional image of a porous medium;
[0024] Figure 4 Tetrahedral mesh diagram of the three-dimensional image of porous media. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.
[0026] A mesh is a combination of simple geometric units that discretize complex geometric structures in space. In most mesh applications, the mesh needs to be consistent with the boundary of the target area. It is also hoped that the constraints in the target area, such as points, lines, and surfaces, can exist in the final mesh. Keeping the boundary consistent or the constraints existing in the mesh means that the point element in the boundary or constraint is the vertex of a certain mesh in the mesh, the line element can be composed of the edges of one or more mesh units, and the surface element can be composed of the sides of multiple mesh units.
[0027] like Figure 1 As shown, the method of establishing a tetrahedral mesh generation method for a three-dimensional image in the method of the present invention includes three stages. The first is to construct a background three-dimensional Cartesian mesh for a binary three-dimensional image with a clear structure, and extract boundary information that meets the requirements of the tetrahedral mesh generation algorithm; the second is to achieve intersection with the Voronoi element based on the boundary geometry definition in the extracted Cartesian mesh; the third is to generate a tetrahedral mesh of the three-dimensional image. Figure 2 An example of binarization of three-dimensional images of porous media is given.
[0028] Specifically, a method for generating a tetrahedral mesh of a three-dimensional image includes the following steps:
[0029] First, in step 200, a binary three-dimensional image is inputted, with voxels as units. Each voxel is a cubic unit, and the value of each voxel is 0 or 1. Any two voxels with different values are adjacent to each other through a common rectangular surface.
[0030] Step 210 is to extract and process the boundary conditions of the three-dimensional image, by initializing a three-dimensional background Cartesian grid, the number of grid cells in the X, Y, and Z directions is the same as the resolution of the three-dimensional image, and the attribute of each cell in the three-dimensional Cartesian grid is set to the value of the voxel block in the three-dimensional image at the same position, and the three-dimensional connected domain, the two-dimensional connected domain and the one-dimensional connected domain are marked dimension by dimension respectively; the processed three-dimensional image can obtain the required number of boundary surfaces, the number of boundary lines, the number and coordinates of boundary points, and the topological relationship between boundary surfaces, boundary lines and points. The boundary surface includes the boundary surface in the voxel inside the Cartesian grid and the boundary surface on the end surface; the boundary line includes the common line of the internal boundary surface and the end surface boundary surface. Since the three-dimensional image is in pixels, there is no isolated boundary line in the boundary; the boundary point includes the common point of the boundary line and the six vertices outside the three-dimensional Cartesian grid.
[0031] First, initialize a background grid and an AUMap to record boundary surfaces, lines, points, and corresponding connected domain marks. Then mark all connected domains. The specific steps are as follows:
[0032] (1) Call the StatisticsJunctionDomain3D() algorithm to mark all three-dimensional connected domains;
[0033] (2) Call the GetConstraintSurfaces() algorithm to obtain the internal boundary surface and record the corresponding connected domain marker combination;
[0034] (3) Call the StatisticsJunctionDomain2D() algorithm to mark the two-dimensional connected domain and record the boundary surface on the end surface;
[0035] (4) Call the GetConstraintLines() algorithm to obtain the boundary lines within the end surface and record the corresponding connected domain marker combination and the boundary surface to which it belongs;
[0036] (5) Call the StaticsJunctionDomain1D() algorithm to mark the one-dimensional connected domain, obtain the boundary lines on the external boundary edges of the three-dimensional Cartesian grid and record the corresponding connected domain mark combination and the corresponding boundary surface;
[0037] (6) Call the GetConstraintPoints() algorithm to obtain the number and coordinates of boundary points and record the boundary lines and boundary surfaces to which they belong.
[0038] In this way, a boundary structure in a processed three-dimensional image is obtained. Figure 3 As shown, examples of structures between boundary surfaces, boundary lines and boundary points of three-dimensional images are given.
[0039] Step 220 is to realize boundary intersection. When calculating the intersection between the Voronoi polygon and the boundary line, since the boundary line only exists on the six end faces outside the three-dimensional Cartesian grid, the Voronoi polygon completely inside the three-dimensional Cartesian grid cannot intersect with the boundary line, and this feature can be used to screen the Voronoi polygon. For the Voronoi polygon that passes the screening, it can be first determined whether it intersects with the background grid unit, then it can be determined whether it intersects with the edge of the grid unit, and finally the boundary line and boundary surface to which the intersection belongs are determined according to the edge where the intersection point is located. The intersection set of the Voronoi polygon and the boundary line is finally output, including the coordinates of the intersection point and the information such as the boundary line and boundary surface to which the intersection point belongs.
[0040] When calculating the intersection between the Voronoi line segment and the boundary surface, since the boundary surface is composed of the side surfaces of the grid units, and the side surfaces of the grid units must belong to a plane perpendicular to the coordinate axis, the plane where the side surfaces of the grid units perpendicular to the coordinate axis are located can be traversed in the X, Y, and Z directions respectively to calculate the intersection of the Voronoi line segment and the plane. If the side surface of the grid unit where the intersection is located belongs to the boundary surface, it means that an intersection of the boundary surface and the Voronoi line segment is obtained. The range of the traversed plane can be determined according to the starting and ending coordinates of the Voronoi line segment. Finally, the intersection set of the Voronoi line segment and the boundary surface is output.
[0041] Step 230 is to construct a tetrahedral mesh. Figure 4 As shown, an example of tetrahedral mesh generation for a three-dimensional image is given. The method of this step is to first generate a point set constrained Delaunay tetrahedral mesh of the boundary points according to the boundary structure processed by step 210, and then detect the existence of the constrained boundary lines and the constrained boundary surfaces in the tetrahedral mesh one by one according to the process of the constrained Delaunay tetrahedral mesh generation algorithm. In this process, it is necessary to continuously perform the intersection calculation between the Voronoi polygon and the boundary line, and the edge of the Voronoi polygon and the boundary surface through step 220, and judge the intersection of the dual Voronoi surface of each Delaunay tetrahedron edge and each constrained boundary line. If the topological closed ball property is satisfied, the edge is the topological approximation edge of the constrained curve segment; if the topological closed ball property is not satisfied, then add points for refinement. Then, the intersection of the dual Voronoi edge of the triangular side surface of each Delaunay tetrahedron and each constrained boundary surface is judged through step 220. If the topological closed ball property is satisfied, the triangular side surface is the approximation sub-surface of the constrained surface patch; if the topological closed ball property is not satisfied, then add points for refinement. Then, the intersection of the dual Voronoi edge of the triangular side surface of each Delaunay tetrahedron and each constrained boundary surface is judged through step 220. If the topological closed ball property is satisfied, the triangular side surface is the approximation sub-surface of the constrained surface patch; if the topological closed ball property is not satisfied, then add points for refinement. After the above process is completed, the corresponding topological approximation line segment set and topological approximation surface set of each constraint boundary line and constraint boundary surface in the tetrahedral mesh are finally extracted, and the tetrahedral mesh under the constraint of the three-dimensional image volume is output.
[0042] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A tetrahedral mesh generation method for a three-dimensional image, characterized in that: The method comprises the following steps: Step A, reading the three-dimensional image stored in the external file into the memory; Step B, processing the three-dimensional image to obtain boundary structure information in the three-dimensional image volume; Step C, based on the extracted boundary structure information, determine the number of boundary surfaces, the number of boundary lines, the number and coordinates of boundary points, and the adjacency topological relationship between the boundary surfaces, boundary lines and boundary points, and realize the intersection of the Voronoi polygon and the extracted boundary structure information; Step D: Generate a tetrahedral mesh of the three-dimensional image using a constrained Delaunay algorithm.
2. A tetrahedral mesh generation method for three-dimensional images according to claim 1, characterized in that: The step A comprises: the three-dimensional image stored in the external file is a binary image after image processing, with voxels as units, each voxel is a cubic unit, and the voxel value is 0 or 1.
3. A tetrahedral mesh generation method for three-dimensional images according to claim 2, characterized in that: Any two voxels of different values are adjacent through a common rectangular face.
4. The method for generating a tetrahedral mesh for a three-dimensional image according to claim 1, characterized in that: The step B includes marking the binary distribution connected areas of the voxels to obtain boundary structure information for tetrahedral mesh generation, and the boundary structure information is used as a constraint condition for generating the tetrahedral network.
5. A tetrahedral mesh generation method for three-dimensional images according to claim 4, characterized in that: The step B specifically comprises: Initialize a three-dimensional background Cartesian grid to record boundary surfaces, boundary lines, boundary points and corresponding connected domain labels; Mark the three-dimensional connected domain, the two-dimensional connected domain and the one-dimensional connected domain respectively; Through all the connected domain label combinations, the internal and boundary connected domains constitute the boundary surface, the one-dimensional connected domains constitute the boundary line, and the common mesh vertices between two one-dimensional connected domains constitute the boundary points; The marked boundary faces, boundary lines and boundary points and their topological relationships are used to generate constraint conditions for the tetrahedral network.
6. A tetrahedral mesh generation method for three-dimensional images according to claim 5, characterized in that: The number of grid cells of the three-dimensional background Cartesian grid in the X, Y, and Z directions is the same as the resolution of the input three-dimensional image, and the attribute of each cell in the three-dimensional Cartesian grid is set to the value of the voxel in the three-dimensional image at the corresponding position.
7. A tetrahedral mesh generation method for three-dimensional images according to claim 5, characterized in that: The marking of the three-dimensional connected domain, the two-dimensional connected domain and the one-dimensional connected domain dimension by dimension includes marking a plurality of three-dimensional connected domains corresponding to a plurality of connected bodies in the three-dimensional image volume according to adjacent cells with a value of 1 in the three-dimensional background Cartesian grid; The two-dimensional rectangular surface on the boundary of each three-dimensional connected domain inside the three-dimensional background Cartesian grid, that is, the two-dimensional background Cartesian grid unit with inconsistent attribute values on both sides is extracted as the internal two-dimensional connected domain, and the side connected area of each three-dimensional connected body on the six end faces of the three-dimensional background Cartesian grid is marked as the boundary two-dimensional connected domain; the common grid unit edges between the boundary two-dimensional connected domain and the internal connected domain are marked as one-dimensional connected domains according to the connectivity relationship.
8. The method for generating a tetrahedral mesh for a three-dimensional image according to claim 1, characterized in that: The step C comprises: Based on the extracted boundary structure information and the connectivity information of boundary faces and boundary lines on the three-dimensional background Cartesian grid, the number of boundary lines and boundary faces is determined, and the inclusion topological relationship between boundary faces and boundary lines and boundary points, and the inclusion topological relationship between boundary lines and boundary points are recorded. The geometric position of the boundary face is defined by the two-dimensional rectangular surface set of the three-dimensional background Cartesian grid units constituting the boundary face, and the geometric position of the boundary line is defined by the Cartesian grid unit edges constituting the boundary line. The geometric position of the boundary point is determined according to the Cartesian grid vertices constituting the boundary point.
9. The method for generating a tetrahedral mesh for a three-dimensional image according to claim 1, characterized in that: The step D comprises: The boundary points obtained in step C are used as the initial constraint point set to generate a Delaunay tetrahedron mesh of the constraint point set, and then the existence of boundary line constraints and boundary surface constraints in the Delaunay tetrahedron mesh of the boundary point set is detected in turn according to the constrained Delaunay tetrahedron mesh generation method.
10. A tetrahedral mesh generation method for three-dimensional images according to claim 9, characterized in that: In the process of detecting existence, the intersection detection result of each Voronoi polygon and the boundary surface or boundary line is detected according to the boundary intersection detection method, and finally the corresponding topological approximation line segment set and topological approximation surface set of each constrained boundary line and constrained boundary surface in the tetrahedral mesh are extracted, and the tetrahedral mesh under the constraint of the three-dimensional image body is output.
Citation Information
Patent Citations
Method for generating tetrahedron gridding for three-dimensional geological structure
CN102194253A
Automatic generation method for mechanical entity polyhedral mesh under curved surface constraint
CN113628340A
Method and system for reconstructing tetrahedral mesh model by hierarchically scanning data
CN117333615A
Tetrahedral lattice generation system and recording medium recording program
JP1999096399A