Simplification method and device of three-dimensional model, electronic equipment and storage medium
By segmenting a 3D model into multiple feature heterogeneous regions and dynamically allocating simplification rates, the problem of low simplification quality in existing 3D models is solved, achieving a high-efficiency and high-quality simplification effect suitable for real-time rendering and industrial design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-04-10
AI Technical Summary
Existing 3D model simplification methods suffer from low simplification quality, easily losing important local features and/or retaining too much mesh, failing to effectively balance simplification rate and detail preservation.
By acquiring the geometric attribute information of the 3D model, a heat core matrix is constructed and spectral clustering is performed to divide the model into multiple feature heterogeneous regions. The simplification rate threshold is dynamically allocated according to the feature intensity value of the region, and the model is iteratively simplified through the edge folding algorithm to retain key features and reduce unnecessary meshes.
It achieves efficient and high-quality simplification of 3D models while preserving key features, making it suitable for real-time rendering and industrial design. It significantly reduces feature blurring and visual abrupt changes caused by the simplification of distant objects, and accurately preserves key geometric features.
Smart Images

Figure CN121837540A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device and storage medium for simplifying three-dimensional models. Background Technology
[0002] With the continuous development of computer graphics and computer vision technologies, 3D models have been widely used in various fields, such as video games, virtual reality, augmented reality, and industrial design. However, complex 3D models often face problems such as high computational burden and storage consumption, especially in real-time rendering scenarios. Therefore, model simplification techniques have emerged to help improve processing and rendering efficiency. Currently, there are three main mesh model simplification methods: vertex clustering, vertex culling, and edge folding.
[0003] Vertex clustering is a method to simplify a 3D model by dividing the 3D space into multiple small mesh units (e.g., a cube) and aggregating the vertices within each mesh unit. Vertex pruning is a technique to simplify a mesh model by selectively deleting vertices. After deleting vertices, the connectivity of other vertices and faces is updated to ensure mesh connectivity, resulting in a simplified mesh. Edge folding reduces the number of polygons by selectively folding edges into points, thereby reducing the number of faces in the model.
[0004] Current simplification methods have low simplification quality, are prone to losing important local features and / or retaining too much mesh. Summary of the Invention
[0005] This invention provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for simplifying three-dimensional models, in order to solve the problem of low simplification quality that is common in existing simplification methods.
[0006] To solve the above-mentioned technical problems, the present invention is implemented as follows:
[0007] In a first aspect, embodiments of the present invention provide a method for simplifying a three-dimensional model, comprising: acquiring geometric attribute information corresponding to multiple triangular facets in the three-dimensional model; determining the facet distance between two adjacent triangular facets based on the geometric attribute information corresponding to two adjacent triangular facets; constructing a heat kernel matrix based on the facet distance, wherein the element values in the heat kernel matrix represent the similarity between adjacent triangular facets, and the similarity between adjacent triangular facets is determined by the facet distance; dividing the three-dimensional model into K sub-regions based on the heat kernel matrix using a spectral clustering algorithm; determining simplification rate thresholds corresponding to the K sub-regions based on the feature intensity values corresponding to the K sub-regions, wherein the simplification rate threshold corresponding to the sub-region with a higher feature intensity value is lower than the simplification rate threshold corresponding to the sub-region with a lower feature intensity value; and simplifying the three-dimensional model based on the simplification rate thresholds corresponding to the K sub-regions.
[0008] In some embodiments, determining the face distance between two adjacent triangular facets based on their respective geometric attribute information includes: determining the geodesic distance and cosine distance between two adjacent triangular facets based on their respective geometric attribute information; and adaptively fusing the geodesic distance and cosine distance according to their respective weights to obtain the face distance.
[0009] In some embodiments, segmenting a 3D model into K sub-regions using a spectral clustering algorithm based on a heat kernel matrix includes: constructing a normalized Laplacian matrix based on the heat kernel matrix; calculating multiple eigenvalues of the normalized Laplacian matrix and eigenvectors corresponding to each eigenvalue; determining the number K sub-regions based on the distribution of the multiple eigenvalues; determining a K-dimensional feature representation for each triangular facet based on the K eigenvectors corresponding to the K smallest eigenvalues among the multiple eigenvalues; and clustering the triangular facets based on their K-dimensional feature representations to segment the 3D model into K sub-regions, wherein the similarity between any two triangular facets within the same sub-region is higher than the similarity between triangular facets within the region and triangular facets outside the region.
[0010] In some embodiments, determining the simplification thresholds corresponding to the K sub-regions based on the feature intensity values corresponding to the K sub-regions respectively includes: dividing the K sub-regions into at least one category based on the feature intensity values corresponding to the K sub-regions respectively; and determining the simplification threshold corresponding to the sub-regions of each category according to a preset mapping relationship between the categories and the simplification thresholds.
[0011] In some embodiments, simplifying a 3D model based on simplification rate thresholds corresponding to K sub-regions includes: constructing an edge folding queue, wherein multiple edges to be folded are arranged in descending order of their corresponding folding costs, and the folding cost of an edge to be folded is determined based on the feature intensity value of the sub-region where the edge to be folded is located and whether the vertex of the edge to be folded is a critical vertex; iteratively selecting a target edge with the minimum folding cost from the edge folding queue and performing a folding operation on the target edge to simplify the 3D model; and during the iterative execution of edge folding, stopping the folding operation on edges located in a sub-region in response to the current simplification rate of a sub-region being greater than or equal to the corresponding simplification rate threshold.
[0012] In some embodiments, iteratively selecting the target edge with the minimum folding cost from the edge folding queue and performing a folding operation on the target edge includes: performing a folding operation on the target edge if the target edge meets a preset folding condition; wherein the preset folding condition includes any one of the following: the target edge is a non-boundary edge within a sub-region; or, the target edge is a boundary edge between two sub-regions, and the difference between the feature intensity values corresponding to the two sub-regions is less than a preset threshold.
[0013] In some embodiments, the folding cost corresponding to an edge to be folded is determined based on the feature intensity value of the sub-region where the edge to be folded is located and whether the vertex of the edge to be folded is a critical vertex, including: determining a basic folding cost based on the quadratic error matrix of the two vertices of the edge to be folded; determining a first weight value based on the feature intensity of one or more sub-regions associated with the edge to be folded; determining a second weight value based on whether the vertex of the edge to be folded is a critical vertex; and jointly weighting the basic folding cost using the first weight value and the second weight value to obtain the folding cost corresponding to the edge to be folded.
[0014] In some embodiments, the simplification method for a three-dimensional model provided by the present invention further includes: constructing a scale space corresponding to the three-dimensional model; detecting local extrema with scale invariance in the scale space; using vertices in the three-dimensional model associated with local extrema as candidate key points; calculating the corresponding stability metric value based on the second-order differential operator at each candidate key point; and using the candidate key points whose stability metric value is greater than a preset stability threshold as key vertices.
[0015] Secondly, embodiments of the present invention provide a simplification device for a three-dimensional model, comprising: an acquisition module for acquiring geometric attribute information corresponding to multiple triangular facets in the three-dimensional model; a determination module for determining the facet distance between two adjacent triangular facets based on the geometric attribute information corresponding to two adjacent triangular facets; a construction module for constructing a heat kernel matrix based on the facet distance determined by the determination module, wherein the element values in the heat kernel matrix represent the similarity between adjacent triangular facets, and the similarity between adjacent triangular facets is determined by the facet distance; a segmentation module for segmenting the three-dimensional model into K sub-regions based on the heat kernel matrix constructed by the construction module using a spectral clustering algorithm; the determination module is further configured to determine simplification rate thresholds corresponding to the K sub-regions based on the feature intensity values corresponding to the K sub-regions segmented by the segmentation module, wherein the simplification rate threshold corresponding to the sub-region with a higher feature intensity value is less than the simplification rate threshold corresponding to the sub-region with a lower feature intensity value; and a simplification module for simplifying the three-dimensional model based on the simplification rate thresholds corresponding to the K sub-regions determined by the determination module.
[0016] Thirdly, embodiments of the present invention provide an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, it implements the steps of the simplification method for the three-dimensional model as described in the first aspect above.
[0017] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the simplification method for the three-dimensional model as described in the first aspect above.
[0018] Fifthly, embodiments of the present invention provide a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the simplification method for a three-dimensional model as described in the first aspect above.
[0019] In this embodiment of the invention, the 3D model is segmented into multiple feature heterogeneous sub-regions: the 3D model is decomposed into basic triangular facet units, and the facet distance between two adjacent triangular facets is determined based on the geometric attribute information corresponding to each adjacent triangular facet; a heat kernel matrix is constructed based on the facet distance. Then, based on the heat kernel matrix, the 3D model is segmented into K sub-regions using a spectral clustering algorithm. Further, based on the feature intensity values corresponding to each of the K sub-regions, a simplification rate threshold is determined for each of the K sub-regions, with the simplification rate threshold for sub-regions with higher feature intensity values being lower than that for sub-regions with lower feature intensity values. Then, based on the simplification rate thresholds corresponding to each of the K sub-regions, the 3D model is simplified. In this embodiment of the invention, the model is segmented into multiple feature heterogeneous sub-regions, and these regions are graded and mapped to corresponding preset simplification rate thresholds. In this way, important local features of the 3D model can be preserved as much as possible, unnecessary meshes can be reduced, and the simplification quality of the 3D model can be improved. Attached Figure Description
[0020] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0021] Figure 1 A flowchart illustrating a method for simplifying a three-dimensional model, as provided in an embodiment of the present invention;
[0022] Figure 2 A flowchart illustrating another simplified method for creating a three-dimensional model, as provided in an embodiment of the present invention;
[0023] Figure 3 This is a schematic flowchart illustrating an edge folding process provided in an embodiment of the present invention;
[0024] Figure 4 A simplified structural diagram of a three-dimensional modeling device provided in an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] As mentioned earlier, existing technologies generally suffer from low simplification quality. Specifically, there is a common problem of detail loss, potentially omitting important geometric features and details, especially in complex boundaries or delicate surface areas. Many current solutions employ edge-folding algorithms or make some improvements, but it is difficult to balance simplification rate and detail preservation. In some cases, folding in key areas of the model can lead to local shape distortion; for example, simplification may result in narrow triangular structures, affecting the overall visual effect. Conversely, excessive focus on detail preservation leads to an excessively low simplification rate, significantly diminishing the significance of model simplification. Furthermore, most mesh simplification algorithms typically set a uniform simplification rate for the entire model, resulting in an overly uniform overall simplification rate. High simplification rates easily lose important local features, while low simplification rates retain too much mesh in relatively flat areas.
[0028] In view of this, embodiments of the present invention provide a method for simplifying a three-dimensional model, which divides the three-dimensional model into multiple feature heterogeneous regions, and can achieve efficient and high-quality simplification of the three-dimensional model mesh while preserving key features.
[0029] The 3D model simplification method provided in this invention is particularly suitable for scenarios requiring high fidelity and efficient processing of 3D models. For example, in the field of real-time rendering (such as large-scale games and VR / AR), this method can generate high-quality, detailed models for complex scenes, significantly reducing feature blurring and visual abrupt changes caused by the simplification of distant objects. In the field of industrial design, this method can perform high-quality simplification of CAD models or real-world 3D models, accurately preserving key geometric features and semantic structures such as assembly interfaces, moving parts, and architectural outlines.
[0030] Please refer to Figure 1 This invention provides a method for simplifying a three-dimensional model, comprising the following steps:
[0031] S110. Obtain the geometric attribute information corresponding to multiple triangular facets in the 3D model.
[0032] In some embodiments, a three-dimensional model (hereinafter referred to as the "model") can be decomposed into basic triangular facet units, and the geometric attribute information of the triangular facets can be recorded. For example, all triangular facets can be extracted from the three-dimensional model, and their vertex coordinates and normal vectors can be recorded.
[0033] In some embodiments, the simplified 3D model needs to be preprocessed to ensure its quality and consistency. Taking the original 3D model (OBJ / STL format), containing a vertex set V, an edge set E, and a face set F as an example, the preprocessing workflow includes the following steps:
[0034] Normal Vector Consistency: Ensures that the normal vectors of the model have consistent directions to avoid rendering anomalies caused by inconsistent normal vectors. Calculate the normal vector for each triangle of the model and unify its direction by checking the consistency of normal vectors in adjacent triangles. Select a reference triangle. Its normal vector is Referring to formula (1), based on the adjacency relationship of the face patches, breadth-first search (BFS) is used to traverse the adjacent face patches and adjust the direction of the normal vector:
[0035] (1)
[0036] In formula (1), Let represent the unadjusted normal vector of any face in the face set F. This represents the adjusted normal vector.
[0037] Topology repair: Repairs non-manifold edges (adjacent face count > 2) and isolated vertices.
[0038] Non-manifold processing: Detect and repair any non-manifold structures (such as vertices connecting multiple discontinuous faces) that may exist in the model to ensure topological consistency. Refer to formula (2), merging distances less than a threshold. Vertex:
[0039] (2)
[0040] In formula (2), and Let V represent the coordinates of any two vertices in the vertex set V. This represents the coordinates of the vertex obtained by merging the two vertices.
[0041] Isolated vertex removal: Delete vertices with zero adjacent faces.
[0042] Data standardization: Scaling the 3D model to a unit cube to eliminate the effects of scale differences.
[0043] S120. Determine the face distance between two adjacent triangular facets based on the geometric attribute information corresponding to each of the two adjacent triangular facets.
[0044] In some embodiments, based on the geometric attribute information corresponding to two adjacent triangular facets, the geodesic distance and cosine distance between two adjacent triangular facets are determined respectively; and the geodesic distance and cosine distance are adaptively fused according to their respective weights to obtain the facet distance between adjacent facets.
[0045] Specifically, adjacent facets with dough pieces Geodesic distance between It can be calculated according to formula (3):
[0046] (3)
[0047] in , For the center of the dough, Given the midpoint of the common edge, the sum of the distances from the centroids of the two faces to the midpoint of the common edge is the geodesic distance. .
[0048] Adjacent face with dough pieces Cosine distance between It can be calculated according to formula (4):
[0049] (4)
[0050] in, and Representing adjacent patches with dough pieces The normal vector.
[0051] The geodesic distance and cosine distance calculated above can be adaptively fused according to formula (5) to obtain the final patch distance. :
[0052] (5)
[0053] in, , This represents the magnitude of the gradient of the normal vector. k is a positive real number greater than 0, and its actual value is set according to requirements.
[0054] S130. Based on the facet distance, construct a heat kernel matrix. The values of the elements in the heat kernel matrix represent the similarity between adjacent triangular faces. The similarity between adjacent triangular faces is determined by the facet distance.
[0055] In some embodiments, a heat kernel matrix (also known as a similarity matrix or heat kernel similarity matrix) is used to capture the geometric and topological information of the model, providing a basis for subsequent model segmentation.
[0056] Based on the extracted triangular facets, the heat core matrix W is calculated using the following formula (6).
[0057] (6)
[0058] in, For dough The average distance to the 10 nearest neighbors, For dough The average distance to the 10 nearest neighbors. It is the element in the i-th row and j-th column of the heat core matrix W, which can reflect the surface. with dough pieces Similarities and connections between them.
[0059] S140. Based on the heat core matrix, the 3D model is divided into K sub-regions using a spectral clustering algorithm.
[0060] Spectral clustering algorithms used for image segmentation typically construct a similarity matrix by calculating the Euclidean distance between two points. The Laplacian matrix is an important tool for image segmentation and feature analysis, reflecting the local geometric structure of the model. In some embodiments, a normalized Laplacian matrix is constructed based on the heat kernel matrix; multiple eigenvalues of the normalized Laplacian matrix and their corresponding eigenvectors are calculated; and the number of sub-regions K is determined based on the distribution of the multiple eigenvalues.
[0061] As one possible implementation, a normalized Laplace matrix is constructed based on the heat core matrix W. The eigenvalues and eigenvectors can be obtained by referring to the following formula (7):
[0062] (7)
[0063] Where D is the degree matrix, specifically a diagonal matrix, and the diagonal elements of matrix D are... .
[0064] In some embodiments, the eigenvalue gap method can be used to select the number of clusters. That is, the number of sub-regions, K. For example, it can be calculated... eigenvalues ,choose Limit 2 20.
[0065] Furthermore, a K-dimensional feature representation of each triangular facet can be determined based on the K feature vectors corresponding to the K smallest eigenvalues among multiple eigenvalues; and the triangular facets can be clustered based on their K-dimensional feature representations to segment the 3D model into K sub-regions. The similarity between any two triangular facets within the same sub-region is higher than the similarity between a triangular facet within the region and a triangular facet outside the region.
[0066] For example, the feature matrix U can be constructed by taking the first K feature vectors. The feature matrix is then subjected to L2 normalization. After L2 normalization of each row, k-means++ clustering is performed to divide the 3D model into K sub-regions.
[0067] In other words, firstly, a feature matrix is constructed: the first K feature vectors are selected and combined into an n × K dimensional feature matrix U, where n is the total number of triangular facets, and the i-th row of the feature matrix U is the K-dimensional feature representation of the i-th triangular facet. Next, normalization is performed: each row of the feature matrix U is normalized using the L2 norm, converting the K-dimensional feature representation of each triangular facet into a unit vector. Finally, each row of the normalized feature matrix U is treated as a data point, and the K-means++ clustering algorithm is executed in K-dimensional space to divide the n triangular facets into K clusters, each cluster corresponding to a sub-region. Thus, the sub-regions formed after clustering satisfy the following characteristics: any two triangular facets belonging to the same sub-region (i.e., the same cluster) have a relatively short Euclidean distance in the K-dimensional feature space, directly reflecting their high similarity; while triangular facets belonging to different sub-regions have a relatively large distance in their K-dimensional feature representations in space, corresponding to lower similarity.
[0068] S150. Based on the feature intensity values corresponding to the K sub-regions, determine the simplification thresholds corresponding to the K sub-regions respectively. The simplification threshold corresponding to the sub-region with a high feature intensity value is less than the simplification threshold corresponding to the sub-region with a low feature intensity value.
[0069] In some embodiments, the K sub-regions are divided into at least one category based on the feature intensity values corresponding to the K sub-regions respectively; and the simplification threshold corresponding to each category of sub-regions is determined according to the preset mapping relationship between the category and the simplification threshold.
[0070] Intricate surfaces often project different light and shadow and reflections, and curves and irregular edges are more likely to attract attention, providing the brain with more information to judge the shape and depth of an object. Therefore, this invention uses the tortuosity of each region to measure the characteristic metric of that region, which is obtained by calculating discrete curvature.
[0071] In some embodiments, the feature intensity value corresponding to a sub-region can be determined based on the tortuosity of the sub-region. Further, the tortuosity of the sub-region can be obtained based on the integral curvature of the sub-region. As a possible implementation, the integral curvature of the sub-region can be calculated as follows:
[0072] For vertex Quadratic surface fitting is performed on the neighborhood patches to solve for the principal curvature. Based on the principal curvature obtained from the solution, the integral curvature (characteristic intensity value) of the sub-region is further calculated according to the following formula (8). :
[0073] (8)
[0074] Where R represents a sub-region. The area affected by the vertex. The area is the region.
[0075] In some embodiments, K regions are classified according to the integral curvature (feature intensity value) corresponding to each sub-region, and each category corresponds to a simplification rate upper limit. As an example, the sub-region simplification rate mapping table shown in Table 1 is generated by classifying categories based on integral curvature and binding simplification rate thresholds.
[0076] Table 1
[0077]
[0078] S160. Simplify the 3D model based on the simplification rate thresholds corresponding to K sub-regions.
[0079] Existing solutions often employ global homogenization simplification. These methods ignore the differences in feature distribution within the 3D model, using a globally uniform simplification strategy. This fails to adapt to the heterogeneous distribution of surface features in the 3D model, leading to geometric distortion and loss of detail in high-feature regions due to oversimplification, while reducing computational efficiency in low-feature regions by retaining redundant faces. In this invention, the model is divided into multiple feature-heterogeneous sub-regions, which improves the simplification quality of the 3D model.
[0080] In some embodiments, reference Figure 2 The process may include the following steps:
[0081] S210, Construct an edge-folding queue.
[0082] In the constructed edge folding queue, multiple edges to be folded are arranged in descending order of their corresponding folding costs. Edges with lower folding costs are folded first.
[0083] In some embodiments, when calculating the folding cost of the edge to be folded, region weights are injected based on sub-region weights and keypoint protection. And the key point protection factor. That is, the folding cost corresponding to an edge to be folded is determined based on the feature intensity value of the sub-region where the edge to be folded is located and whether the vertex of the edge to be folded is a key vertex.
[0084] As a specific implementation, the basic folding cost is determined based on the quadratic error matrix of the two vertices of the edge to be folded; a first weight value is determined based on the feature intensity of one or more sub-regions associated with the edge to be folded; a second weight value is determined based on whether the vertex of the edge to be folded is a critical vertex; and the basic folding cost is jointly weighted using the first weight value and the second weight value to obtain the folding cost corresponding to the edge to be folded.
[0085] For example, the traditional quadratic error metric QEM injection region and point-level feature weights are improved, and the folding cost is calculated with reference to the dynamic QEM cost function shown in the following formula (9):
[0086] (9)
[0087] in , It is the vertex The quadratic error matrix, = (Vertex quadratic error matrix); This is the region weight gain (i.e., the first weight). It is the domain complexity gain factor. For sub-regions with high feature intensity values ( >0.3), This significantly increases the folding cost and suppresses edge folding; for sub-regions with low feature intensity values ( 0.1), 0, with folding costs approaching those of traditional QEM, allowing for high-frequency folding. It is the key point protection factor (i.e., the second weight), if the endpoints of the edge to be folded If it is a critical vertex, then =1000, otherwise =1.
[0088] In some embodiments, a vertex may be identified as a key vertex (also known as a key point) by: constructing a scale space corresponding to the 3D model; detecting local extrema with scale invariance in the scale space; identifying vertices in the 3D model associated with the local extrema as candidate key points; calculating the corresponding stability metric based on the second-order differential operator at each candidate key point; and identifying candidate key points whose stability metric is greater than a preset stability threshold as key vertices.
[0089] For example, the SIFT (Scale-Invariant Feature Transform) algorithm is a widely used algorithm for image feature detection and description in image processing, computer vision, and machine learning. With appropriate modifications, this algorithm can be used for feature extraction from 3D models, finding key points in the 3D model, and generating a keypoint protection list.
[0090] First, construct a three-dimensional Gaussian pyramid. The key points of the three-dimensional model are usually local extrema. To find these points, Gaussian blur is used to construct the scale space. For three-dimensional data, the three-dimensional Gaussian function shown in the following formula (10) is convolved with the vertices of the three-dimensional model to obtain formula (11).
[0091] (10)
[0092] (11)
[0093] Where x, y, and z are spatial coordinates, The standard deviation of the Gaussian kernel. By using different... Value controls the degree of fuzziness. The smaller the value, the more detailed the information obtained. In the Gaussian pyramid, each level represents a specific... The data at each scale is arranged with the finest data at the bottom, and the data with gradually decreasing precision above it.
[0094] A three-dimensional Gaussian difference pyramid is obtained based on the three-dimensional Gaussian pyramid. Subtracting adjacent data from each layer of the Gaussian pyramid yields a series of new data, represented by the following formula (12). Arranging these data sequentially results in the Gaussian difference pyramid, where each layer represents the difference between adjacent scales.
[0095] (12)
[0096] The extreme points are obtained by finite difference values, and it is determined whether they are critical points. Each point... Each point must be compared with its neighborhood (including neighborhoods of different scales) within a specified radius to determine whether the difference value is the maximum or minimum. Is it a local extremum? Local extremum detection can be performed using the Hessian matrix shown in the following formula (13).
[0097] (13)
[0098] Key condition: det(H) = 0.8 , =0.005, non-maximum suppression radius 3 .
[0099] Existing solutions lack the ability to identify key structural points and specific protection mechanisms, making simplified topological features easily compromised. Examples include visually salient features (sculpted textures, sharp edges, etc.) and functional topological structures (assembly interfaces, motion joints, etc.). In this invention, by detecting key vertices and injecting sub-region weights and key point protection factors when calculating folding costs, visual and functional key points can be preserved, preventing the accidental folding of critical topological structures such as sharp edges and connection points.
[0100] In some embodiments, the edge folding queue can be managed based on the following principles: ① Use a red-black tree to maintain the edge folding queue, ensuring that the time complexity of insertion or deletion operations is O(n log n). O(log n) represents a time complexity notation. n represents the total number of edges in the 3D model, i.e., the maximum possible number of elements in the edge folding queue. Edges to be folded located in sub-regions with high feature strength values are always at the end of the queue due to their high folding cost; edges to be folded in sub-regions with low feature strength values are folded first. ② The simplification progress of each sub-region is monitored in real time. When the simplification rate of a sub-region exceeds a preset simplification rate threshold, the edge folding operation within that sub-region is temporarily frozen.
[0101] Based on the above principles, in some embodiments, the method for simplifying the three-dimensional model further includes the following steps:
[0102] S220. Iteratively select the target edge with the minimum folding cost from the edge folding queue, and perform the folding operation on the target edge to simplify the 3D model.
[0103] S230. During the iterative execution of edge folding, in response to the current simplification rate of a sub-region being greater than or equal to the corresponding simplification rate threshold, the folding operation on the edges located within that sub-region is stopped.
[0104] refer to Figure 3 The folding process includes the following steps:
[0105] S310. Determine whether the current simplification rate has reached the target simplification rate.
[0106] If the overall simplification rate of the 3D model does not reach the target simplification rate for that 3D model, then proceed with step S320; otherwise, end the edge folding operation. It is understood that the simplification rate of the 3D model differs from the simplification rate of the sub-regions.
[0107] S320. Remove the target edge from the edge folding queue.
[0108] S330, Determine whether a folding operation can be performed on the target.
[0109] In some embodiments, a folding operation is performed on the target edge if the target edge meets a preset folding condition. The preset folding condition includes any one of the following: the target edge is a non-boundary edge within a sub-region; or, the target edge is a boundary edge between two sub-regions, and the difference between the feature intensity values corresponding to the two sub-regions is less than a preset threshold, for example, the integral curvature values corresponding to the two sub-regions are relatively close. In other words, the conditions for prohibiting folding include: ① setting a cross-region folding freeze condition: if the curvature difference between the two sub-regions connected by the target edge to be folded is large, for example... ① Folding is prohibited; ② Key point protection condition: If any vertex of the target edge to be folded is a key vertex ( =1000), folding is prohibited.
[0110] Understandably, during the edge folding operation, the real-time simplification rate of the sub-region must be considered to determine whether to execute this step. That is, it checks whether the current simplification rate of the sub-region where the target edge is located has reached the preset simplification rate threshold. If it has, the edge folding operation for that sub-region is frozen.
[0111] If the target edge meets the preset folding conditions, then perform the following steps S340-S360 to complete the edge folding operation; otherwise, end the folding operation on the target edge and return to perform the above steps S320.
[0112] S340, Perform a folding operation on the target edge.
[0113] S350, Update the integral curvature of the affected sub-region.
[0114] In some embodiments, after performing a folding operation on the target edge (v1, v2), vertex merging can be performed to obtain a new vertex. The new vertex v new The position is determined by the weighted average of the two endpoints v1 and v2 of the original edge (target edge), with the weights being the area affected by each vertex. Vertex merging can be performed by referring to the following formula (14).
[0115] (14)
[0116] in and Let v1 and v2 represent the areas of influence of vertices v1 and v2, respectively. The area of influence of a vertex can be, for example, its Voronoi area. Then, the integral curvature of the subregion containing the collapsed target edge is updated using the new vertex. .
[0117] S360, Update the edge folding queue.
[0118] In some embodiments, invalid edges can be removed, new edges can be inserted, and their folding costs can be recalculated. In some cases, such as when the cumulative number of updated edges exceeds 5% of the total number of edges, global queue reconstruction can also be triggered.
[0119] Repeat the above steps until the current 3D model meets the preset conditions, then output the simplified 3D model. These preset conditions include: the 3D model's simplification rate reaches the target simplification rate. Or the current Hausdorff error value (referring to the maximum geometric deviation between the simplified model and the original model) exceeds the threshold. =0.1%.
[0120] In some embodiments, in addition to outputting a simplified 3D model (e.g., a 3D model saved in OBJ / STL format), keypoint coordinates and region hierarchical labels can also be output. These region hierarchical labels can identify the hierarchical information of the feature importance of each sub-region on the surface of the 3D model. For example, the hierarchical information can be provided through a mapping file that records the correspondence between each triangle or vertex and a feature level identifier. The feature level identifier represents the feature level, which is divided according to the feature intensity value of the sub-region. Referring to Table 1 above, three feature level identifiers can be set, corresponding to high-feature regions, medium-feature regions, and low-feature regions, respectively.
[0121] The edge folding process provided in this embodiment of the invention uses a red-black tree to dynamically maintain the folding priority queue, which can reduce time complexity; and by setting cross-region folding conditions, it protects feature boundaries and prevents the structure of the 3D model from being destroyed. In addition, this edge folding process can achieve high-speed folding of sub-regions with low feature intensity values to compensate for the inefficiency of sub-regions with high feature intensity values, maintaining overall simplification efficiency.
[0122] In summary, the simplification method for the 3D model provided in this invention achieves heterogeneous sub-region partitioning of the model by combining a hybrid feature distance metric (geodesic-cosine fusion) with thermonuclear spectrum clustering. It also dynamically allocates simplification rates by quantifying regional feature intensity using regional integral curvature. This transforms static simplification rate allocation into dynamic adjustment, preserving key features while satisfying the overall simplification objective.
[0123] Please refer to Figure 4 This invention also provides a simplification device 400 for three-dimensional models. The device 400 includes:
[0124] The acquisition module 410 is used to acquire the geometric attribute information corresponding to multiple triangular facets in the 3D model.
[0125] The determination module 420 is used to determine the face distance between two adjacent triangular facets based on the geometric attribute information corresponding to the two adjacent triangular facets.
[0126] The construction module 430 is used to construct a heat core matrix based on the facet distance determined by the determination module 420. The element values in the heat core matrix represent the similarity between adjacent triangular faces, and the similarity between adjacent triangular faces is determined by the facet distance.
[0127] The segmentation module 440 is used to segment the 3D model into K sub-regions based on the heat kernel matrix constructed by the building module and the spectral clustering algorithm.
[0128] The determining module 420 is also used to determine the simplification threshold corresponding to each of the K sub-regions based on the feature intensity values corresponding to the K sub-regions segmented by the segmentation module 440. The simplification threshold corresponding to the sub-region with a high feature intensity value is less than the simplification threshold corresponding to the sub-region with a low feature intensity value.
[0129] The simplification module 450 is used to simplify the 3D model based on the simplification rate thresholds corresponding to the K sub-regions determined by the determination module 420.
[0130] In some embodiments, the determining module 420 is further configured to determine the geodesic distance and cosine distance between two adjacent triangular facets based on the geometric attribute information corresponding to the two adjacent triangular facets respectively; and to adaptively fuse the geodesic distance and cosine distance according to their respective weights to obtain the facet distance.
[0131] In some embodiments, the segmentation module 440 is further configured to: construct a normalized Laplacian matrix based on the heat kernel matrix; calculate multiple eigenvalues of the normalized Laplacian matrix and eigenvectors corresponding to each eigenvalue; determine the number K of sub-regions based on the distribution of the multiple eigenvalues; determine a K-dimensional feature representation of each triangular facet based on the K eigenvectors corresponding to the K smallest eigenvalues among the multiple eigenvalues; and cluster the triangular facets based on the K-dimensional feature representations of each triangular facet to segment the 3D model into K sub-regions, wherein the similarity between any two triangular facets within the same sub-region is higher than the similarity between triangular facets within the region and triangular facets outside the region.
[0132] In some embodiments, the determining module 420 is further configured to divide the K sub-regions into at least one category based on the feature intensity values corresponding to the K sub-regions respectively; and to determine the simplification threshold corresponding to the sub-regions of each category according to a preset mapping relationship between the category and the simplification threshold.
[0133] In some embodiments, the construction module 430 is further configured to construct an edge folding queue, wherein multiple edges to be folded are arranged in descending order of their corresponding folding costs in the edge folding queue, and the folding cost corresponding to an edge to be folded is determined based on the feature intensity value of the sub-region where the edge to be folded is located and whether the vertex of the edge to be folded is a critical vertex. The simplification module 450 is further configured to iteratively select the target edge with the minimum folding cost from the edge folding queue and perform a folding operation on the target edge to simplify the 3D model; and is further configured to, during the iterative execution of edge folding, stop performing folding operations on edges located in a sub-region in response to the current simplification rate of a sub-region being greater than or equal to the corresponding simplification rate threshold.
[0134] In some embodiments, the simplification module 450 is further configured to perform a folding operation on the target edge when the target edge meets a preset folding condition; wherein the preset folding condition includes any one of the following: the target edge is a non-boundary edge within a sub-region; or, the target edge is a boundary edge between two sub-regions, and the difference between the feature intensity values corresponding to the two sub-regions is less than a preset threshold.
[0135] In some embodiments, the determining module 420 is further configured to determine the basic folding cost based on the quadratic error matrix of the two vertices of the edge to be folded; determine the first weight value based on the feature intensity of one or more sub-regions associated with the edge to be folded; determine the second weight value based on whether the vertex of the edge to be folded is a critical vertex; and jointly weight the basic folding cost using the first weight value and the second weight value to obtain the folding cost corresponding to the edge to be folded.
[0136] In some embodiments, the construction module 430 is further configured to construct a scale space corresponding to the three-dimensional model; the determination module 420 is further configured to detect local extrema with scale invariance in the scale space; to take vertices in the three-dimensional model associated with local extrema as candidate key points; to calculate the corresponding stability metric value based on the second-order differential operator at each candidate key point; and to take candidate key points with stability metric values greater than a preset stability threshold as key vertices.
[0137] Please refer to Figure 5 The present invention also provides an electronic device 500, including a processor 510, a memory 520, and a computer program stored in the memory 520 and executable on the processor 510. When the computer program is executed by the processor 510, it implements the various processes of the simplified method embodiment of the three-dimensional model described above and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0138] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the simplified method embodiment for the three-dimensional model described above, achieving the same technical effect. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0139] This invention also provides a computer program product, including computer instructions that, when executed by a processor, implement the above-described... Figure 1 The various processes of the method embodiments shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0140] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0141] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0142] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
Claims
1. A method for simplifying a three-dimensional model, characterized in that, include: Obtain the geometric attribute information corresponding to multiple triangular facets in the three-dimensional model; The distance between two adjacent triangular facets is determined based on the geometric attribute information corresponding to each of the two adjacent triangular facets. Based on the facet distance, a heat kernel matrix is constructed. The values of the elements in the heat kernel matrix represent the similarity between adjacent triangular faces. The similarity between adjacent triangular faces is determined by the facet distance. Based on the heat core matrix, the 3D model is divided into K sub-regions using a spectral clustering algorithm; Based on the feature intensity values corresponding to the K sub-regions, a simplification threshold is determined for each of the K sub-regions. The simplification threshold corresponding to the sub-region with a high feature intensity value is less than the simplification threshold corresponding to the sub-region with a low feature intensity value. as well as The 3D model is simplified based on the simplification rate thresholds corresponding to the K sub-regions.
2. The method according to claim 1, characterized in that, The step of determining the facet distance between two adjacent triangular facets based on the geometric attribute information corresponding to each adjacent triangular facet includes: Based on the geometric attribute information corresponding to the two adjacent triangular facets, the geodesic distance and cosine distance between the two adjacent triangular facets are determined respectively; and The geodesic distance and cosine distance are adaptively fused according to their respective weights to obtain the patch distance.
3. The method according to claim 1, characterized in that, The step of segmenting the 3D model into K sub-regions using a spectral clustering algorithm based on the heat core matrix includes: Based on the heat core matrix, construct the normalized Laplace matrix; Calculate multiple eigenvalues of the normalized Laplacian matrix and the eigenvectors corresponding to each eigenvalue; The number K of the sub-regions is determined based on the distribution of the multiple feature values; Based on the K feature vectors corresponding to the K smallest feature values among the plurality of feature values, a K-dimensional feature representation of each triangular facet is determined; and The triangular facets are clustered based on the K-dimensional feature representation of each triangular facet to divide the three-dimensional model into the K sub-regions. The similarity between any two triangular facets within the same sub-region is higher than the similarity between triangular facets within the region and triangular facets outside the region.
4. The method according to claim 1, characterized in that, The step of determining the simplification threshold corresponding to each of the K sub-regions based on the feature intensity values corresponding to each of the K sub-regions includes: Based on the feature intensity values corresponding to the K sub-regions, the K sub-regions are divided into at least one category; Based on the preset mapping relationship between categories and simplification thresholds, the simplification threshold corresponding to each category's sub-region is determined.
5. The method according to claim 1, characterized in that, The simplification of the 3D model based on the simplification rate thresholds corresponding to the K sub-regions includes: Construct an edge folding queue, wherein multiple edges to be folded are arranged in descending order of their corresponding folding costs, and the folding cost corresponding to an edge to be folded is determined based on the feature intensity value of the sub-region where the edge to be folded is located and whether the vertex of the edge to be folded is a critical vertex. Iteratively select the target edge with the minimum folding cost from the edge folding queue, and perform a folding operation on the target edge to simplify the 3D model; and During the iterative process of edge folding, the folding operation on edges located within a sub-region is stopped when the current simplification rate of a sub-region is greater than or equal to the corresponding simplification rate threshold.
6. The method according to claim 5, characterized in that, The iterative selection of the target edge with the minimum folding cost from the edge folding queue and the execution of the folding operation for the target edge include: If the target edge meets the preset folding conditions, a folding operation is performed on the target edge; The preset folding condition includes any one of the following: the target edge is a non-boundary edge within a sub-region; or, the target edge is a boundary edge between two sub-regions, and the difference between the feature intensity values corresponding to the two sub-regions is less than a preset threshold.
7. The method according to claim 5, characterized in that, The folding cost corresponding to one of the edges to be folded is determined based on the feature intensity value of the sub-region where the edge to be folded is located and whether the vertex of the edge to be folded is a critical vertex, including: The basic folding cost is determined based on the quadratic error matrix of the two vertices of the edge to be folded. A first weight value is determined based on the feature intensity of one or more sub-regions associated with the edge to be folded; A second weight value is determined based on whether the vertex of the edge to be folded is a critical vertex; and The basic folding cost is jointly weighted using the first weight value and the second weight value to obtain the folding cost corresponding to the edge to be folded.
8. The method according to claim 7, characterized in that, The method further includes: Construct the scale space corresponding to the three-dimensional model; Detecting local extrema with scale invariance in the scale space; The vertices in the 3D model associated with the local extremum points are selected as candidate key points. Based on the second-order differential operator at each of the candidate keypoints, calculate the corresponding stability metric; and Candidate key points whose stability metric values are greater than a preset stability threshold are designated as key vertices.
9. A device for simplifying a three-dimensional model, characterized in that, include: The acquisition module is used to acquire the geometric attribute information corresponding to multiple triangular facets in the three-dimensional model. The determining module is used to determine the face distance between two adjacent triangular facets based on the geometric attribute information corresponding to the two adjacent triangular facets respectively; A construction module is used to construct a heat core matrix based on the facet distance determined by the determining module. The element values in the heat core matrix represent the similarity between adjacent triangular faces, and the similarity between adjacent triangular faces is determined by the facet distance. The segmentation module is used to segment the 3D model into K sub-regions based on the heat kernel matrix constructed by the building module and through a spectral clustering algorithm. The determining module is further configured to determine the simplification threshold corresponding to each of the K sub-regions based on the feature intensity values corresponding to the K sub-regions segmented by the segmentation module, wherein the simplification threshold corresponding to the sub-region with a high feature intensity value is less than the simplification threshold corresponding to the sub-region with a low feature intensity value. as well as A simplification module is used to simplify the three-dimensional model based on the simplification rate thresholds corresponding to the K sub-regions determined by the determination module.
10. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of a simplification method for a three-dimensional model as described in any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for simplifying a three-dimensional model as described in any one of claims 1 to 7.
12. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of a simplification method for a three-dimensional model as described in any one of claims 1 to 7.