Grid repairing method and electronic device
By automatically identifying and repairing short sides and obtuse angles in triangular meshes in computer-aided design, analysis problems caused by imperfect geometric meshes are solved and more accurate and efficient finite element analysis is achieved.
Patent Information
- Application Number
- CN202310244802.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-13
- Publication Date
- 2024-09-13
AI Technical Summary
In computer-aided engineering, there are unideal geometric grid patterns, such as long and narrow faces or short edges, which lead to inaccurate finite element analysis results and are difficult to effectively solve with existing technology.
Through the automated mesh repair method, short edges and obtuse angles in triangular meshes are identified and repaired. The operations of edge collapse, obtuse edge conversion and obtuse edge segmentation are used to repair unsatisfactory triangular meshes and generate more reasonable mesh models. .
The accuracy and efficiency of finite element analysis are improved, and automated processing reduces manual intervention to ensure the quality of subsequent analysis results.
Smart Images

Figure CN118644637A
Abstract
Description
Technical Field
[0001] The invention relates to a grid repair method and an electronic device, and in particular to a grid repair method and an electronic device capable of repairing an undesirable geometric grid pattern through automatic grid repair. Background Art
[0002] Nowadays, Computer Aided Engineering (CAE) is used during product design to analyze and verify product characteristics in engineering fields such as product structure, electromagnetics, and materials. Generally speaking, when performing finite element analysis of computer-aided engineering, the input product model mesh diagram is usually analyzed. However, when the model mesh diagram has undesirable geometric mesh patterns, such as broken patterns, broken holes and other defects, finite element analysis cannot be performed accurately. For example, when there are narrow faces or short edges in the design model in the Computer Aided Design (CAD) stage, it often leads to undesirable triangular geometry in the generated model mesh, which in turn affects the quality of the subsequent generation of tetrahedral solid meshes, and ultimately directly affects the results of finite element analysis. Therefore, the existing technology really needs to be improved. Summary of the invention
[0003] In order to solve the above problems, the present invention provides a grid repair method and an electronic device that can automatically repair an undesirable geometric grid pattern to solve the above problems.
[0004] The present invention provides a mesh repair method, comprising: obtaining a three-dimensional mesh model, wherein the three-dimensional mesh model is divided into a plurality of triangular meshes; determining a triangular mesh having a short side shorter than a first threshold value from the plurality of triangular meshes, and performing a side collapse operation on the triangular mesh having the short side shorter than the first threshold value to execute a first mesh repair procedure; and determining a triangular mesh having an obtuse angle from the plurality of triangular meshes, and executing a second mesh repair procedure on the triangular mesh having the obtuse angle.
[0005] The present invention further provides an electronic device, comprising: a storage device for storing instructions; a processing circuit configured to execute the instructions, wherein the instructions include: obtaining a three-dimensional mesh model, the three-dimensional mesh model being divided into multiple triangular meshes; determining a triangular mesh having a short side shorter than a first threshold value from the multiple triangular meshes, and performing a side collapse operation on the triangular mesh having the short side shorter than the first threshold value to execute a first mesh repair procedure; and determining a triangular mesh having an obtuse angle from the multiple triangular meshes, and executing a second mesh repair procedure on the triangular mesh having the obtuse angle. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] Figure 1 It is a schematic diagram of a process of an embodiment of the present invention.
[0007] Figure 2 FIG. 4 is a schematic diagram of a collapse operation according to an embodiment of the present invention.
[0008] Figure 3 FIG. 4 is a schematic diagram of a conversion operation of a blunt edge according to an embodiment of the present invention.
[0009] Figure 4 FIG. 4 is a schematic diagram of a blunt edge splitting operation according to an embodiment of the present invention.
[0010] Component number description
[0011] 10: Process
[0012] Q1: Quad grid
[0013] S100, S102, S104, S106, S108, S110, S112: Steps
[0014] SP: segment point
[0015] V1, V2, V3, V4: Vertex
[0016] T1, T2, T3, T4, T5, T6: triangular mesh
[0017] Θ1, Θ2: Angle DETAILED DESCRIPTION
[0018] The embodiments of the present invention can be used to repair undesirable geometric mesh patterns that cannot be processed during the finite element analysis process of computer-aided design, such as triangular meshes with short side lengths or large obtuse angles, so that the subsequent computer-aided design analysis can be more accurate and efficient. More importantly, the embodiments of the present invention can use three-dimensional computer graphics software to automatically process undesirable triangular geometric meshes directly on the triangular mesh to achieve automated mesh repair processing.
[0019] The embodiment of the present invention can be applied to a grid repair process. Figure 1 , Figure 1 FIG. 1 is a schematic diagram of a process 10 according to an embodiment of the present invention. The process 10 is used to repair a mesh. The process 10 includes the following steps:
[0020] Step S100: Obtain a three-dimensional mesh model.
[0021] Step S102: performing an edge collapse operation on a triangle mesh having a short edge shorter than a first threshold value to perform a first mesh repair procedure.
[0022] Step S104: Determine whether there is a triangle mesh with an obtuse angle, and determine whether the triangle mesh with an obtuse angle is parallel to an adjacent triangle mesh; if so, execute step S106; if not, execute step S108.
[0023] Step S106: performing a blunt edge conversion operation on the triangle mesh with blunt angles and the adjacent triangle meshes to implement a second mesh repair procedure.
[0024] Step S108: performing a split blunt edge operation on the triangle mesh with the obtuse angle and the adjacent triangle meshes to implement a second mesh repair procedure.
[0025] Step S110: Determine whether the number of triangle meshes with obtuse angles is less than a second threshold value; if so, execute step S112; if not, execute step S102.
[0026] Step S112: Output the repaired three-dimensional mesh model.
[0027] According to process 10, in step S100, the embodiment of the present invention can be executed in a computer-aided design software of an electronic device. The electronic device may include a computer device, and the computer device is equipped with computer-aided design software, wherein the computer-aided design software may be AutoCAD, Pro / Engineer, SolidWorks, but not limited thereto. The embodiment of the present invention can generate a three-dimensional model file including a computer-aided design model through the computer-aided design software. The three-dimensional model file may be in the file format of STandard for Exchange of Product Model Data (STEP) and Initial Graphics Exchange Specification (IGES), but not limited thereto. After obtaining the three-dimensional model file, the computer-aided design model in the three-dimensional model file may be divided into a plurality of triangular meshes to generate a three-dimensional mesh model file having a three-dimensional mesh model. For example, the surface area of the computer-aided design model is divided into a plurality of triangular meshes to form a three-dimensional mesh model. The three-dimensional mesh model file may be in the file format of STereoLithography (STL) and OBJ Wavefront (OBJ), but not limited thereto. In step S100, the ABAQUS analysis software of computer-aided engineering can be used to read the three-dimensional model file generated by the loaded computer-aided design software, and then the computer-aided design model in the three-dimensional model file is divided into a plurality of triangular meshes to generate a three-dimensional mesh model file of the three-dimensional mesh model. The required mesh elements can be generated by setting the size and shape of the mesh. In one embodiment, the ABAQUS analysis software can be used to output the three-dimensional mesh model file in the stereolithography file format or the OBJ model file format.
[0028] In step S102, after obtaining the three-dimensional mesh model file, a triangular mesh having a side length (referred to as a short side) shorter than a first threshold value is determined from a plurality of triangular meshes, and a side collapse operation is performed on the triangular mesh having a short side shorter than the first threshold value to perform a first mesh repair procedure. That is, a triangular mesh having a side length shorter than the first threshold value can be detected to find out a side whose side length is much smaller than other side lengths, and a side collapse operation is performed on the detected triangular mesh having a short side length to implement the first mesh repair procedure. In one embodiment, for a triangular mesh having a short side shorter than the first threshold value, a first vertex and a second vertex of the short side can be merged into a merged vertex, so that the triangular mesh having the short side shorter than the first threshold value is collapsed into a straight line. In this case, since the triangular mesh having a side length shorter than the first threshold value indicates that there may be a mesh break, the original undesirable mesh condition can be repaired through the aforementioned side collapse operation. For example, all triangle meshes with edge lengths shorter than the first threshold value may be found, and the Collapse Edge method of the Blender graphics software package may be used to perform a collapse operation on the triangle meshes with short edge lengths to implement the first mesh repair procedure.
[0029] Please refer to Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a collapse operation according to an embodiment of the present invention. Figure 2 As shown in the left half, in the triangle mesh T1 formed by vertices V1, V2 and V3, if the edge The length of the edge formed by vertex V2 and vertex V3 is less than a threshold value X, and the edge of the triangle mesh T1 can be selected. vertices (i.e., vertices V2 and V3 are selected), and vertices V2 and V3 are merged into a single merged vertex. Figure 2 As shown in the right half, vertices V2 and V3 can be merged into a merged vertex V2, so that the edge Collapse into the merged vertex V2. In this way, after the aforementioned collapse operation, the triangle mesh T1 originally formed by the vertices V1, V2 and V2 is collapsed into a straight line formed by the vertex V1 and the vertex V2. For example, the operation of collapsing the short edge can be performed by executing the Collapse Edge package of the Blender drawing software to collapse the triangle mesh T1 originally formed by the vertices V1, V2 and V2 into a straight line formed by the vertex V1 and the vertex V2 to implement the first mesh repair procedure. When the value of the threshold value X is set to be very small, the aforementioned selected short edge is very short, and the difference in the overall mesh geometry after the aforementioned collapse operation does not change much. Therefore, after the aforementioned mesh repair, the structure of the overall mesh will not be affected. In short, the embodiments of the present invention can utilize three-dimensional computer drawing software (such as Blender drawing software) to write automated scripts through Python program interface settings to automatically execute the corresponding suite to implement all the functions, steps and processes of the embodiments of the present invention, so as to automatically process and repair the imperfect triangular geometric mesh that cannot be processed in the finite element analysis process of computer-aided design directly on the triangular mesh, thereby achieving automated mesh repair processing.
[0030] Next, in step S104, it is possible to detect whether there is a triangular mesh with an obtuse angle among the multiple triangular meshes of the triangular mesh model. When the triangular mesh has an obtuse angle, it indicates that there may be a mesh hole or a broken image, and a second mesh repair procedure can be performed on the triangular mesh with an obtuse angle. Further, in step S104, after determining that the triangular mesh has an obtuse angle, an adjacent triangular mesh that shares the opposite side of the obtuse angle with the triangular mesh with the obtuse angle can be determined. In other words, according to the geometric characteristics of the closed triangular mesh, the side corresponding to the obtuse angle is usually connected to two triangles. In this case, the side corresponding to the obtuse angle can be found for the triangular mesh with the obtuse angle, and the adjacent triangular mesh containing the side corresponding to the obtuse angle can be found (that is, the adjacent triangular mesh that shares the side corresponding to the obtuse angle with the triangular mesh with the obtuse angle). For example, Figure 3 As shown in part (a), in the triangle mesh T1 formed by vertices V1, V2 and V3, if angle θ1 is an obtuse angle, the side corresponding to angle θ1 is the side Then it shares edges with triangle mesh T1 The adjacent triangle mesh is the triangle mesh T2.
[0031] In step S104, in one embodiment, for a triangle mesh with an obtuse angle, after determining the triangle mesh with an obtuse angle and the adjacent triangle meshes sharing the opposite side of the obtuse angle, it is determined whether the plane where the triangle mesh with an obtuse angle is located is parallel to the plane where the adjacent triangle mesh is located. Figure 3As shown in part (a), it is possible to determine whether the plane of triangle mesh T1 is parallel to the plane of adjacent triangle mesh T2. When the plane where the triangle mesh T1 is located is parallel to the plane where the triangle mesh T2 is located, it means that the triangle meshes T1 and T2 are on the same plane. In one embodiment, if it is determined that the plane where the triangle mesh with an obtuse angle is located is parallel to the plane where the adjacent triangle mesh is located, step S106 is executed. If it is determined that the plane where the triangle mesh with an obtuse angle is located is not parallel to the plane where the adjacent triangle mesh is located, step S108 is executed.
[0032] In another embodiment, in step S104, for a triangular mesh with an obtuse angle, after determining the triangular mesh with an obtuse angle and the adjacent triangular meshes sharing the opposite side of the obtuse angle, it can be determined whether the angle between the plane where the triangular mesh with an obtuse angle is located and the plane where the adjacent triangular mesh is located is less than or equal to a first angle threshold value. The first angle threshold value may be less than 180 degrees. If it is determined that the angle between the plane where the triangular mesh with an obtuse angle is located and the plane where the adjacent triangular mesh is located is less than or equal to the first angle threshold value, this indicates that the two planes have a fold angle and are not parallel to each other, and step S108 is executed. If it is determined that the angle between the plane where the triangular mesh with an obtuse angle is located and the plane where the adjacent triangular mesh is located is not less than the first angle threshold value, this indicates that the two planes are very close to being parallel, and step S106 is executed. For example, the Edge Angle package of the Blender drawing software can be used to calculate the angle between two triangle meshes that share opposite sides of an obtuse angle (that is, the angle between the plane where the triangle mesh with the obtuse angle is located and the plane where the adjacent triangle mesh is located) to determine whether the plane where the triangle mesh with the obtuse angle is located is parallel to the plane where the adjacent triangle mesh is located or the size of the angle between the two planes.
[0033] In step S106, a conversion operation of blunt edges is performed for the triangle mesh with an obtuse angle and the adjacent triangle meshes sharing the opposite side of the obtuse angle to implement the second mesh repair procedure. For the triangle mesh with an obtuse angle and the adjacent triangle meshes sharing the opposite side of the obtuse angle, the opposite side of the obtuse angle formed by a first vertex and a second vertex is eliminated to generate a quadrilateral mesh formed by the aforementioned first vertex, the aforementioned second vertex, a third vertex of the triangle mesh with an obtuse angle, and a fourth vertex of the adjacent triangle mesh. Then, the third vertex and the fourth vertex are connected to add the edge formed by the third vertex and the fourth vertex to the quadrilateral mesh to generate a triangle mesh formed by the aforementioned first vertex, the third vertex and the fourth vertex and a triangle mesh formed by the aforementioned first vertex, the second vertex and the fourth vertex to complete the operation of converting blunt edges and implement the second mesh repair procedure. In this way, the edge corresponding to the original obtuse angle can be shortened to reduce the occurrence of obtuse triangle meshes.
[0034] For example, Figure 3 As shown in part (a), the edge and edge The included angle θ1 is an obtuse angle, and the side opposite to the included angle θ1 is the side formed by vertices V1 and V2. The triangle mesh T1 formed by vertices V1, V2 and V3 shares an edge with the triangle mesh T2 formed by vertices V2, V3 and V4. If the plane of triangle mesh T1 is parallel to the plane of triangle mesh T2, such as Figure 3 As shown in part (b), the shared edges can be eliminated. A quadrilateral mesh Q1 is formed by vertices V1, V2, V3 and V4. Figure 3 As shown in part (c), vertex V3 and vertex V4 are connected to join the edge formed by vertex V3 and vertex V4. to Figure 3 (b) The quadrilateral mesh Q1 shown in part 1 generates a new triangle mesh T3 formed by vertices V1, V3 and V4 and a new triangle mesh T4 formed by vertices V2, V3 and V4. In this way, the edge corresponding to the original angle θ1 can be Shorten to edge This can reduce the occurrence of obtuse triangle meshes to achieve mesh repair procedures. Furthermore, since the plane where the original obtuse triangle mesh T1 is located is parallel to the plane where the adjacent triangle mesh T2 is located, the aforementioned method of converting the obtuse edge will not change the outer geometric shape of the original two triangle meshes and will not affect the overall mesh structure. For example, the Dissolve Edge method of the Blender graphics software package can be used to melt the edge. Next, the quadrilateral mesh Q1 is selected by using Triangulate Face, a package of Blender drawing software, to generate new triangular meshes T3 and T4. In this way, the operation of converting the blunt edge can be achieved to realize the second mesh repair process.
[0035] In step S108, when it is determined that the plane of the obtuse triangle mesh and the plane of the adjacent triangle mesh are not parallel to each other or the angle between the plane of the obtuse triangle mesh and the plane of the adjacent triangle mesh sharing the opposite side of the obtuse angle is less than or equal to a first angle threshold value, a split blunt edge operation can be performed on the obtuse triangle mesh and the adjacent triangle mesh sharing the opposite side of the obtuse angle to implement a second mesh repair procedure. Since the obtuse triangle mesh and the adjacent triangle mesh share the same long side (the opposite side of the obtuse angle), if the planes of the two are not parallel to each other or the angle between them is less than or equal to a first angle threshold value, after applying the conversion blunt edge operation of step S106, a solid geometric mesh may be converted into a planar geometric mesh. Therefore, in step S108, when it is determined that the plane of the obtuse triangle mesh and the plane of the adjacent triangle mesh are not parallel to each other or the angle between the two planes is less than the first angle threshold value, a segmentation point is selected on the opposite side of the obtuse angle formed by a first vertex and a second vertex. For example, the segmentation point may be the midpoint of the opposite side of the obtuse angle, but is not limited thereto. Then, the segmentation point is connected to the vertex of the obtuse angle (a third vertex of the triangular mesh with the obtuse angle) to add the edge formed by the segmentation point and the third vertex to the triangular mesh with the obtuse angle, so as to generate a triangular mesh formed by the first vertex, the segmentation point and the third vertex, and a triangular mesh formed by the second vertex, the segmentation point and the third vertex. In other words, the original obtuse triangle mesh with a long side is divided into two triangular meshes with shorter sides by adding the edge formed by the segmentation point and the third vertex. In addition, the segmentation point is connected to a fourth vertex of the adjacent triangular mesh (corresponding to the vertex of the opposite side of the original shared obtuse angle) to add the edge formed by the segmentation point and the fourth vertex to the adjacent triangular mesh, so as to generate a triangular mesh formed by the first vertex, the segmentation point and the fourth vertex, and a triangular mesh formed by the second vertex, the segmentation point and the fourth vertex. That is, the edge formed by the segmentation point and the fourth vertex is added to split the adjacent triangle meshes with long edges into two triangle meshes with shorter edges, so as to complete the operation of splitting the obtuse edge and thus implement the second mesh repair procedure. In this way, the triangle mesh with the obtuse angle and the adjacent triangle meshes sharing the opposite edge of the obtuse angle are respectively split into two triangle meshes and the edge corresponding to the original obtuse angle is shortened to reduce the occurrence of obtuse triangle meshes.
[0036] For example, Figure 4Part (a) shows the triangle mesh T1 formed by vertices V1, V2 and V3 and the triangle mesh T2 formed by vertices V1, V2 and V4, where the gray represents the inner surface of the triangle mesh T2. and edge The included angle θ1 is an obtuse angle, and the side opposite to the included angle θ1 is the side formed by vertices V1 and V2. The plane where the triangle mesh T1 is located has an angle θ2 with the plane where the triangle mesh T2 is located. When the angle θ2 is less than a first angle threshold or the plane where the triangle mesh T1 is located is not parallel to the triangle mesh T2, such as Figure 4 As shown in part (b), at the side corresponding to the angle θ1 Select a segment point SP on the upper side, and connect the segment point SP and the vertex V3 of the angle θ1 to add the edge formed by the segment point SP and the vertex V3 To the obtuse triangle mesh T1, a new triangle mesh T3 is generated by the segment point SP and the vertices V1 and V3, and a new triangle mesh T4 is generated by the segment point SP and the vertices V2 and V3. In this way, the original obtuse triangle mesh T1 with a long edge can be split into two triangle meshes T3 and T4 with shorter edges, thereby reducing the occurrence of obtuse triangle meshes to achieve the mesh repair procedure. In addition, the segment point SP is connected to the vertex V4 of the triangle mesh T2 to add the edge formed by the segment point SP and the vertex V4. To the triangular mesh T2, a new triangular mesh T5 formed by the segmentation point SP and vertices V1 and V4 and a new triangular mesh T6 formed by the segmentation point SP and vertices V2 and V4 are generated, so as to divide the original triangular mesh T2 with long edges into two triangular meshes T5 and T6 with shorter edges, thereby reducing the occurrence of obtuse triangular meshes to implement the mesh repair procedure. For example, the segmentation point SP can be selected by executing the Subdivide Edge package of the Blender drawing software. Then, the Triangulate Face package of the Blender drawing software is used to generate new triangular meshes T3-T6. In this way, the operation of dividing the obtuse edges can be achieved to implement the second mesh repair procedure.
[0037] In short, the embodiments of the present invention can utilize three-dimensional computer drawing software (such as Blender drawing software) to write automated scripts through Python program interface settings to automatically execute the corresponding suite to implement all the functions, steps and processes of the embodiments of the present invention, so as to automatically process and repair the imperfect triangular geometric mesh that cannot be processed in the finite element analysis process of computer-aided design directly on the triangular mesh, thereby achieving automated mesh repair processing, without the need to manually inspect and repair the imperfect mesh one by one as in the traditional way.
[0038] In step S110, it can be determined whether the number of triangular meshes with obtuse angles in the three-dimensional mesh model file of the three-dimensional mesh model after processing by the above steps is less than a second threshold value. If so, step S112 is executed, and if not, step S102 is executed. In other words, the embodiment of the present invention can repeatedly execute the first mesh repair procedure and the second mesh repair procedure, so that the mesh originally repaired to a shorter side can be repaired again through the repair procedure of the above steps to achieve an optimized mesh repair process, until it is determined that the number of triangular meshes with obtuse angles in the multiple triangular meshes is less than a second threshold value, and then the repaired three-dimensional mesh model is output.
[0039] Then, in step S112, the repaired three-dimensional mesh model file after the mesh repair program executed in steps S106 and S108 can be output to provide for the subsequent finite element analysis program. For example, the ABAQUS analysis software can be used to read the repaired three-dimensional mesh model file after the mesh repair program executed in steps S106 and S108, and then the repaired three-dimensional mesh model file can be converted into a three-dimensional mesh model file of a tetrahedral solid mesh to output for the subsequent finite element analysis program. In this way, it will ensure that the subsequent computer-aided design finite element analysis program is more accurate and efficient. In addition, step S110 can also be omitted, and step S112 can be directly executed after executing step S106 or step S108 to output.
[0040] A person skilled in the art may combine, modify or change the above-described embodiments according to the spirit of the present invention, but is not limited thereto. All of the above statements, steps, and / or processes (including recommended steps) may be implemented by hardware, software, firmware (i.e., a combination of hardware devices and computer instructions, where the data in the hardware devices are read-only software data), electronic systems, or a combination of the above devices. The hardware may include analog, digital and hybrid circuits (i.e., microcircuits, microchips or silicon chips). For example, the hardware may be an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a programmable logic element, a coupled hardware element, or a combination of the above hardware. In other embodiments, the hardware may include a general purpose processor, a microprocessor, a controller, a digital signal processor (DSP), or a combination of the above hardware. The software may be a combination of program codes, a combination of instructions and / or a combination of functions (functionality), which is stored in a storage device, such as a computer readable recording medium or a non-transitory computer-readable medium. For example, a computer-readable recording medium may include a read-only memory (ROM), a flash memory (Flash Memory), a random-access memory (RAM), a subscriber identity module (SIM), a hard disk, a floppy disk, or a compact disk read-only memory (CD-ROM / DVD-ROM / BD-ROM), but is not limited thereto. An embodiment of the present invention may include an electronic device, the electronic device including a processing circuit and a storage device. The process steps and embodiments of the present invention may be compiled into a program code or instruction form and stored in the storage device of the electronic device. The processing circuit of the electronic device can be used to read and execute the program code or instructions stored in the storage device to implement all the aforementioned steps and functions.
[0041] In summary, the embodiment of the present invention can shorten the edges corresponding to the original obtuse angles by performing a mesh repair procedure on a three-dimensional mesh model file of a three-dimensional mesh model having multiple triangular meshes to reduce the occurrence of obtuse-angle triangular meshes and repair possible broken image defects, so that the subsequent computer-aided design finite element analysis can effectively achieve the purpose of high accuracy and efficiency. More importantly, the embodiment of the present invention can use three-dimensional computer drawing software to automatically process the aforementioned undesirable triangular geometry directly on the triangular mesh to achieve automated mesh repair processing.
[0042] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.
Claims
1. A grid repair method, comprising: Obtaining a three-dimensional mesh model, wherein the three-dimensional mesh model is divided into a plurality of triangular meshes; Determining a triangular mesh having a short side shorter than a first threshold value from the plurality of triangular meshes, and performing an edge collapse operation on the triangular mesh having the short side shorter than the first threshold value to perform a first mesh repair procedure; as well as A triangular mesh with an obtuse angle is determined from the plurality of triangular meshes, and a second mesh repairing procedure is performed on the triangular mesh with the obtuse angle.
2. The mesh repair method according to claim 1, wherein the step of performing the edge collapse operation on the triangular mesh having the short edge shorter than the first threshold value to perform the first mesh repair procedure comprises: For a triangular mesh having a short side shorter than the first threshold value, a first vertex and a second vertex of the short side are merged into a merged vertex, so that the triangular mesh having the short side shorter than the first threshold value is collapsed into a straight line to implement the edge collapse operation to perform the first mesh repair procedure.
3. The mesh repair method according to claim 2, wherein the step of performing the second mesh repair procedure on the triangular mesh having the obtuse angle comprises: For the triangular mesh having the obtuse angle, determining an adjacent triangular mesh that shares a pair of sides of the obtuse angle with the triangular mesh having the obtuse angle; When it is determined that the plane of the obtuse-angled triangle mesh is parallel to the plane of the adjacent triangle mesh, a converting obtuse edge operation is performed on the obtuse-angled triangle mesh and the adjacent triangle mesh to implement the second mesh repair procedure; and When it is determined that the plane of the triangular mesh with the obtuse angle is not parallel to the plane of the adjacent triangular mesh or the angle between the plane of the triangular mesh with the obtuse angle and the plane of the adjacent triangular mesh is less than a first angle threshold value, a splitting blunt edge operation is performed on the triangular mesh with the obtuse angle and the adjacent triangular mesh to implement the second mesh repair procedure.
4. The mesh repair method according to claim 3, wherein when it is determined that the plane of the triangle mesh with the obtuse angle is parallel to the plane of the adjacent triangle mesh, the step of performing the converting blunt edge operation on the triangle mesh with the obtuse angle and the adjacent triangle mesh to implement the second mesh repair procedure comprises: Removing the opposite side of the obtuse angle formed by a first vertex and a second vertex to generate a quadrilateral mesh formed by the first vertex, the second vertex, a third vertex of the triangle mesh having the obtuse angle, and a fourth vertex of the adjacent triangle mesh; as well as The third vertex and the four vertices are connected to add an edge formed by the third vertex and the fourth vertex to the quadrilateral mesh to generate a triangular mesh formed by the first vertex, the third vertex and the fourth vertex and a triangular mesh formed by the first vertex, the second vertex and the fourth vertex to perform the conversion blunt edge operation to implement the second mesh repair procedure.
5. The mesh repair method according to claim 3, wherein when it is determined that the plane of the obtuse-angled triangle mesh is parallel to the plane of the adjacent triangle mesh, the step of performing the converting blunt edge operation on the triangle mesh with the obtuse angle and the adjacent triangle mesh to implement the second mesh repair procedure comprises: Selecting a segment point on the opposite side of the obtuse angle formed by a first vertex and a second vertex; Connecting the segment point and a third vertex of the triangle mesh having the obtuse angle to add an edge formed by the segment point and the third vertex to the triangle mesh having the obtuse angle, so as to generate a triangle mesh formed by the first vertex, the segment point and the third vertex and a triangle mesh formed by the second vertex, the segment point and the third vertex; as well as Connect the segmentation point and a fourth vertex of the adjacent triangular mesh to add an edge formed by the segmentation point and the fourth vertex to the adjacent triangular mesh to generate a triangular mesh formed by the first vertex, the segmentation point and the fourth vertex and a triangular mesh formed by the second vertex, the segmentation point and the fourth vertex to perform the split blunt edge operation to implement the second mesh repair procedure.
6. The grid repair method according to claim 1, further comprising: The first mesh repairing procedure and the second mesh repairing procedure are repeatedly executed until it is determined that the number of the triangular meshes with the obtuse angles in the plurality of triangular meshes is less than a second threshold value, and then a repaired three-dimensional mesh model is output.
7. An electronic device comprising: A storage device for storing instructions; as well as a processing circuit configured to execute the instructions, wherein the instructions include: Obtaining a three-dimensional mesh model, wherein the three-dimensional mesh model is divided into a plurality of triangular meshes; Determining a triangular mesh having a short side shorter than a first threshold value from the plurality of triangular meshes, and performing an edge collapse operation on the triangular mesh having the short side shorter than the first threshold value to perform a first mesh repair procedure; as well as A triangular mesh with an obtuse angle is determined from the plurality of triangular meshes, and a second mesh repairing procedure is performed on the triangular mesh with the obtuse angle.
8. The electronic device according to claim 7, wherein the instruction further comprises: For a triangular mesh having a short side shorter than the first threshold value, a first vertex and a second vertex of the short side are merged into a merged vertex, so that the triangular mesh having the short side shorter than the first threshold value is collapsed into a straight line to implement the edge collapse operation to perform the first mesh repair procedure.
9. The electronic device according to claim 7, wherein the instruction further comprises: For the triangular mesh having the obtuse angle, determining an adjacent triangular mesh that shares a pair of sides of the obtuse angle with the triangular mesh having the obtuse angle; When it is determined that the plane of the obtuse-angled triangle mesh is parallel to the plane of the adjacent triangle mesh, a converting obtuse edge operation is performed on the obtuse-angled triangle mesh and the adjacent triangle mesh to implement the second mesh repair procedure; and When it is determined that the plane of the triangular mesh with the obtuse angle is not parallel to the plane of the adjacent triangular mesh or the angle between the plane of the triangular mesh with the obtuse angle and the plane of the adjacent triangular mesh is less than a first angle threshold value, a splitting blunt edge operation is performed on the triangular mesh with the obtuse angle and the adjacent triangular mesh to implement the second mesh repair procedure.
10. The electronic device according to claim 9, wherein the instruction further comprises: Removing the opposite side of the obtuse angle formed by a first vertex and a second vertex to generate a quadrilateral mesh formed by the first vertex, the second vertex, a third vertex of the triangle mesh having the obtuse angle, and a fourth vertex of the adjacent triangle mesh; as well as The third vertex and the four vertices are connected to add an edge formed by the third vertex and the fourth vertex to the quadrilateral mesh to generate a triangular mesh formed by the first vertex, the third vertex and the fourth vertex and a triangular mesh formed by the first vertex, the second vertex and the fourth vertex to perform the conversion blunt edge operation to implement the second mesh repair procedure.
11. The electronic device according to claim 9, wherein the instruction further comprises: Selecting a segment point on the opposite side of the obtuse angle formed by a first vertex and a second vertex; Connecting the segment point and a third vertex of the triangle mesh having the obtuse angle to add an edge formed by the segment point and the third vertex to the triangle mesh having the obtuse angle, so as to generate a triangle mesh formed by the first vertex, the segment point and the third vertex and a triangle mesh formed by the second vertex, the segment point and the third vertex; as well as Connect the segmentation point and a fourth vertex of the adjacent triangular mesh to add an edge formed by the segmentation point and the fourth vertex to the adjacent triangular mesh to generate a triangular mesh formed by the first vertex, the segmentation point and the fourth vertex and a triangular mesh formed by the second vertex, the segmentation point and the fourth vertex to perform the split blunt edge operation to implement the second mesh repair procedure.
12. The electronic device according to claim 7, wherein the instruction further comprises: The first mesh repairing procedure and the second mesh repairing procedure are repeatedly executed until it is determined that the number of the triangular meshes with the obtuse angles in the plurality of triangular meshes is less than a second threshold value, and then a repaired three-dimensional mesh model is output.
Citation Information
Cited By
STL (Standard Template Library) grid region division and re-subdivision method and device based on feature preservation
CN121458912A
