An Efficient Error-Controllable Mesh Simplification Method Based on Improved Envelope Testing
By improving the envelope testing method, error envelope polyhedrons are generated and sparse mesh is built to accelerate the mesh simplification process, solving the problem of inefficient grid simplification in high-precision industrial scenarios, and achieving a mesh simplification effect with controllable errors and high efficiency.
Patent Information
- Application Number
- CN202210621732.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2042-06-01
AI Technical Summary
The existing grid simplification methods have problems of inefficiency and difficulty in controlling errors in industrial scenarios with high precision requirements.
Using an efficient error controllable mesh simplification method based on improved envelope testing, the rapid search and dimensionality reduction coverage test is achieved by generating error envelope polyhedrons and constructing sparse mesh acceleration structures, and thus efficiently folding mesh edges.
The error of the simplified model is effectively controlled and the efficiency of grid simplification is significantly improved. The number of grids can be significantly reduced without changing the appearance of the model and the rendering efficiency is improved.
Smart Images

Figure CN115019012B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer graphics, and particularly relates to an efficient error-controllable mesh simplification method based on improved envelope testing. Background Art
[0002] In industrial simulation software, the efficient simulation of large-scale scenes is a technical difficulty. Mesh simplification can effectively reduce the number of meshes constituting the model with little change to the model appearance, thereby improving the rendering efficiency, which is an important means to achieve large-scale scene rendering. From the perspective of algorithm performance, the research on mesh simplification algorithms mainly focuses on two major directions. One is efficient simplification, and the other is high-quality simplification.
[0003] Efficient simplification is an important direction of previous related research, and good research results have been obtained. Garland and Heckbert proposed a simplification algorithm based on QEM (Quadric Error Metrics). This algorithm can balance model quality and simplification efficiency. Until now, QEM is still the mainstream algorithm for mesh simplification, and many subsequent studies are based on this algorithm.
[0004] The focus of high-quality simplification lies in high fidelity and high precision. High-fidelity simplification means that while reducing the number of meshes, important features of the original model are retained as much as possible, so that the appearance of the simplified model is similar to that of the original model. The focus of high-precision simplification is to control the accuracy to meet the user's requirements and reduce the number of meshes on this premise. Currently, conventional mesh simplification techniques can meet most application scenarios. However, for some industrial scenarios with high precision requirements, such as the simplification of workpiece models for CAD, robot offline programming, or finite element analysis, there are still some problems that cannot be ignored:
[0005] 1. The mesh simplification method based on quadratic error metric (QEM) is very efficient and can meet the requirements of most scenarios. However, due to its principle limitations, it cannot directly control the error between the simplified model and the original model.
[0006] 2. The mesh simplification method based on envelope testing can control the accuracy of model simplification. However, both the coarse screening and the fine envelope testing in it require more time. Compared with QEM, the efficiency of envelope testing is much lower. Summary of the Invention
[0007] The purpose of the present invention is to provide an efficient error-controllable mesh simplification method based on improved envelope testing, providing a solution idea for the problem of low rendering efficiency of large-scale scene simulation in existing industrial simulation software from the perspective of model volume, and at the same time providing a method for reference to achieve the three-dimensional model simplification function that balances efficiency and precision.
[0008] To solve the technical problems related to accuracy and efficiency, the technical solution adopted by the present invention is as follows:
[0009] According to a specific example of the present invention, an efficient error controllable mesh simplification method based on improved envelope testing includes:
[0010] Step 1: Generate an error envelope polyhedron for all patches to form a set B, and construct a sparse grid acceleration structure for the set B;
[0011] Step 2: Use Qslim to select an edge e to be folded, and set the set of patches adjacent to e as D.
[0012] Step 3: Based on the sparse grid, quickly find the envelope bodies in the envelope body set B that intersect the patches in the set D, and define their set as B';
[0013] Step 4: Calculate the intersection lines of the cutting planes in B' and the triangular patches in the set D, so as to achieve a dimensionality reduction coverage test. If the envelope bodies in B' completely contain the patches D, the edge e can be folded;
[0014] Step 5: Loop and execute the above steps until no edges can be folded.
[0015] Further, the specific steps of Step 1 are as follows:
[0016] Step 1.1: Define a preset error value δ;
[0017] Step 1.2: Expand the distance of δ outward from the two-dimensional triangular mesh.
[0018] Further, the specific steps of Step 2 are as follows:
[0019] Step 2.1: Calculate the quadratic error (QE) of each mesh vertex of the model based on the quadratic error metric (QEM). The QE of a mesh vertex is the sum of the squares of the distances from this point to all triangular patches in its neighborhood;
[0020] Step 2.2: Calculate the QE of each mesh edge of the model. The QE of the mesh edge of the model patch is the sum of the QEs of its two end vertices;
[0021] After calculating the QE of all edges, find the edge with the minimum QE as the edge e to be folded. Further, the specific steps of Step 3 are as follows:
[0022] Step 3.1: Save the information of all envelopes based on a three-dimensional space grid (a cubic grid, not the triangular grid of a 3D model). Each cubic grid saves the index values (IDs) of all envelopes occupying this grid space. A sparse grid saving method based on a linked list structure is used. Nodes are constructed only when the three-dimensional space grid is occupied. Define the three-dimensional space grid size s according to Equation (1):
[0023] s = avg({l i |l i = max(b i .x, b i .y, b i .z), i = 1, 2,......, n}) (1)
[0024] where b i is the AABB bounding box of the i-th grid of the model, n represents the total number of model grids, x, y, and z represent the lengths of the bounding box along the x, y, and z directions, and l i represents the longest edge length of the bounding box.
[0025] Step 3.2: Find all triangular grids that will be affected if the edge e to be folded is folded, and define this set as D.
[0026] Step 3.3: Traverse the elements in D, denoted as f, and calculate the three-dimensional space grids covered by f according to the coordinate range of the AABB bounding box of f;
[0027] Step 3.4: Record the envelope IDs indexed by the three-dimensional space grids covered by f and remove duplicates. Define the envelope set as B'. If f is not completely covered by B', folding is not performed;
[0028] Furthermore, the specific steps of Step 4 are as follows:
[0029] Step 4.1: Calculate the intersection lines between the cutting planes in B' of Step 3 and the triangular patches in set D. To avoid adding unnecessary intersection calculations, intersection calculations are only performed when a certain envelope is used, and the parameters of the intersection line equation are saved:
[0030] a'x 2 + b'y 2 + c' < 0 (2)
[0031] Step 4.2: Thus, perform a dimension reduction coverage test. If the envelopes in B' completely contain the patches D, the edge e can be folded.
[0032] Step 4.3: The process of envelope testing for the vertices of the patch can be further simplified when finding the intersection line. Assume that the coordinates of the three vertices of a grid patch are p 1, p 2 , p 3 , Define any point on the patch as p, so:
[0033] p = u(p 2 - p 1 ) + v(p 3 - p 1 ) + p 1 (3)
[0034] Where u and v are scalars between 0 and 1, which can form a uv coordinate system, and calculate the intersection line of the triangular patch and any plane on the convex polyhedron:
[0035]
[0036] Where A, B, C, and D are all constants defining a certain plane on the convex polyhedron. A, B, and C form the normal vector of a certain plane on the convex polyhedron, and D can be regarded as an additional constraint defining the position of the plane. In the uv coordinate system, the C1 type points included in the test are respectively transformed into (0, 0), (0, 1), and (1, 0). To determine the direction of these three points with respect to the line, only the signs of c', b' + c', and a' + c' need to be checked, where a', b', and c' are the coefficients of the line equation in formula (5).
[0037] The beneficial effects of the present invention are:
[0038] The present invention effectively controls the error of the simplified model by using an error envelope body, and realizes a higher simplification efficiency based on sparse grid search and dimensionality reduction coverage testing. Brief Description of the Drawings
[0039] Figure 1 It is a schematic flow diagram of the simplification method of the present invention;
[0040] Figure 2 It is a schematic diagram of the construction method of the convex polyhedron envelope body; the internal part is the triangular patch in the model, and the external part is the envelope body.
[0041] Figure 3 It is a schematic diagram of three types of points for judging the envelope relationship; among them, the triangle vertices represent C1 type points, the points on the triangle sides are C2 type points, and the points inside the triangle are C3 type points.
[0042] Figure 4 It is a schematic diagram of dimensionality reduction testing; the direction discrimination of a point with respect to a plane is transformed into the direction discrimination of a point with respect to a line.
[0043] Figure 5 It is a schematic diagram of any point p on the grid patch;
[0044] Figure 6Schematic diagram for dimensionality reduction coverage test; in the figure, the vertices of the triangle represent points of class C1, the points on the sides of the triangle are points of class C2, and the points inside the triangle are points of class C3. Different types of lines represent the intersection lines of the planes on different convex polyhedra and the triangle, and the arrow direction points to the outside of the convex polyhedron.
[0045] Figure 7 Effect diagrams before and after simplification of the instance model; (a) original model, with the number of meshes being 32706; (b) allowable error is 1 mm, and the number of meshes after simplification is 1098.
[0046] Figure 8 Effect diagram for comparison of efficiency and memory occupancy; the comparison algorithm is the model simplification algorithm in the CGAL library.
[0047] Figure 9 Diagram of algorithm error distribution. Detailed implementation manner
[0048] To better understand the technical solution of the present invention, the following further describes the implementation manner of the present invention in conjunction with the accompanying drawings:
[0049] The purpose of the present invention is to provide an efficient error controllable mesh simplification method based on improved envelope testing, providing a solution idea for the problem of low rendering efficiency of large-scale scene simulations in existing industrial simulation software from the perspective of model volume, and at the same time providing a method for realizing the three-dimensional model simplification function that takes into account both efficiency and accuracy for reference.
[0050] As Figure 1 shown, the specific implementation steps of the present invention are as follows:
[0051] Step 1: Generate error envelope polyhedra for all patches to form a set B, and construct a sparse grid acceleration structure for the set B.
[0052] To generate this envelope body, it is necessary to first define the error value δ, and then expand the distance of δ outward from the two-dimensional grid. The specific expansion method is as Figure 2 shown.
[0053] Step 2: Use Qslim to select an edge e to be folded, and set the set of patches adjacent to e as D.
[0054] Qslim is a model simplification algorithm based on quadratic error metric (QEM) for model error management. The quadratic error (QE) of a vertex of a model patch is the sum of the squares of the distances from this point to all triangular patches in its neighborhood. The QE of an edge of a model patch is the sum of the QEs of its two end vertices. After calculating the QEs of all edges, find the edge with the smallest QE as the edge to be folded.
[0055] Step 3: Based on the sparse grid, quickly find the envelopes in the envelope set B that intersect with the patches in set D, and define their set as B'.
[0056] For envelope screening based on the sparse grid, existing methods generally use a tree structure to screen envelopes. For example, the well-known computational geometry algorithm library CGAL uses a bounding volume hierarchy (BVH). This invention uses a direct indexing method to replace the traversal search of the tree structure. Specifically, the information of all envelopes is saved based on a three-dimensional space grid (which is a cube grid, not the triangular grid of a 3D model). Each grid saves the index values of all envelopes occupying the space of this grid. This method can effectively reduce the time complexity, but the space complexity is relatively high. To reduce the space complexity, a sparse grid based on a linked list structure is used to save the envelope information. Nodes are only constructed when the three-dimensional space grid is occupied. Define the three-dimensional space grid size s according to Equation (1):
[0057] s = avg({l i |l i = max(b i .x, b i .y, b i .z), i = 1, 2,......, n}) (1)
[0058] where b i is the AABB bounding box of the i-th grid of the model, and n represents the total number of model grids. After completing the construction of the sparse grid, screen the envelopes related to each grid. The screening process is shown in Algorithm 1.
[0059]
[0060]
[0061] Step 4: Calculate the intersection lines between the cutting planes in B' and the triangular patches in set D in Step 3, thereby realizing the dimension reduction coverage test. If the envelopes in B' completely contain the patch D, the edge e can be folded. When performing the inclusion test of a triangle, to check whether a triangle is completely contained in a convex polyhedron set, it only needs to check whether the following three types of points are contained in the convex polyhedron set:
[0062] · C1: The vertices of the triangle;
[0063] · C2: The intersection points generated by each side of the triangle and the convex polyhedron;
[0064] ● C3: The intersection points generated between the triangle and any two faces in the convex polyhedron set.
[0065] For example Figure 3As shown. In the original coverage test algorithm, each edge collapse requires a three-dimensional envelope test. Starting from the vertices of the grid (C1 type intersections), an envelope body that can cover this intersection is searched for. The envelope body generates C2 type intersections with the grid edges, and then an envelope body that covers the C2 type intersections is searched for. Finally, the envelope body generates C3 type intersections with the grid faces. The essence of the three-dimensional envelope test lies in determining whether the above three types of intersections are within the envelope body. Suppose there is an intersection point (x 1 , y 1 , z 1 ), and the normal vectors of all faces of the envelope body point outwards. Then this process can be expressed by Equation (2):
[0066] ax 1 + by 1 + cz 1 + d < 0 (2)
[0067] Where a, b, and c represent the three components of the normal vector of the envelope body surface intersecting with the grid face, and d is the component that jointly constrains the plane position with a, b, and c. If Equation (2) holds, the intersection point is within the envelope body. Since only the complete coverage of the grid face needs to be determined, theoretically, the three-dimensional envelope problem can be transformed into a two-dimensional problem of the plane where the grid face is located. To further improve the calculation efficiency, the three-dimensional envelope test is reduced to two dimensions by calculating the intersection line, as Figure 4 shown. To avoid adding unnecessary intersection calculations, the intersection calculation is only performed on an envelope body when it is used, and the parameters of the intersection line equation are saved. By reducing the dimension, the problem shown in Equation (2) can be transformed into the problem shown in Equation (3):
[0068] a'x 2 + b'y 2 + c' < 0 (3)
[0069] This simplifies the calculation process for each determination. In addition, when calculating the intersection line, the judgment process of C1 type points can be further simplified. Suppose the coordinates of the three vertices of a grid patch are p 1 , p 2 , p 3 . Define any point on the patch as p, as Figure 5 shown. Therefore:
[0070] p = u(p 2 - p 1 ) + v(p 3 - p 1 ) + p 1 (4)
[0071] Where u and v are scalars between 0 and 1, which can form a uv coordinate system. Substituting Equation (4) into Equation (2) gives:
[0072]
[0073] The intersection line between the triangular patch and any plane on the convex polyhedron is represented by Equation (5), where A, B, C, and D are all constants defining a certain plane on the convex polyhedron. A, B, and C form the normal vector of a certain plane on the convex polyhedron, and D can be regarded as an additional constraint defining the position of the plane. In the uv coordinate system, the C1 type points under test are respectively transformed into (0, 0), (0, 1), and (1, 0). To determine the direction of the line with respect to these three points, it is only necessary to check the signs of c', b'+c', and a'+c', where a', b', and c' are the coefficients of the line equation in Equation (5). In summary, the process of the dimensionality reduction coverage test is as follows Figure 6 shown.
[0074] Step 5: Loop and execute Steps 2 - 4 until no edges can be folded.
[0075] The present invention will be described below according to the embodiments, and the purpose and effects of the present invention will become more obvious.
[0076] To test the performance of the algorithm under different mesh complexities, several mesh models with the number of patches ranging from 10,000 to 180,000 were selected for experiments, and the specified error threshold (ε) was 1 mm.
[0077] Performance measurement of the present invention: Sampling and measuring the simplification error based on the Approximate Hausdorff Distance algorithm, measuring the simplification efficiency by timing with the high-precision event timer (HPET) built into the computer, and measuring the space complexity by recording the memory occupancy.
[0078] The effects before and after model simplification are as Figure 7 shown, the efficiency and memory occupancy are as Figure 8 shown, and the error distribution is as Figure 9 shown.
[0079] It can be understood that the present invention is described through some embodiments. Those skilled in the art know that without departing from the spirit and scope of the present invention, various changes or equivalent replacements can be made to these features and embodiments. Additionally, under the teaching of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application belong to the scope protected by the present invention.
Claims
1. An efficient error - controllable mesh simplification method based on improved envelope testing, characterized in that, it includes the following steps: Step 1: For the mesh of the original model, generate an error envelope polyhedron for all patches to form a set B, and construct a sparse grid acceleration structure for the set B; Step 2: Use Qslim to select a folding edge e to be folded, and set the set of patches adjacent to e as D, Step 3: Based on the sparse grid, quickly find the envelope bodies in the envelope body set B that intersect with the patches in the set D, and define their set as B'; Step 4: Calculate the intersection lines between the cutting planes in B' and the triangular patches in the set D, so as to achieve dimensionality - reduced coverage testing. If the envelope bodies in B' completely contain the patches D, the edge e can be folded; Step 5: Loop and execute Steps 2 - 4 until no more edges can be folded.
2. An efficient error - controllable mesh simplification method based on improved envelope testing as claimed in claim 1, characterized in that, in Step 1, an error envelope polyhedron is used to control the simplification error. To generate the error envelope polyhedron, it is necessary to first define an error value δ, and then expand the patches outward by a distance of δ starting from the two - dimensional mesh.
3. An efficient error - controllable mesh simplification method based on improved envelope testing as claimed in claim 1, characterized in that, in Step 2, Qslim is used to select the folding edge e to be folded each time. The method is to find the edge with the smallest quadratic error QE in the model patches as the folding edge e. The quadratic error QE of an edge in the model patches is the sum of the quadratic errors QE of its two end vertices. The quadratic error QE of a vertex in the model patches is the sum of the squared distances from this point to all triangular patches in its neighborhood.
4. An efficient error - controllable mesh simplification method based on improved envelope testing as claimed in claim 1, characterized in that, in Step 3, envelope body screening is carried out based on the sparse grid in a direct indexing manner. Specifically, the information of all envelope bodies is saved based on a three - dimensional space grid, i.e., a cube grid. Each grid saves the index values of all envelope bodies occupying this grid space: The information of envelope bodies is saved using a sparse grid based on a linked - list structure. Nodes are only constructed when the three - dimensional space grid is occupied. Define the size s of the three - dimensional space grid according to formula (1): s = avg({l i |l i = max(b i .x, b i .y, b i .z), i = 1, 2,......, n}) (1) where b i is the AABB bounding box of the i-th grid of the model, n represents the total number of model grids, x, y, and z represent the lengths of the bounding box along the x, y, and z directions, and l i represents the longest edge length of the bounding box; after the construction of the sparse grid is completed, an envelope related to each grid is screened out.
5. An efficient error - controllable mesh simplification method based on improved envelope testing as claimed in claim 4, characterized in that, after the construction of the sparse grid is completed, screen the envelope bodies related to each grid: find all triangular meshes that will be affected if the folding edge e is folded, and define this set as D; traverse the elements f in D, calculate the three - dimensional space grids covered by f according to the coordinate range of the AABB bounding box of f; record the envelope body IDs indexed by the three - dimensional space grids covered by f and remove duplicates, and define the envelope body set as B'. If f is not completely covered by B', no folding is performed.
6. An efficient error - controllable mesh simplification method based on improved envelope testing as claimed in claim 1, characterized in that, Reduce the time complexity required by the original coverage test method using dimensionality reduction coverage testing. When performing the inclusion test of a triangle, to check whether the triangle is completely included in a convex polyhedron set, it is only necessary to check whether the following three types of points are included in the convex polyhedron set: C1: The vertices of the triangle; C2: The intersection points generated by each side of the triangle and the convex polyhedron; C3: The intersection points generated between the triangle and any two faces in the convex polyhedron set.
7. An efficient error-controllable mesh simplification method based on improved envelope testing as described in claim 6, characterized in that The essence of the three-dimensional envelope test lies in determining whether the three types of intersection points are within the envelope body. Since it is only necessary to determine whether the mesh surface is completely covered, the three-dimensional envelope problem is transformed into a two-dimensional problem of the plane where the mesh surface is located, and the three-dimensional envelope test is reduced to two dimensions by calculating the intersection line. The intersection calculation is only performed when a certain envelope body is used, and the parameters of the intersection line equation are saved: ax 2 +by 2 +c < 0 (2) where x 2 and y 2 represent coordinate values, and when finding the intersection line, the judgment process of C1 type points can be further simplified. Assume that the coordinates of the three vertices of a grid patch are p 1 , p 2 , p 3 , and define any point on the patch as p. Therefore: p = u(p 2 -p 1 ) + v(p 3 -p 1 ) + p 1 (3) where u and v are scalars between 0 and 1, which can form a uv coordinate system, and calculate the intersection line of the triangular patch and any plane on the convex polyhedron: where A, B, C, and D are all constants defining a certain plane on the convex polyhedron. A, B, and C form the normal vector of a certain plane on the convex polyhedron, and D can be regarded as an additional constraint defining the position of the plane. In the uv coordinate system, the C1 type of points in the inclusion test are respectively transformed into (0,0), (0,1), and (1,0). To determine the direction of these three points and the line, it is only necessary to check the signs of c', b'+c', and a'+c', where a', b', and c' are the coefficients of the line equation in formula (4).
Citation Information
Patent Citations
Error-controllable CAGE sequence representation algorithm for dynamic grid
CN105427360A
Triangular mesh simplification method based on angle error measure
CN108038909A