A 3D model optimization method for fast local Delaunay triangulation
Through the rapid local Delaunayized three-dimensional model optimization method, the problem of uneven distribution of three-dimensional model nodes is solved, efficient optimization is achieved, and the industrial field's demand for the unchanging appearance of three-dimensional model is met.
Patent Information
- Application Number
- CN202210156802.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-21
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-02-21
AI Technical Summary
During the rendering process, the rendering effect of the existing three-dimensional model is poor due to uneven node distribution. The existing full-domain optimization algorithm has a long calculation time and has modified the topology of the three-dimensional model, which is difficult to meet the needs of the industrial field.
A fast local Delaunayized three-dimensional model optimization method is proposed. By importing model files and reconstructing data structures, extracting plane areas, performing three-dimensional rotation and two-dimensional Delaunay optimization, reverse mapping and inserting the optimized plane, ensuring topology is enclosed and outputting the optimized three-dimensional model.
It effectively solves the problem of uneven distribution of nodes in the plane area, has high computing efficiency, can optimize model files of more than 100M in 3 seconds, and will not modify the appearance of the three-dimensional model, meeting the needs of the industrial field.
Smart Images

Figure CN114529675B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial manufacturing, and particularly relates to a three-dimensional model optimization method for rapid local Delaunay triangulation. Background Art
[0002] Three-dimensional models are a three-dimensional graphic display method widely used in the fields of industrial manufacturing, animation modeling, film and television special effects, etc. For example, complex and orderly three-dimensional shapes are displayed through a combination of a large number of triangular or tetrahedral meshes. However, there are still some defects in the existing three-dimensional models during the display and rendering process. In order to minimize the volume of the three-dimensional model as much as possible, when discrete point distribution is performed in three-dimensional modeling software, points are only distributed at positions where the dihedral angle changes violently or at specified edge positions. Although this achieves depicting a three-dimensional graphic with a specified accuracy using the minimum number of triangular facets, the distribution of nodes is extremely uneven. In large planar regions, since the dihedral angle changes little here, the nodes arranged by the modeling software are very sparse, which has a great negative impact on the later three-dimensional rendering effect and needs to be further optimized and improved.
[0003] Currently, there are some existing optimization solutions for such problems, such as the Isotropic Remeshing algorithm. This algorithm can effectively improve the uneven distribution of nodes, but the Isotropic Remeshing algorithm is a global optimization algorithm, which will recombine and optimize each triangular facet, so it requires a large amount of computing time. For example, for a three-dimensional model file exceeding 50M, if a good optimization effect is to be achieved, the optimization time of this algorithm may reach the hour level. In addition, the Isotropic Remeshing algorithm will modify the original three-dimensional model topology to a certain extent, which is unacceptable for those industrial fields that are sensitive to changes in the shape of the three-dimensional model. The industrial field urgently needs a new fast, efficient, and stable optimization algorithm to solve such problems. Summary of the Invention
[0004] The purpose of the present invention aims to solve at least one of the above technical defects.
[0005] To this end, an object of the present invention is to propose a three-dimensional model optimization method for rapid local Delaunay triangulation to solve the problems mentioned in the background art and overcome the deficiencies existing in the prior art.
[0006] To achieve the above object, an embodiment of the present invention provides a three-dimensional model optimization method for rapid local Delaunay triangulation, including:
[0007] Step S1, import the model file, and reconstruct the input data file based on the triangular facet data structure of half edges;
[0008] Step S2: Extract all planar regions in the model and filter out non-compliant planar regions as optimization candidates.
[0009] Step S3: Perform a 3D rotation on the 3D plane to be optimized so that it is mapped into the 2D space.
[0010] Step S4: Optimize the plane in the 2D space using the Delaunay algorithm.
[0011] Step S5: Inversely map the optimized 2D plane back to the original 3D plane.
[0012] Step S6: Delete the original plane in the model and insert the optimized 3D plane into the 3D model, where the insertion process ensures the topological closure of the entire 3D model.
[0013] Step S7: Output the result of the optimized 3D model.
[0014] Preferably, in step S1, according to any of the above solutions, import the configuration file and model information, import the model into the data body of the half-edge structure, and establish the topological relationship of the entire model.
[0015] Preferably, in step S2, according to any of the above solutions, after importing the model file, extract the planar regions in the model file, including: import all face elements into a queue, select a face element marked as False with the smallest queue number as the seed face element, and start searching from the 1-Ring neighborhood of this face element; search for face elements marked as False in this neighborhood, judge whether the normal vector of this element is equal to the normal vector of the seed face element, if they are equal, it is regarded as belonging to the same face element and added to the candidate queue, marked as True;
[0016] If face elements of the same plane are found in this neighborhood, use this face element as the seed face element and continue to iterate and repeat the above steps until no more face elements of the same plane can be found.
[0017] Preferably, according to any of the above solutions, calculate the volume and number of face elements of the calculated face element set. If both exceed the algorithm set value, record the information of this face element set as a plane to be optimized; if not, discard the information of this face element set, but keep the mark as True unchanged;
[0018] Select the next face element marked as False as the seed face element in the order of numbers and continue to iterate the above steps until the end of the queue is reached to find all planes to be optimized;
[0019] Save all planes to be optimized and mark their positions in the original data structure, waiting for further optimization.
[0020] Preferably, in step S3, according to any of the above solutions, the three-dimensional plane is rotated using quaternions. If the normal vector of the three-dimensional plane is n, and this vector rotates along the rotation axis u defined by the unit vector by an angle θ, the rotated vector n' is obtained using matrix multiplication;
[0021] Let Then:
[0022]
[0023] After the rotation by this equation, a plane is obtained whose normal vector is (0, 0, 1). At this time, the z-values of all points in the plane are equal; removing the z-values simplifies the three-dimensional plane to a two-dimensional plane.
[0024] Preferably, in step S4, according to any of the above solutions, the edge points of the plane to be optimized are extracted and numbered in order. For a plane with a multi-connected domain, a separate array is established to label the internal holes; after labeling, Delaunay remeshing is performed on the two-dimensional plane. This algorithm adds internal points while ensuring the original boundary points, so that each cell is close to an equilateral triangle.
[0025] Preferably, in step S5, according to any of the above solutions, the two-dimensional plane is inversely mapped back to the original three-dimensional space.
[0026] Preferably, in step S6, according to any of the above solutions, all the identified two-dimensional planes are embedded into the original model to form the final three-dimensional file.
[0027] Preferably, in step S7, according to any of the above solutions, the optimized three-dimensional file has a uniform and regular triangular facet structure, and the model file is re-output as a binary ply file or stl file, and the algorithm optimization calculation is completed.
[0028] Compared with the prior art, the present invention has the following beneficial effects compared with the prior art: The fast local Delaunay algorithm proposed by the present invention can effectively solve the problem of uneven node distribution in the plane area. And through testing, it is found that even for model files above 100M, the optimization can still be completed within 3s, with extremely high computational efficiency and easy parallelization; at the same time, this algorithm will not make any shape modifications to the three-dimensional model file, meeting the usage requirements of industrial fields with strict requirements for three-dimensional shapes.
[0029] The present invention realizes the prediction of shrinkage porosity and porosity during the hot chamber die casting process through CAE technology. By using a highly parallelized data architecture, while ensuring the calculation accuracy, the calculation time of the algorithm is greatly reduced, making it have industrial application value.
[0030] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. Description of the Drawings
[0031] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0032] Figure 1 is a flowchart of a three-dimensional model optimization method for fast local Delaunay triangulation according to an embodiment of the present invention;
[0033] Figure 2 is a schematic diagram of a three-dimensional die-casting mold model according to an embodiment of the present invention;
[0034] Figure 3 is a schematic diagram of a half-edge structure according to an embodiment of the present invention;
[0035] Figure 4 is a schematic diagram of a certain two-dimensional plane before optimization according to an embodiment of the present invention;
[0036] Figure 5 is a schematic diagram of a certain two-dimensional plane after Delaunay re-triangulation according to an embodiment of the present invention;
[0037] Figure 6a and Figure 6b is a schematic diagram of the effect of the STL file after final optimization according to an embodiment of the present invention. Detailed Description of the Embodiments
[0038] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present invention and should not be construed as limiting the present invention.
[0039] The present invention provides a three-dimensional model optimization method for fast local Delaunay triangulation. This method is different from the global optimization methods of other three-dimensional models. The present invention adopts a local optimization strategy, only optimizing the regions with unreasonable node distributions, such as planar regions. The local optimization strategy can effectively reduce the number of target surface elements to be optimized by the algorithm, thereby greatly improving the optimization efficiency.
[0040] As Figure 1 shown, the three-dimensional model optimization method for fast local Delaunay triangulation according to an embodiment of the present invention includes the following steps:
[0041] Step S1: Import the model file and reconstruct the input data file based on the triangular patch data structure of half - edges.
[0042] Specifically, import the configuration file and model information, import the model into the data body of the half - edge structure, and establish the topological relationship of the entire model. As Figure 2 shown, this model is a mold file in the die - casting field. Such models often have very obvious edges or rounded chamfers. If other algorithms are used, it often leads to model distortion.
[0043] In the present invention, the model is imported into the data body of the half - edge structure to establish the topological relationship of the entire model. The half - edge structure is a relatively common data structure for describing triangular mesh models, as Figure 3 shown. It splits an edge into two half - edges and stores them separately, so as to efficiently describe the front - and - back adjacency relationship of each edge and topological information such as whether it is a boundary, thereby improving the algorithm calculation efficiency. By importing the half - edge data structure, the present invention establishes the connection relationship of the 1 - Ring neighborhood of each mesh element.
[0044] Step S2: Extract all planar regions in the model and filter out non - compliant planar regions as optimization candidates.
[0045] Specifically, after importing the model file, the present invention needs to extract the planar regions in the model file. The present invention sets a flag value for each unit, defaulting to False and becoming True after marking, to prevent repeated traversal. The calculation flow chart is as Figure 4 shown, and the main calculation steps are as follows:
[0046] 1. Import all mesh elements into a queue, select a mesh element marked as False with the smallest queue number as the seed mesh element, and start searching from the 1 - Ring neighborhood of this mesh element;
[0047] 2. Search for mesh elements marked as False in this neighborhood, judge whether the normal vector of this unit is equal to the normal vector of the seed mesh element. If they are equal, it is considered to belong to the same mesh element, add it to the candidate queue, and mark it as True;
[0048] 3. If mesh elements on the same plane are found in this neighborhood, then use this mesh element as the seed mesh element and continue to iterate and repeat the stage of step 2 until no more mesh elements on the same plane can be found, then end step 3; if not found, then end step 3.
[0049] 4. Statistically calculate the volume and number of surface elements obtained in step 3. If both exceed the algorithm-set values, record the information of this surface element set as an unoptimized plane. If not, discard the information of this surface element set, but the flag marked as True remains unchanged.
[0050] 5. Select the next surface element marked as False in the order of numbers as the seed surface element, and repeat steps 1-4 until the end of the loop. In this way, all unoptimized planes are found.
[0051] 6. Save all unoptimized planes and mark their positions in the original data structure, waiting for further optimization.
[0052] In this step, quickly extract all plane regions in the model and filter out some planes that are too small or otherwise unreasonable as optimization candidates.
[0053] Step S3: Perform a three-dimensional rotation on the three-dimensional plane to be optimized so that it is mapped into a two-dimensional space.
[0054] Specifically, use quaternions to rotate the three-dimensional plane. If the normal vector of the three-dimensional plane is n, the vector n' after rotating this vector by an angle θ along the rotation axis u defined by the unit vector can be obtained by matrix multiplication.
[0055] Let Then:
[0056]
[0057] After the rotation by this equation, the present invention can obtain a plane rotated to a normal vector of (0, 0, 1). At this time, the z values of all points in the plane are equal. Removing the z values can simplify the three-dimensional plane into a two-dimensional plane. The extracted two-dimensional plane is as shown in Figure 4 shown.
[0058] Step S4: Optimize the plane in the two-dimensional space using the Delaunay algorithm.
[0059] Specifically, extract the edge points of the plane to be optimized and number them in order. For a plane with a multi-connected domain, an array needs to be established separately for the internal holes for annotation. After annotation, perform Delaunay remeshing on the two-dimensional plane. This algorithm will add as few internal points as possible on the basis of ensuring the original boundary points, making each unit close to an equilateral triangle. The algorithm may add some points at the boundary and also add the position information of a large number of points inside the plane. The optimization effect is as shown in Figure 5 shown.
[0060] Step S5: Inversely map the optimized two-dimensional plane to the original three-dimensional plane.
[0061] Specifically, using a calculation method similar to that in step S3, the two-dimensional plane is reversely mapped back to the original three-dimensional space. It should be noted that before mapping, the Z-direction coordinates discarded in the third step need to be complemented first.
[0062] Step S6, delete the original plane in the model and insert the optimized three-dimensional plane into the three-dimensional model, where the insertion process ensures the topological closure of the entire three-dimensional model.
[0063] Specifically, all the identified two-dimensional planes are embedded into the original model to form the final three-dimensional stl file. It should be noted that during assembly, the topological completeness after embedding the planes should be ensured, that is, their adjacent edges should be perfectly matched. The final assembly effect is shown in Figure 6.
[0064] Step S7, output the result of the optimized three-dimensional model.
[0065] Specifically, the optimized STL file will have a uniform and regular triangular facet structure, which will bring great convenience to subsequent algorithm calculations. The model file is re-output as a binary ply or stl file, and the algorithm optimization calculation is completed.
[0066] Compared with the prior art, the present invention has the following beneficial effects compared with the prior art: The fast local Delaunay algorithm proposed by the present invention can effectively solve the problem of uneven node distribution in the plane area, and it is found through testing that even for model files above 100M, optimization can still be completed within 3s, with extremely high calculation efficiency and easy parallelization; at the same time, the algorithm will not make any shape modifications to the three-dimensional model file, meeting the usage requirements of industrial fields with strict requirements for three-dimensional shapes.
[0067] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0068] It is not difficult for those skilled in the art to understand that the present invention includes any combination of the above-mentioned invention content, specific implementation manners of the specification, and each part shown in the drawings. Due to space limitations and to make the specification concise, the various solutions formed by these combinations are not described one by one. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
[0069] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A three-dimensional model optimization method for fast local Delaunay triangulation, characterized in that, It includes the following steps: Step S1: Import the model file and reconstruct the input data file based on the triangular patch data structure of half - edges; Step S2: Extract all planar regions in the model and filter out non - compliant planar regions as optimization candidates; Step S3: Perform a three - dimensional rotation on the three - dimensional plane to be optimized so that it is mapped into a two - dimensional space; Step S4: Optimize the plane in the two - dimensional space using the Delaunay algorithm; Step S5: Inversely map the optimized two - dimensional plane back to the original three - dimensional plane; Step S6: Delete the original plane in the model and insert the optimized three - dimensional plane into the three - dimensional model, where the insertion process ensures the topological closure of the entire three - dimensional model; Step S7: Output the optimized three - dimensional model result; In step S2, after importing the model file, extract the planar regions in the model file, including: import all face elements into a queue, select a face element marked as False with the smallest queue number as the seed face element, and start searching from the 1 - Ring neighborhood of this face element; find the face elements marked as False in this neighborhood, and judge whether the normal vector of this face element is equal to the normal vector of the seed face element. If they are equal, it is regarded as belonging to the same face element and added to the candidate queue, marked as True; If face elements of the same plane are found in this neighborhood, use this face element as the seed face element and continue to iterate and repeat the above steps until no more face elements of the same plane can be found.
2. The three-dimensional model optimization method for fast local Delaunay triangulation according to claim 1, characterized in that, In step S1, import the configuration file and model information, import the model into the data body of the half - edge structure, and establish the topological relationship of the entire model.
3. The three-dimensional model optimization method for fast local Delaunay triangulation according to claim 1, wherein Statistically calculate the volume and number of face elements. If both exceed the algorithm - set values, record the information of the face element set as a plane to be optimized; if they do not exceed the algorithm - set values, discard the information of the face element set, but keep the mark as True unchanged; Select the next face element marked as False in order of number as the seed face element and continue to iterate the above steps until the end of the queue is reached, and find all planes to be optimized; Save all planes to be optimized and mark their positions in the original data structure, waiting for further optimization.
4. The three-dimensional model optimization method for fast local Delaunay triangulation according to claim 1, wherein In step S3, use quaternions to rotate the three - dimensional plane. If the normal vector of the three - dimensional plane is n, and the vector n' after rotating this vector by an angle θ along the rotation axis u defined by the unit vector is obtained by matrix multiplication; Let Then: After rotation by this equation, a plane is obtained with a normal vector of (0, 0, 1). At this time, the z - values of all points in the plane are equal; Remove the z - value and simplify the three - dimensional plane to a two - dimensional plane.
5. The three-dimensional model optimization method for fast local Delaunay triangulation according to claim 1, characterized in that In step S4, extract the edge points of the plane to be optimized, number them in order. For a multi - connected domain plane, establish a separate array to label the internal holes; after labeling, perform Delaunay remeshing on the two - dimensional plane. This algorithm adds internal points while ensuring the original boundary points so that each cell is close to an equilateral triangle.
6. The three-dimensional model optimization method for fast local Delaunay triangulation according to claim 1, characterized in that In step S5, inversely map the two - dimensional plane back to the original three - dimensional space.
7. The three-dimensional model optimization method for fast local Delaunay triangulation according to claim 1, wherein In the step S6, all the identified two-dimensional planes are embedded into the original model to form a final three-dimensional file.
8. The three-dimensional model optimization method for fast local Delaunay triangulation according to claim 1, characterized in that, In the step S7, the optimized three-dimensional file has a uniform and regular triangular facet structure. The model file is re-output as a binary ply file or stl file, and the algorithm optimization calculation is completed.
Citation Information
Patent Citations
Scattered point cloud Delaunay triangulation curved surface reconstruction method based on mapping method
CN103985155A
Image processing method and apparatus, and terminal
CN107845061A