Triangular mesh model construction method based on nearest point local optimization
Through the construction of the Dragon Triangle grid, the recent local optimization method is used to quickly position and handle non -derunne triangles to solve the problem of low time efficiency of the insertion method one by one, which significantly improves the efficiency of Draomin's triangle.
Patent Information
- Application Number
- CN202411402241.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The existing point-by-point insertion method is less time efficient when constructing a Delaunay triangular grid, and as the data set expands, the time complexity will continue to increase.
Based on the recent local optimization method, the steps of searching and inserting the triangle of the data point are eliminated. Through the recent data point, all non -virtue triangles are quickly located, and their internal boundaries are deleted to generate new triangles.
Effectively improved the time efficiency of Draomin's triangularization, slowed the speed of time complexity with the expansion of the data set, and improved image processing efficiency.
Smart Images

Figure CN119379949A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer-aided design, and in particular relates to a triangular mesh model construction method based on local optimization of nearest points for a plane point set. Background Art
[0002] Meshes are often used in computer graphics to simulate the surfaces of complex objects. Compared with polygonal meshes, triangular meshes are more stable, have a simpler structure, and can be generated quickly. When processing real-world graphics, it is often necessary to convert the graphics into triangular meshes.
[0003] The Delaunay triangulation is a companion figure of the Voronoi diagram. The minimum angle maximum property of the Delaunay triangle can avoid the appearance of narrow triangles in the mesh as much as possible, making the construction of the triangular mesh more reasonable and accurate. The point-by-point insertion method is an important method for constructing the Delaunay triangulation. It adopts the idea of dynamically generating triangles, is easy to implement in programming, and occupies less memory, but has the problem of high time complexity.
[0004] To address the low time efficiency of the point-by-point insertion method, existing research optimization ideas usually shorten the path of searching for the triangle where the data point is inserted. However, as the data set continues to expand, the search path will inevitably become longer, so the time efficiency of the method will continue to decrease. Summary of the invention
[0005] The purpose of the present invention is to provide a triangular mesh model construction method based on local optimization of the nearest point, which optimizes the point-by-point insertion method in Delaunay triangulation, omits the step of searching for triangles where insertion data points are located, and can quickly locate all non-Delaunay triangles.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] 1. A method for constructing a triangular mesh model based on local optimization of the nearest point
[0008] The triangular mesh model construction method comprises the following steps:
[0009] 1) Obtain the original image of the target entity and obtain a plane point set based on the original image;
[0010] 2) constructing an initial polygon according to the plane point set, dividing the area where the initial polygon is located into a number of grids, and sorting the grids so that the numbers of adjacent grids are adjacent;
[0011] 3) Decompose the initial polygon into initial triangles according to the Delaunay triangulation method;
[0012] 4) Insert several data points in grid order; after inserting each data point, obtain the nearest data point corresponding to the current data point, locate all non-Delaunay triangles through the nearest data point, delete all non-Delaunay triangle internal boundaries, generate several new triangles based on the current data point, and then complete the insertion of the current data point;
[0013] 5) Delete all initial polygon-related triangles from the initial triangular mesh model to obtain a triangular mesh model of the target entity.
[0014] In the step 4), the process of obtaining the nearest data point corresponding to the current data point includes: taking the data points in the grid where the current data point is located and the adjacent grids of the grid where the current data point is located as surrounding data points, obtaining a set of surrounding data points, and obtaining the surrounding data point with the smallest spacing based on the spacing between each surrounding data point and the current data point and taking it as the nearest data point.
[0015] In the step 4), all non-Delaunay triangles are obtained by locating the nearest data point. Specifically, any non-Delaunay triangle is obtained from all triangles with the nearest data point as a vertex; and the adjacent triangles of each non-Delaunay triangle are traversed to see if they are non-Delaunay triangles, until all non-Delaunay triangles are found.
[0016] In step 4), the process of obtaining all non-Delaunay triangles by locating the nearest data point includes the following steps:
[0017] B1) obtaining any non-Delaunay triangle from all triangles with the nearest data point as a vertex, marking the non-Delaunay triangle, and constructing a positioning set including only the starting non-Delaunay triangle;
[0018] B2) for each non-Delaunay triangle in the positioning set, screen out all non-Delaunay triangles that do not meet the Delaunay condition and have not been marked from all triangles that are in contact with the edge of the non-Delaunay triangle, obtain the edge-connected non-Delaunay triangles corresponding to the non-Delaunay triangle, and mark the edge-connected non-Delaunay triangles corresponding to the non-Delaunay triangle;
[0019] Finally, all edge-connected non-Delaunay triangles corresponding to the non-Delaunay triangles in the positioning set are summarized as a new positioning set;
[0020] B3) Repeat step B2) until the new positioning set obtained in step B2) is empty.
[0021] In the step B1), the process of obtaining any non-Delaunay triangle from all triangles with the nearest data point as the vertex is specifically as follows: traverse all triangles with the nearest data point as the vertex to see whether they meet the Delaunay condition, and stop iterating after traversing to the first non-Delaunay triangle edge that does not meet the Delaunay condition.
[0022] In the step 3), the process of deleting all non-Delaunay triangle internal boundaries and generating several new triangles based on the current data point includes: after deleting all non-Delaunay triangle internal boundaries, the remaining boundaries enclose a cavity containing the current data point, and the current data point is connected to each vertex of the cavity to form several new triangles; the non-Delaunay triangle internal boundaries are the common sides of adjacent non-Delaunay triangles.
[0023] In the step 4), the initial polygon-related triangle is a triangle having vertices of the initial polygon as vertices.
[0024] The plane point set of the target entity is composed of a number of coordinate data points. For the initial polygon constructed in step 2), each coordinate data point is located inside the initial polygon or on the boundary of the initial polygon, that is, the coordinate data points located on the boundary of the initial polygon are also considered to be located inside the initial polygon.
[0025] 2. A computer device
[0026] The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0027] 3. A computer-readable storage medium
[0028] A computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0029] The method of the present invention is based on the sequential adjacent theorem of non-Delaunay triangles and the theorem of the nearest point as a suspect point. All non-Delaunay triangles are quickly located according to the nearest data point, and the step of searching for the triangle where the inserted data point is located is omitted, thereby further improving the time efficiency of Delaunay triangulation based on the point-by-point insertion method. Among them, the sequential adjacent theorem of non-Delaunay triangles means that in the Delaunay triangular mesh, for each insertion of a node, all triangles whose circumscribed circles contain the node must be sequentially adjacent. The theorem of the nearest point as a suspect point means that in the Delaunay triangular mesh, the point B closest to the newly inserted data point A is a suspect point, that is, among all triangles with point B as a vertex, there must be at least one triangle that is a non-Delaunay triangle.
[0030] The beneficial effects of the present invention are:
[0031] The present invention quickly locates all generated non-Delaunay triangles by inserting the nearest point of the data point, thereby optimizing the step of searching for the triangle where the inserted data point is located in the traditional optimization method, slowing down the speed at which the time complexity increases with the expansion of the data set, and effectively improving the time efficiency of Delaunay triangulation based on the point-by-point insertion method, thereby improving the efficiency of image processing based on Delaunay triangulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a flow chart of the method of the present invention;
[0033] Figure 2 Schematic diagram of the triangles that need to be deleted and the triangles actually traversed after inserting the data point P;
[0034] Figure 3 Schematic diagram of triangles with different properties after inserting data point P. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0036] The specific embodiments of the present invention are as follows:
[0037] The triangular mesh model construction method in this embodiment includes the following steps:
[0038] 1) Acquire an original image of the target entity, and obtain a plane point set corresponding to the target entity according to the original image; wherein the acquisition method of the original image includes but is not limited to scanning and shooting. The original image of the target entity includes a two-dimensional image and a three-dimensional image of the surface of the target entity, preferably a two-dimensional image. The plane point set corresponding to the target entity is mainly composed of a number of coordinate data points.
[0039] 2) Construct an initial polygon that can accommodate all coordinate data points based on the plane point set of the target entity, divide the initial polygon into several grids, and sort the grids so that the serial numbers of adjacent grids are adjacent. Among them, for the initial polygon, each coordinate data point is located inside the initial polygon or on the boundary of the initial polygon, that is, the coordinate data points located on the boundary of the initial polygon are also considered to be located inside the initial polygon. The process of dividing the initial polygon into several grids is specifically as follows: divide the area where the coordinate data points are located into grids, arrange all grids in an adjacent order, and reasonably allocate the size and capacity of the grids according to the size of the data set. The grid size does not have to be guaranteed to be the same; the number of coordinate data points in the grid is not required to be strictly the same.
[0040] In this embodiment, the process of constructing the initial polygon according to the plane point set of the target entity is specifically as follows: obtaining the maximum x coordinate x of all coordinate data points in the plane point set; max , minimum x coordinate x min , maximum y coordinate y max and the minimum y coordinate y min , combined with the preset polygon margin d, the coordinates of the initial polygon vertices are obtained. The coordinates of the initial polygon vertices and each vertex are: initial polygon vertex s1(x min -d,y min -d), initial polygon vertex s2(x min -d,y miax +d), initial polygon vertex s3(x max +d,y min -d), initial polygon vertex s4(x max +d,y max +d); the value of d is required to satisfy that all coordinate data points are located inside the initial polygon. In the specific implementation, data points located on the boundary are considered to be located inside the polygon. Finally, the initial polygon vertex s1, the initial polygon vertex s2, the initial polygon vertex s3 and the initial polygon vertex s4 are sequentially connected to obtain the initial polygon.
[0041] 3) Decomposing the initial polygon into a number of initial triangles according to the Delaunay triangulation method; it should be noted that the initial triangles are obtained by connecting the vertices of the initial polygon.
[0042] 4) Insert data points into each grid in grid order. After inserting each data point, obtain the nearest data point corresponding to the current data point, locate all non-Delaunay triangles through the nearest data point, delete the internal boundaries of all non-Delaunay triangles, generate several new triangles based on the current data point, and then complete the insertion of the current data point. It should be noted that the coordinates and number of data points are generated by the coordinates and number of coordinate data points in the corresponding plane point set. Since each grid contains several coordinate data points, the grid order should be followed when inserting data points. When all data points in a grid are inserted and triangulated, the data points in the next grid are inserted in grid order.
[0043] Specifically, after inserting each data point, triangulation is performed through the following steps:
[0044] A) Obtain the nearest data point corresponding to the current data point: take the data points in the grid where the current data point is located and the adjacent grids of the grid where the current data point is located as the surrounding data points, obtain a set of surrounding data points, and according to the distances between each surrounding data point and the current data point, obtain the surrounding data point with the smallest distance and use it as the nearest data point; wherein the adjacent grids of the grid where the current data point is located include the edge contact grids of the grid where the current data point is located and the point contact grids of the grid where the current data point is located.
[0045] In this embodiment, the process of obtaining any non-Delaunay triangle from all triangles with the nearest data point as vertices is specifically as follows: traverse all triangles with the nearest data point as vertices to see if they satisfy the Delaunay condition, and stop iterating after traversing to the first non-Delaunay triangle edge that does not satisfy the Delaunay condition.
[0046] B) Obtaining all non-Delaunay triangles by locating the nearest data point is specifically as follows: obtaining any non-Delaunay triangle from all triangles with the nearest data point as a vertex; traversing the adjacent triangles of each non-Delaunay triangle to see if they are non-Delaunay triangles, until all non-Delaunay triangles are found.
[0047] like Figure 1 As shown, in this embodiment, step B2) includes the following steps:
[0048] B1) obtaining any non-Delaunay triangle from all triangles with the nearest data point as a vertex as a starting non-Delaunay triangle, marking the starting non-Delaunay triangle, and constructing a positioning set with the non-Delaunay triangle as the only element;
[0049] B2) Take the first non-Delaunay triangle in the positioning set as the current non-Delaunay triangle, obtain all edge-contacting triangles that are in contact with the edge of the current non-Delaunay triangle, obtain an edge-contacting triangle set, filter out all edge-contacting non-Delaunay triangles that do not meet the Delaunay condition and are not marked from the edge-contacting triangle set, and mark each edge-contacting non-Delaunay triangle obtained by filtering out; among them, edge contact means sharing a common edge. Point contact means sharing a common vertex; a triangle that does not meet the Delaunay condition means that the circumscribed circle of the triangle contains other data points;
[0050] B3) deleting the current non-Delaunay triangle from the positioning set, and adding the edge-connected non-Delaunay triangle marked in step B2) to the positioning set;
[0051] B4) Repeat steps B2) to B3) until the number of non-Delaunay triangles in the positioning set is zero.
[0052] C) After deleting all non-Delaunay triangle internal boundaries and generating several new triangles based on the current data point, the current data point is inserted; in this embodiment, the process of deleting all non-Delaunay triangle internal boundaries and generating several new triangles based on the current data point includes: after deleting all non-Delaunay triangle internal boundaries, the remaining boundaries enclose a cavity containing the current data point, and the current data point is connected to each vertex of the cavity to form several new triangles. Among them, the non-Delaunay triangle internal boundaries are the common sides of adjacent non-Delaunay triangles.
[0053] 4) Delete all the initial polygon-related triangles from the initial triangular mesh model to obtain the triangular mesh model of the target entity, wherein the initial polygon-related triangles are triangles with the vertices of the initial polygon as vertices.
[0054] Figure 2 This is a schematic diagram of the operation process of the triangulation algorithm based on the local optimization of the nearest point after inserting the data point P. Point A is the nearest data point to point P. Figure 2 The triangle 1 on the left side of the figure represents the first non-Delaunay triangle that is traversed among all triangles with point A as a vertex. Figure 2 Triangle 2 and triangle 6 on the right side represent non-Delaunay triangles that have been traversed among the adjacent triangles of triangle 1. No non-Delaunay triangles have been traversed among the remaining adjacent triangles of triangle 2 and triangle 6, and the traversal process is terminated.
[0055] Figure 3In the figure, triangles 1 to 4 are non-Delaunay triangles generated after inserting data point P. These triangles must be adjacent to each other in sequence. For the traditional point-by-point insertion method, it is necessary to traverse all existing triangles to locate all non-Delaunay triangles. The Delaunay triangulation algorithm based on local optimization of the nearest point only needs to traverse triangles 1 to 10 to locate non-Delaunay triangles.
[0056] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0057] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
Claims
1. A method for constructing a triangular mesh model based on local optimization of the nearest point, characterized in that: The triangular mesh model construction method comprises the following steps: 1) Obtain the original image of the target entity and obtain a plane point set based on the original image; 2) constructing an initial polygon according to the plane point set, dividing the area where the initial polygon is located into a number of grids, and sorting the grids so that the numbers of adjacent grids are adjacent; 3) Decompose the initial polygon into initial triangles according to the Delaunay triangulation method; 4) Insert several data points in grid order; after inserting each data point, obtain the nearest data point corresponding to the current data point, locate all non-Delaunay triangles through the nearest data point, delete all non-Delaunay triangle internal boundaries, generate several new triangles based on the current data point, and then complete the insertion of the current data point; 5) Delete all initial polygon-related triangles from the initial triangular mesh model to obtain a triangular mesh model of the target entity.
2. The method for constructing a triangular mesh model based on local optimization of the nearest point according to claim 1, characterized in that: In the step 4), the process of obtaining the nearest data point corresponding to the current data point includes: taking the data points in the grid where the current data point is located and the adjacent grids of the grid where the current data point is located as surrounding data points, obtaining a set of surrounding data points, and obtaining the surrounding data point with the smallest spacing based on the spacing between each surrounding data point and the current data point and taking it as the nearest data point.
3. The method for constructing a triangular mesh model based on local optimization of the nearest point according to claim 1, characterized in that: In the step 4), all non-Delaunay triangles are obtained by locating the nearest data point. Specifically, any non-Delaunay triangle is obtained from all triangles with the nearest data point as a vertex; and the adjacent triangles of each non-Delaunay triangle are traversed to see if they are non-Delaunay triangles, until all non-Delaunay triangles are found.
4. The method for constructing a triangular mesh model based on local optimization of the nearest point according to claim 3, characterized in that: In step 4), the process of obtaining all non-Delaunay triangles by locating the nearest data point includes the following steps: B1) obtaining any non-Delaunay triangle from all triangles with the nearest data point as a vertex, marking the non-Delaunay triangle, and constructing a positioning set including only the starting non-Delaunay triangle; B2) for each non-Delaunay triangle in the positioning set, screen out all non-Delaunay triangles that do not meet the Delaunay condition and have not been marked from all triangles that are in contact with the edge of the non-Delaunay triangle, obtain the edge-connected non-Delaunay triangles corresponding to the non-Delaunay triangle, and mark the edge-connected non-Delaunay triangles corresponding to the non-Delaunay triangle; Finally, all edge-connected non-Delaunay triangles corresponding to the non-Delaunay triangles in the positioning set are summarized as a new positioning set; B3) Repeat step B2) until the new positioning set obtained in step B2) is empty.
5. The method for constructing a triangular mesh model based on local optimization of the nearest point according to claim 4, characterized in that: In the step B1), the process of obtaining any non-Delaunay triangle from all triangles with the nearest data point as the vertex is specifically as follows: traverse all triangles with the nearest data point as the vertex to see whether they meet the Delaunay condition, and stop iterating after traversing to the first non-Delaunay triangle edge that does not meet the Delaunay condition.
6. The method for constructing a triangular mesh model based on local optimization of the nearest point according to claim 1, characterized in that: In the step 3), the process of deleting all non-Delaunay triangle internal boundaries and generating several new triangles based on the current data point includes: after deleting all non-Delaunay triangle internal boundaries, the remaining boundaries enclose a cavity containing the current data point, and the current data point is connected to each vertex of the cavity to form several new triangles; the non-Delaunay triangle internal boundaries are the common sides of adjacent non-Delaunay triangles.
7. The method for constructing a triangular mesh model based on local optimization of the nearest point according to claim 1, characterized in that: In the step 4), the initial polygon-related triangle is a triangle having vertices of the initial polygon as vertices.
8. The method for constructing a triangular mesh model based on local optimization of the nearest point according to claim 1, characterized in that: The plane point set of the target entity is composed of a number of coordinate data points. For the initial polygon constructed in step 2), each coordinate data point is located inside the initial polygon or on the boundary of the initial polygon.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Triangular mesh rapid construction method and system based on oblique photography image
CN116109791A
Plane constraint triangular mesh generation method and system
CN118097062A
Constructing solid models using implicit functions defining connectivity relationships among layers of an object to be modeled
US6100893A