Region preservation quadratic error measurement grid simplification method based on quick retrieval

By using KD-Tree structure and surface density and curvature information to adjust the folding cost in the mesh simplification process, the problems of difficulty in simplifying error control and poor feature maintenance in the prior art are solved, and efficient mesh simplification and model details are achieved.

CN119810316APending Publication Date: 2025-04-11CHENGDU SEFON SOFTWARE CO LTD +1

Patent Information

Application Number
CN202411850995.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the process of grid simplification, the prior art is difficult to effectively control simplification errors, maintain the detailed characteristics and continuity of the model, and it is easy to have problems with over-consolid vertices.

Method used

The simplified method of region-preserved secondary error measurement grid is adopted based on fast retrieval, and the search of legal point pairs is accelerated through the KD-Tree structure, the folding cost is adjusted based on the surface density and curvature information, the process is optimized and simplified, and smoothing and abnormal repair are carried out.

Benefits of technology

Effectively maintain the high curvature area characteristics of the mesh model, maintain the geometric structural integrity of the model, eliminate the narrow and long triangle surfaces, and the simplified model has good visual effects and maintains high accuracy under high simplification rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810316A_ABST
    Figure CN119810316A_ABST
Patent Text Reader

Abstract

The invention discloses a quick retrieval-based area-reserved quadratic error measurement grid simplification method, which comprises the following steps of: introducing a vertex neighborhood area, a vertex Gaussian curvature and a boundary folding cost simplification factor to change the folding cost of an edge, and optimizing a simplification process; a KD-Tree data structure is used for accelerating searching for legal point pairs, the complexity of an algorithm is reduced, the characteristics of a high-curvature area of a grid model are effectively maintained, the geometric structure of a grid is kept, and narrow triangular faces are eliminated; the simplified model has a good visual effect, and relatively high simplification precision is kept under a high simplification rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of grid simplification, and in particular to a method for simplifying grids based on rapid retrieval and regional preservation of quadratic error measurements. Background Art

[0002] (1) Computational complexity and model uniformity issues: Although the calculation is simple to determine the position of the edge folding point by the quadratic error matrix QEM, the patent No. 201710755532.X mainly considers the area and normal vector factors, calculates the estimated error of each edge folding and the position of the new vertex, and introduces the normal vector constraint in the folding cost to try to retain the detailed features of the original model, the simplified model is often too uniform and lacks details;

[0003] (2) Difficulty in controlling the simplification error threshold: The vertex projection method makes full use of the geometric information of the folding area to determine the location of the triangle folding point. For example, the patent No. 201810654773.X attempts to control the cumulative error through a prediction-correction model. Although this method can also achieve mesh simplification to a certain extent, the simplification error threshold is not easy to control and may ignore the continuity of the mesh.

[0004] (3) Feature preservation and over-common vertex problem: The coordinates of the folded triangles based on the mesh subdivision method can better maintain the mesh features and continuity when the simplification ratio is large. For example, although the patent No. 202010400340.9 combines Gaussian curvature and quadratic error measurement to calculate the folding cost of the edge, it is easy to have over-common vertices for models with concentrated feature triangles;

[0005] (4) Insufficient error control: The fundamental purpose of model simplification is to reduce the number of facets as much as possible while keeping the model details basically unchanged. However, existing error measurement methods often find it difficult to find the optimal balance between the degree of simplification and model quality. Summary of the invention

[0006] In order to solve the above technical problems, the present invention proposes a method for simplifying a measurement grid by preserving quadratic errors in a region based on rapid retrieval.

[0007] A method for simplifying measurement grids with regional preservation of quadratic errors based on rapid retrieval, comprising the following steps:

[0008] S1: The system loads the simplified 3D model file, parses the model file, and extracts the vertex, edge, and face information of the model;

[0009] S2: Read the mesh file, obtain the original 3D mesh information, traverse each vertex in the mesh, and calculate the quadratic error matrix of each vertex;

[0010] S3: Find all legal point pairs by edge connection or distance, using KD-Tree tree building and query operations;

[0011] S4: Calculate the minimum collapse error for each legal point pair and calculate the new point position after collapse;

[0012] S5: Calculate the face normal vector for each vertex, and calculate the approximate curvature of each edge by using the coordinate information of the vertex and adjacent vertices;

[0013] S6: Use the average area of ​​surface density as the penalty factor to reduce the folding priority of edges located in small and numerous triangle areas, so that edges in flat areas are folded first;

[0014] S7: Repeat folding to find a point pair with the smallest error, merge them into one point, update the Q matrix of adjacent points and the cost of corresponding point pairs to meet the simplification ratio requirement;

[0015] S8: Smooth the simplified model to eliminate the tiny unevenness caused by folding. Check and repair the geometric structure anomaly. Check whether the simplified model has any geometric structure anomaly and perform repair operations.

[0016] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein step S2 comprises the following sub-steps:

[0017] S21: Predefine a 4×4 error matrix Q for each vertex in the grid. The error form of the vertex determines the quadratic term (v) = v T Qv, associates each vertex in space with the plane it is on, and defines the error as the sum of the quadratic distances between the point and the plane set, with the formula:

[0018]

[0019] Among them, ([v x v y v z 1]) T represents the error form of the vertex, Δ(v) represents the quadratic error matrix of the vertex, p = [abcd] T Represented by equation a 2 +b 2 +c 2 = 1, v represents the vertex, and planes(v) represents the set of all triangular planes containing vertex v;

[0020] S22: Rewrite the error metric into a quadratic form as follows:

[0021]

[0022] Among them, K p Represents the basic quadratic error matrix of the plane, and the formula is:

[0023]

[0024] S23: By K P Calculate the square of the distance from any vertex in space to the triangle, then the quadratic error matrix formula of the vertex is:

[0025]

[0026] Where Q(v) represents the quadratic error matrix.

[0027] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S3 comprises the following sub-steps:

[0028] S31: For a given vertex contraction pair but The quadratic error matrix and error formula are:

[0029]

[0030] in, represent The quadratic error matrix is and Respectively represent the quadratic error matrices of the two vertices v1 and v2 of this edge, and q represents the parameters of the quadratic error equation;

[0031] in, represent The error measure of

[0032] S32: For each divide-and-conquer structure, sort all points according to a certain dimension and select the midpoint to divide the point set equally. Let the one-dimensional coordinate of the midpoint be x. Then only the points with coordinates in [xt, x+t] can form a legal point pair.

[0033] Where t represents the artificially set distance threshold;

[0034] S33: Use a brute force algorithm with square time to find all pairs of points in the range [xt, x+t], and recursively process two sub-problems through KD-Tree tree construction and query operations;

[0035] S34: If the point set is evenly distributed, the number of points with coordinates in [xt,x+t] is a constant, and the total time complexity formula is:

[0036] T(n c )=2T(n c / 2)+O(n c lognc )=O(n c log 2 n c )

[0037] Among them, T(n c ) represents the time complexity, n c =|V|, where V represents the number of points in [xt,x+t].

[0038] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S4 comprises the following sub-steps:

[0039] S41: By calculation The local minimum of the error yields the best position for the new vertex:

[0040] when When reversible, calculate the optimal position of the new vertex, the formula is:

[0041]

[0042] in, Represents the optimal position of the new vertex;

[0043] when When it is irreversible, select v1, v2 or (v1+v2) / 2 as the new vertex, and the error of the new vertex is used as the folding cost of the corresponding edge. The algorithm selects the edge with the minimum cost to fold in turn until there is no edge to fold;

[0044] Among them, v1 and v2 represent the two vertices of the folded edge.

[0045] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S5 comprises the following sub-steps:

[0046] S51: Calculate the surface normal vector. The formula is:

[0047]

[0048] Among them, n avg Represents the average normal vector of the vertex, i+1 and N represent the number of adjacent surfaces of the vertex, and n i represents the normal vector of the i-th face;

[0049] Among them, θ n Represents the angle between the normal vectors of two vertices, n1 and n2 represent the normal vectors of the two vertices v1 and v2 respectively;

[0050] Among them, Cur(v i ) represents the vertex approximate curvature, f represents any vertex of the three-dimensional model, NP(vi ) represents the vertex v i All vertices in the first-order neighborhood, A f represents the area of ​​the triangle;

[0051] S52: Calculate the approximate curvature of each edge using the formula:

[0052] Cur(edge(v i ,v j ))=|Cur(v i )|×ω i +|Cur(v j )|×ω j

[0053]

[0054] Among them, Cur(v i ) and Cur(v j ) represent the approximate curvatures of the two endpoints v1 and v2 of edge e, edge represents the edge, ω i and ω j Represents the weight of calculating the approximate curvature of the edge, A i Represents the area of ​​the first-order neighborhood triangle of a vertex.

[0055] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S6 comprises the following sub-steps:

[0056] S61: Set is the surface density in the first-order neighborhood of vertex v, k is the number of triangles in the first-order neighborhood of vertex v, A i Represents the area of ​​the i-th triangle, and the area of ​​the triangle is calculated using Heron's formula:

[0057]

[0058] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S7 comprises the following sub-steps:

[0059] S71: When calculating the collapse cost of a point pair, for each pair of adjacent faces, additionally determine whether there is a flipping phenomenon:

[0060] If the angle between the original normal vector and the collapsed normal vector exceeds 180 degrees, a flipping phenomenon occurs and a penalty is applied, setting the cost of the point pair where the flipping phenomenon occurs to infinity;

[0061] If the angle between the original normal vector and the collapsed normal vector does not exceed 180 degrees, no flipping occurs;

[0062] S72: When selecting a pair of collapse points, if an edge only serves as the boundary of a patch, it is a boundary point and is excluded;

[0063] S73: Calculate the optimized cost function, the formula is:

[0064]

[0065] in, represents the cost function, v0 represents the newly generated point after folding the edge, ρ(v i ) represents v i The surface density, Dis(v i , v j ) represents the distance between two vertices v1 and v2.

[0066] The beneficial effects of the present invention are as follows: a region-preserving quadratic error measurement grid simplification method based on fast retrieval is used to introduce vertex neighborhood area, vertex Gaussian curvature, and boundary folding cost simplification factor to change the folding cost of the edge and optimize the simplification process; a KD-Tree data structure is used to accelerate the search for legal point pairs, reduce the complexity of the algorithm, effectively maintain the characteristics of high curvature areas of the grid model, maintain the geometric structure of the grid, and eliminate narrow and long triangles; the simplified model has good visual effects and maintains a high simplification accuracy at a high simplification rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 is a flow chart of the method.

[0068] Figure 2 It is the 3D model normal map.

[0069] Figure 3 It is an example of surface density. DETAILED DESCRIPTION

[0070] The present invention is further described below, but the protection scope of the present invention is not limited to the following description.

[0071] As attached Figure 1 As shown, a method for simplifying a measurement grid based on fast retrieval and region-preserving quadratic error includes the following steps:

[0072] S1: The system loads the simplified 3D model file, parses the model file, and extracts the vertex, edge, and face information of the model;

[0073] S2: Read the mesh file, obtain the original 3D mesh information, traverse each vertex in the mesh, and calculate the quadratic error matrix of each vertex;

[0074] S3: Find all legal point pairs by edge connection or distance, using KD-Tree tree building and query operations;

[0075] S4: Calculate the minimum collapse error for each legal point pair and calculate the new point position after collapse;

[0076] S5: Calculate the face normal vector for each vertex, and calculate the approximate curvature of each edge by using the coordinate information of the vertex and adjacent vertices;

[0077] S6: Use the average area of ​​surface density as the penalty factor to reduce the folding priority of edges located in small and numerous triangle areas, so that edges in flat areas are folded first;

[0078] S7: Repeat folding to find a point pair with the smallest error, merge them into one point, update the Q matrix of adjacent points and the cost of corresponding point pairs to meet the simplification ratio requirement;

[0079] S8: Smooth the simplified model to eliminate the tiny unevenness caused by folding. Check and repair the geometric structure anomaly. Check whether the simplified model has any geometric structure anomaly and perform repair operations.

[0080] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein step S2 comprises the following sub-steps:

[0081] S21: Predefine a 4×4 error matrix Q for each vertex in the grid. The error form of the vertex determines the quadratic term (v) = v T Qv, associates each vertex in space with the plane it is on, and defines the error as the sum of the quadratic distances between the point and the plane set, with the formula:

[0082]

[0083] Among them, ([v x v y v z 1]) T represents the error form of the vertex, Δ(v) represents the quadratic error matrix of the vertex, p = [abcd] T Represented by equation a 2 +b 2 +c 2 = 1, v represents the vertex, and planes(v) represents the set of all triangular planes containing vertex v;

[0084] S22: Rewrite the error metric into a quadratic form as follows:

[0085]

[0086] Among them, K p Represents the basic quadratic error matrix of the plane, and the formula is:

[0087]

[0088] S23: By K P Calculate the square of the distance from any vertex in space to the triangle, then the quadratic error matrix formula of the vertex is:

[0089]

[0090] Where Q(v) represents the quadratic error matrix.

[0091] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S3 comprises the following sub-steps:

[0092] S31: For a given vertex contraction pair but The quadratic error matrix and error formula are:

[0093]

[0094] in, represent The quadratic error matrix is and Respectively represent the quadratic error matrices of the two vertices v1 and v2 of this edge, and q represents the parameters of the quadratic error equation;

[0095] in, represent The error measure of

[0096] S32: For each divide-and-conquer structure, sort all points according to a certain dimension and select the midpoint to divide the point set equally. Let the one-dimensional coordinate of the midpoint be x. Then only the points with coordinates in [xt, x+t] can form a legal point pair.

[0097] Where t represents the artificially set distance threshold;

[0098] S33: Use a brute force algorithm with square time to find all pairs of points in the range [xt, x+t], and recursively process two sub-problems through KD-Tree tree construction and query operations;

[0099] S34: If the point set is evenly distributed, the number of points with coordinates in [xt,x+t] is a constant, and the total time complexity formula is:

[0100] T(n c )=2T(n c / 2)+O(n c logn c )=O(n c log2 n c )

[0101] Among them, T(n c ) represents the time complexity, n c =|V|, where V represents the number of points in [xt,x+t].

[0102] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S4 comprises the following sub-steps:

[0103] S41: By calculation The local minimum of the error yields the best position for the new vertex:

[0104] when When reversible, calculate the optimal position of the new vertex, the formula is:

[0105]

[0106] in, Represents the optimal position of the new vertex;

[0107] when When it is irreversible, select v1, v2 or (v1+v2) / 2 as the new vertex, and the error of the new vertex is used as the folding cost of the corresponding edge. The algorithm selects the edge with the minimum cost to fold in turn until there is no edge to fold;

[0108] Among them, v1 and v2 represent the two vertices of the folded edge.

[0109] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S5 comprises the following sub-steps:

[0110] As attached Figure 2 As shown, S51: calculate the surface normal vector, the formula is:

[0111]

[0112] Among them, n avg Represents the average normal vector of the vertex, i+1 and N represent the number of adjacent surfaces of the vertex, and n i represents the normal vector of the i-th face;

[0113] Among them, θ n Represents the angle between the normal vectors of two vertices, n1 and n2 represent the normal vectors of the two vertices v1 and v2 respectively;

[0114] Among them, Cur(v i ) represents the vertex approximate curvature, f represents any vertex of the three-dimensional model, NP(v i ) represents the vertex vi All vertices in the first-order neighborhood, A f represents the area of ​​the triangle;

[0115] S52: Calculate the approximate curvature of each edge using the formula:

[0116] Cur(edge(v i ,v j ))=|Cur(v i )|×ω i +|Cur(v j )|×ω j

[0117]

[0118] Among them, Cur(v i ) and Cur(v j ) represent the approximate curvatures of the two endpoints v1 and v2 of edge e, edge represents the edge, ω i and ω j Represents the weight of calculating the approximate curvature of the edge, A i Represents the area of ​​the first-order neighborhood triangle of a vertex.

[0119] The surface detail feature areas of 3D models often show the characteristics of dense triangles and small triangle areas. In such areas, folding edges can easily lead to the loss of geometric features. On the contrary, the triangles in flat areas are relatively sparse and the triangles have larger areas. Folding edges in these areas has little effect on the overall appearance of the model. The average area of ​​surface density is used as a penalty factor to reduce the folding priority of edges in areas with small and many triangles, and give priority to folding edges in flat areas. In this way, the original geometry of the model can be more effectively maintained while simplifying the model.

[0120] As attached Figure 3 As shown, the first-order neighborhood triangle refers to a triangle with edges consisting of points directly connected to a point in the model. The surface density of vertex v is T1, T2, T3, T4, T5, T6, T7, and the surface density of vertex p is T1, T2, T2, T3, T4, T5.

[0121] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S6 comprises the following sub-steps:

[0122] S61: Set is the surface density in the first-order neighborhood of vertex v, k is the number of triangles in the first-order neighborhood of vertex v, A i Represents the area of ​​the i-th triangle, and the area of ​​the triangle is calculated using Heron's formula:

[0123]

[0124] Furthermore, a method for simplifying a measurement grid based on a fast retrieval region-preserving quadratic error is provided, wherein S7 comprises the following sub-steps:

[0125] S71: When calculating the collapse cost of a point pair, for each pair of adjacent faces, additionally determine whether there is a flipping phenomenon:

[0126] If the angle between the original normal vector and the collapsed normal vector exceeds 180 degrees, a flipping phenomenon occurs and a penalty is applied, setting the cost of the point pair where the flipping phenomenon occurs to infinity;

[0127] If the angle between the original normal vector and the collapsed normal vector does not exceed 180 degrees, no flipping occurs;

[0128] S72: When selecting a pair of collapse points, if an edge only serves as the boundary of a patch, it is a boundary point and is excluded;

[0129] S73: Calculate the optimized cost function, the formula is:

[0130]

[0131] in, represents the cost function, v0 represents the newly generated point after folding the edge, ρ(v i ) represents v i The surface density, Dis(v i , v j ) represents the distance between two vertices v1 and v2.

[0132] Specific embodiment 1 A method for simplifying a measurement grid based on fast retrieval and region-preserving quadratic error, the implementation steps are as follows:

[0133] 1. Preprocessing stage

[0134] Model loading and parsing: First, load the 3D model file to be simplified (such as OBJ, STL and other formats) into the system. The system parses the model file and extracts the model's vertex information (including coordinates, normals, etc.), edge information (line segments connecting vertices) and face information (triangles or polygons formed by vertices).

[0135] Feature information calculation:

[0136] Surface density calculation: For each vertex, the number of facets within a certain radius around it is calculated as the surface density of the vertex. The surface density reflects the local density of the vertex in the model.

[0137] Vertex curvature calculation: Use the coordinate information of the vertex and its adjacent vertices to calculate the curvature of the vertex. Vertices with large curvature are usually located in the curved or feature areas of the model;

[0138] Vertex distance calculation: For each vertex, calculate the average distance between it and all adjacent vertices as the vertex distance of the vertex. The vertex distance reflects the closeness between the vertex and its adjacent vertices.

[0139] 2. Simplify factor setting and adjustment

[0140] Surface density factor: dynamically adjusts the folding cost of a vertex based on its surface density. Vertices with larger surface density have higher folding costs to preserve the detailed features in the model.

[0141] Vertex curvature factor: According to the curvature of the vertex, adjust its folding cost. Vertices with larger curvature (i.e., feature points) have higher folding costs to avoid losing important features during the simplification process.

[0142] Vertex distance factor: According to the vertex distance, the folding cost is adjusted. Vertex pairs with smaller vertex distance have higher folding costs to keep the local structure of the model stable.

[0143] Boundary folding cost adjustment: For vertices located at the boundary of the model, the folding cost is additionally increased to prevent the boundary from being distorted or broken during the simplification process.

[0144] 3. KD tree construction and accelerated search

[0145] KD tree construction: store the vertex information of the model (including coordinates, feature information, etc.) in the KD tree. The KD tree is a balanced binary tree used for multidimensional space search, which can efficiently perform nearest neighbor search;

[0146] Valid point pair search: Use the KD tree to perform nearest neighbor search to find the vertex pairs that need to be folded. For each vertex, quickly find its nearest neighbor through the KD tree, and calculate the folding cost of the vertex pair based on the simplification factor.

[0147] 4. Simplify the iteration process

[0148] Select folding vertex pairs: According to the folding cost, select the vertex pair with the minimum cost for folding. During the folding process, it is necessary to update the coordinates, normals and other information of the folded vertices, and delete or update the related edge and face information;

[0149] Update model structure: After folding the vertex pairs, update the vertex, edge and face information of the model to maintain the integrity of the model. At the same time, recalculate the feature information of the affected vertices (such as surface density, vertex curvature, etc.) according to the folded model structure;

[0150] Iteration termination condition: Repeat the above steps until the predetermined simplification rate is reached (such as the number of vertices is reduced to a certain proportion) or the model quality meets the requirements (such as the Hausdorff distance is less than a certain threshold).

[0151] 5. Post-processing stage

[0152] Smoothing: Smoothing the simplified model to eliminate the tiny unevenness caused by folding. Smoothing can be achieved through Laplace smoothing, mesh optimization and other methods.

[0153] Geometric anomaly inspection and repair: Check the simplified model for geometric anomalies (such as cracks, overlaps, etc.) and perform necessary repair operations. Repair operations can include vertex repositioning, edge and face reconstruction, etc.

[0154] Specific embodiment 2 A method for simplifying the measurement grid based on fast retrieval and regional preservation of secondary errors, application prospects

[0155] 1. Game development: In game development, high-precision models often contain a large number of vertices and faces, resulting in low rendering efficiency. The lightweight 3D model optimization method of the present invention is used to simplify models such as characters and scenes in the game while maintaining the shape characteristics and visual quality of the models. For example, a complex character model may contain tens of thousands of vertices and faces. After being simplified by the algorithm of the present invention, the number of vertices can be significantly reduced, while the appearance and detail characteristics of the model are still retained. This can not only improve the rendering efficiency of the game, but also speed up the scene loading speed and enhance the player's gaming experience.

[0156] 2. Virtual reality (VR) and augmented reality (AR): In VR and AR applications, real-time rendering has extremely high performance requirements. Since these applications usually need to run under limited computing resources, it is necessary to lightweight the model to increase the rendering speed. The algorithm of the present invention can be applied to scene models, object models, etc. in VR / AR. By simplifying the model structure and reducing the rendering complexity, a smooth interactive experience can be ensured in the VR / AR environment. For example, in VR games, the algorithm of the present invention can be used to simplify the models of buildings, trees, etc. in the scene, which can significantly improve the fluency and stability of the game.

[0157] 3. Medical imaging: In the field of medical imaging, such as the processing and analysis of CT, MRI and other image data, it is often necessary to simplify and visualize the three-dimensional images. The algorithm of the present invention can be applied to the lightweight processing of medical image data. By simplifying the structure of the image model and reducing the complexity of the data, the processing and analysis speed of the image data can be accelerated. For example, in cardiac imaging, the algorithm of the present invention can be used to simplify the heart model, so that the structure and function of the heart can be more easily observed and analyzed.

[0158] 4. Cultural heritage protection: In the field of cultural heritage protection, digital reconstruction and three-dimensional modeling are common technical means. However, since cultural heritage models usually contain a large number of details and complex structures, the model files are large and difficult to process. By simplifying the cultural heritage models using the algorithm of the present invention, it is possible to reduce the complexity of the models while retaining the key features of the models, making them easier to store, transmit and display. For example, simplifying the three-dimensional model of an ancient building can make it easier to disseminate and share on the Internet, thereby promoting the digital protection and inheritance of cultural heritage.

[0159] 5. Industrial design and manufacturing: In the field of industrial design and manufacturing, 3D models are important tools for product design, manufacturing and simulation. However, complex model structures often lead to low calculation and rendering efficiency. Using the algorithm of the present invention to simplify the 3D models in industrial design and manufacturing can improve the calculation and rendering speed and reduce the consumption of computing resources. For example, in automobile manufacturing, using the algorithm of the present invention to simplify the 3D model of the automobile body can speed up the simulation and analysis process and improve the design efficiency and quality.

[0160] This scheme uses a region-preserving quadratic error measurement grid simplification method based on fast retrieval, and the beneficial effects are:

[0161] 1. Feature retention and structural integrity: By introducing simplification factors such as surface density, vertex curvature, vertex distance and boundary folding cost, the edge folding process is accurately controlled, effectively avoiding the common feature loss and geometric structure abnormalities in traditional QEM algorithms, and ensuring the high fidelity and structural integrity of the simplified model;

[0162] 2. Improved algorithm efficiency: The KD tree principle is used to accelerate the search for valid point pairs, significantly reducing the algorithm's computational complexity, thereby improving the overall processing efficiency. This allows lightweight processing to be completed more quickly while maintaining model quality, shortening model processing time;

[0163] 3. The Hausdorff distance is greatly reduced: Experimental verification shows that compared with the original QEM algorithm, while maintaining high-precision features, the Hausdorff distance is reduced by at least 84.95%, and the geometric difference between the simplified model and the original model is significantly reduced, further improving the accuracy and usability of the model;

[0164] 4. Broad application prospects: It is not only applicable to the fields of 3D modeling and rendering, but can also be widely used in the transmission, storage and subsequent processing of 3D models. By providing efficient and reliable lightweight solutions, it will help promote the application and development of 3D technology in more fields.

[0165] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for simplifying measurement grids with regional preservation of quadratic errors based on rapid retrieval, characterized in that: The following steps are involved: S1: The system loads the simplified 3D model file, parses the model file, and extracts the vertex, edge, and face information of the model; S2: Read the mesh file, obtain the original 3D mesh information, traverse each vertex in the mesh, and calculate the quadratic error matrix of each vertex; S3: Find all legal point pairs by edge connection or distance, using KD-Tree tree building and query operations; S4: Calculate the minimum collapse error for each legal point pair and calculate the new point position after collapse; S5: Calculate the face normal vector for each vertex, and calculate the approximate curvature of each edge by using the coordinate information of the vertex and adjacent vertices; S6: Use the average area of ​​surface density as the penalty factor to reduce the folding priority of edges located in small and numerous triangle areas, so that edges in flat areas are folded first; S7: Repeat folding to find a point pair with the smallest error, merge them into one point, update the Q matrix of adjacent points and the cost of corresponding point pairs to meet the simplification ratio requirement; S8: Smooth the simplified model to eliminate the tiny unevenness caused by folding. Check and repair the geometric structure anomaly. Check whether the simplified model has any geometric structure anomaly and perform repair operations.

2. The method for simplifying the measurement grid based on fast retrieval and region-preserving quadratic error according to claim 1 is characterized in that: The step S2 comprises the following sub-steps: S21: Predefine a 4×4 error matrix Q for each vertex in the grid. The error form of the vertex determines the quadratic term (v) = v T Qv, associates each vertex in space with the plane it is on, and defines the error as the sum of the quadratic distances between the point and the plane set, with the formula: Among them, ([v x v y v z 1]) T represents the error form of the vertex, Δ(v) represents the quadratic error matrix of the vertex, p = [abcd] T Represented by equation a 2 +b 2 +c 2 = 1, v represents the vertex, and planes(v) represents the set of all triangular planes containing vertex v; S22: Rewrite the error metric into a quadratic form as follows: Among them, K p Represents the basic quadratic error matrix of the plane, and the formula is: S23: By K P Calculate the square of the distance from any vertex in space to the triangle, then the quadratic error matrix formula of the vertex is: Where Q(v) represents the quadratic error matrix.

3. The method for simplifying the measurement grid based on fast retrieval and region-preserving quadratic error according to claim 1, characterized in that: The S3 comprises the following sub-steps: S31: For a given vertex contraction pair but The quadratic error matrix and error formula are: in, represent The quadratic error matrix is and Respectively represent the quadratic error matrices of the two vertices v1 and v2 of this edge, and q represents the parameters of the quadratic error equation; in, represent The error measure of S32: For each divide-and-conquer structure, sort all points according to a certain dimension and select the midpoint to divide the point set equally. Let the one-dimensional coordinate of the midpoint be x. Then only the points with coordinates in [xt, x+t] can form a legal point pair. Where t represents the artificially set distance threshold; S33: Use a brute force algorithm with square time to find all pairs of points in the range [xt, x+t], and recursively process two sub-problems through KD-Tree tree construction and query operations; S34: If the point set is evenly distributed, the number of points with coordinates in [xt,x+t] is a constant, and the total time complexity formula is: T(n c )=2T(n c / 2)+O(n c log c )=O(n c log 2 n c ) Among them, T(n c ) represents the time complexity, n c =|V|, where V represents the number of points in [xt,x+t].

4. The method for simplifying the measurement grid based on fast retrieval and region-preserving quadratic error according to claim 1, characterized in that: The S4 comprises the following sub-steps: S41: Get the optimal position of the new vertex by calculating the local minimum of the v error: When Q v When reversible, calculate the optimal position of the new vertex, the formula is: in, Represents the optimal position of the new vertex; when When it is irreversible, select v1, v2 or (v1+v2) / 2 as the new vertex, and the error of the new vertex is used as the folding cost of the corresponding edge. The algorithm selects the edge with the minimum cost to fold in turn until there is no edge to fold; Among them, v1 and v2 represent the two vertices of the folded edge.

5. The method for simplifying the measurement grid based on fast retrieval and region-preserving quadratic error according to claim 1, characterized in that: The S5 comprises the following sub-steps: S51: Calculate the surface normal vector. The formula is: Among them, n avg Represents the average normal vector of the vertex, i+1 and N represent the number of adjacent surfaces of the vertex, and n i represents the normal vector of the i-th face; Among them, θ n Represents the angle between the normal vectors of two vertices, n1 and n2 represent the normal vectors of the two vertices v1 and v2 respectively; Among them, Cur(v i ) represents the vertex approximate curvature, f represents any vertex of the three-dimensional model, NP(v i ) represents the vertex v i All vertices in the first-order neighborhood, A f represents the area of ​​the triangle; S52: Calculate the approximate curvature of each edge using the formula: Cur(edge(v i ,v j ))=Cur(v i )×ω i +Cur(v j )×ω j Among them, Cur(v i ) and Cur(v j ) represent the approximate curvatures of the two endpoints v1 and v2 of edge e, edge represents the edge, ω i and ω j Represents the weight of calculating the approximate curvature of the edge, A i Represents the area of ​​the first-order neighborhood triangle of a vertex.

6. The method for simplifying the measurement grid based on fast retrieval and region-preserving quadratic error according to claim 1, characterized in that: The S6 comprises the following sub-steps: S61: Let A v is the surface density in the first-order neighborhood of vertex v, k is the number of triangles in the first-order neighborhood of vertex v, A i Represents the area of ​​the i-th triangle, and the area of ​​the triangle is calculated using Heron's formula:

7. The method for simplifying the measurement grid based on fast retrieval and region-preserving quadratic error according to claim 1, characterized in that: The S7 comprises the following sub-steps: S71: When calculating the collapse cost of a point pair, for each pair of adjacent faces, additionally determine whether there is a flipping phenomenon: If the angle between the original normal vector and the collapsed normal vector exceeds 180 degrees, a flipping phenomenon occurs and a penalty is applied, setting the cost of the point pair where the flipping phenomenon occurs to infinity; If the angle between the original normal vector and the collapsed normal vector does not exceed 180 degrees, no flipping occurs; S72: When selecting a pair of collapse points, if an edge only serves as the boundary of a patch, it is a boundary point and is excluded; S73: Calculate the optimized cost function, the formula is: in, represents the cost function, v0 represents the newly generated point after folding the edge, ρ(v i ) represents v i The surface density, Dis(v i , v j ) represents the distance between two vertices v1 and v2.

Citation Information

Patent Citations

  • Area and normal vector-based grid simplification method for unsmooth surfaces

    CN107564105A

  • A prediction-correction model-based mesh simplification method

    CN109035405A

  • Three-dimensional grid model simplification method and system based on optimized feature preservation

    CN111667565A

Cited By

  • Three-dimensional grid model simplification method and device, equipment and medium

    CN120807838A

  • A three-dimensional mesh model simplification method, device, equipment and medium

    CN120807838B

  • Regional simplification method of building three-dimensional model based on deep learning

    CN121330217A