Model grid hole searching and repairing method and device and related equipment
By constructing a half-side data structure and selecting axis points to determine closed loops, the problem of adjacent mesh holes having common vertices is solved, enabling fast and effective hole repair and improving the efficiency and effectiveness of finding and repairing holes in the model mesh.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies cannot effectively handle situations where adjacent mesh holes share a common vertex when identifying and repairing mesh holes in a model, leading to errors in the model slicing stage and affecting printing results.
By constructing a half-side data structure, the half-side with an empty corresponding face pointer is obtained and determined as the boundary edge set. The starting point of the opposite side of the half-side is selected as the axis point, and adjacent half-sides are selected in a clockwise direction to form a closed loop. The outline of the polygonal hole is determined and converted into a triangular mesh for color rendering.
It enables rapid finding and repair of holes in regular and adjacent meshes, especially holes with common vertices, improving the efficiency and effectiveness of mesh hole repair while maintaining the original surface features of the model.
Smart Images

Figure CN121724869A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of 3D printing technology, specifically involving methods, devices and related equipment for finding and repairing holes in model meshes. Background Technology
[0002] Currently, in the field of 3D printing technology, slicing of models is required. Generally, model display, propagation, and simulation calculations use triangular mesh files. However, due to issues such as corrupted triangular mesh files on the model faces during geometric modeling, holes may appear in the model, causing errors during the slicing stage and affecting the final printing result. Therefore, it is necessary to locate and repair holes on the model surface before generating slices.
[0003] Specifically, regarding the need for finding and repairing holes in model meshes, for example, the earlier application (application number 2023113750382), "A Method for Repairing Holes in 3D Model Mesh Using Laplace Mesh Deformation Technology," has provided corresponding process methods. However, in the specific hole identification process, it does not provide a specific solution for the case where adjacent mesh holes share a common vertex; that is, for individual mesh holes in the normal case, these current techniques can identify and repair them well; but for the case where adjacent mesh holes share a common vertex, there is no convenient and quick method for finding and repairing them.
[0004] Therefore, a technical method is needed that can both find and repair individual mesh holes in normal situations, and find and repair adjacent mesh holes with a common vertex. Summary of the Invention
[0005] This application provides a method, apparatus, and related equipment for finding and repairing holes in a model mesh. During the model preprocessing stage, it can find and repair individual mesh holes under normal circumstances, as well as find and repair adjacent mesh holes with a common vertex.
[0006] The first aspect of this application provides a method for finding and repairing holes in a model mesh, including: Get and traverse the model's triangular mesh data; A half-edge data structure, including half-edge, opposite edge, face pointer, and starting point, is constructed using face cells; In the half-side data structure, obtain the half-side whose corresponding face pointer is empty and determine it as the boundary edge set; Select one half-edge in sequence from the set of boundary edges and determine the starting point of the opposite side of the selected half-edge as the axis point; Using the pivot point as the center and swinging clockwise, select the next adjacent half that is close to the selected half until multiple consecutive adjacent halfs are selected in sequence to form a closed loop; The closed loop is defined as the polygonal outline of the model mesh hole and stored.
[0007] Furthermore, the method for finding and repairing holes in the model mesh also includes: Obtain the polygonal outlines of the holes in the model mesh; Extract non-triangular polygons from a polygon outline; The non-triangular polygon is subdivided into multiple triangular grids; Extract triangles from the polygon outline and convert them into a triangular mesh; The triangular mesh is then colored and rendered.
[0008] Preferably, the endpoints of the half-side and the opposite side are the same but in opposite directions.
[0009] Preferably, the face pointer includes the complete topological connection relationship between the half-edge, the opposite edge, the starting point, and the face unit.
[0010] Preferably, the half-side data structure further includes a second half connected to the half-side and a first half connected to the half-side.
[0011] A second aspect of this application provides a device for finding and repairing holes in a model mesh, comprising: The grid data traversal module is used to obtain and traverse the model's triangular grid data; The half-edge structure construction module is used to construct a half-edge data structure, including half-edge, opposite edge, face pointer, and starting point, using face units; The boundary set determination module is used to obtain the half-edges with null corresponding face pointers in the half-edge data structure and determine them as the boundary set; The pivot point determination module is used to select one half of the boundary edge set in sequence and determine the starting point of the opposite side of the selected half of the boundary edge as the pivot point. The closed loop forming module is used to select the next adjacent half of the selected half with the axis point as the axis and in a clockwise swing direction until multiple consecutive adjacent halfs are selected in sequence to form a closed loop. The hole contour storage module is used to determine and store the closed loop as the polygonal contour of the model mesh hole.
[0012] Furthermore, the aforementioned model mesh hole finding and repair device also includes: The hole outline acquisition module is used to acquire the polygonal outline of the holes in the model mesh; The non-triangular polygon acquisition module is used to acquire non-triangular polygons in a polygon outline; A non-triangular polygon subdivision module is used to subdivide the non-triangular polygon into multiple triangular meshes; The triangular mesh conversion module is used to extract triangles from polygon outlines and convert them into triangular meshes. The mesh shading and rendering module is used to shading and rendering the triangular mesh.
[0013] A third aspect of this application provides an electronic device, including: At least one processing unit; and a storage unit communicatively connected to the at least one processing unit; wherein, The storage unit stores instructions that can be executed by the at least one processing unit. When the at least one processing unit executes the instructions, it implements the steps of the model mesh hole finding and repair method as described in the first aspect above.
[0014] A fourth aspect of this application provides a non-transitory computer-readable storage medium storing a computer program, which, when executed by a processing unit, implements the steps of the model mesh hole finding and repair method described in the first aspect above.
[0015] The fifth aspect of this application provides a computer program product, which includes computer instructions. When the computer instructions are executed by a computer, they implement the steps of the model mesh hole finding and repair method described in the first aspect above.
[0016] Compared with the prior art, the beneficial effects of the present invention are:
[0017] 1. By using the method provided in the embodiments of this application, the model triangular mesh data is transformed into a half-edge data structure, which makes it easier to traverse and index the vertices, edges and faces of the model mesh, thereby improving the efficiency of finding and repairing holes in the model mesh.
[0018] 2. The method provided in the embodiments of this application can quickly find and repair individual mesh holes in normal situations, as well as find and repair adjacent mesh holes with a common vertex, and the repair process is quick.
[0019] 3. The method provided in the embodiments of this application can also be applied to finding and repairing adjacent mesh holes with two or three common vertices, and the repair process is quick.
[0020] 4. The method provided in the embodiments of this application has good applicability to the repair of convex or concave mesh holes, and is suitable for preserving the original surface features of the model to the greatest extent, thereby improving the effect of model repair and feature retention. Attached Figure Description
[0021] Figure 1 This is a flowchart of the method for finding and repairing holes in the model mesh according to an embodiment of this application.
[0022] Figure 2 This is a structural diagram of the mesh hole finding and repair device according to an embodiment of this application.
[0023] Figure 3 This is a schematic diagram showing the common points of the triangular mesh holes in this application.
[0024] Figure 4 This is a schematic diagram showing the common points of the quadrilateral mesh holes in this application.
[0025] Figure 5 This is a reference description of the half-side data structure of this application. Figure 1 .
[0026] Figure 6 This is a reference description of the half-side data structure of this application. Figure 2 .
[0027] Figure 7 This is a reference description of the half-side data structure of this application. Figure 3 .
[0028] Figure 8 This is an example of half of the data structure for the schematic diagram of the common points of the triangular mesh holes in this application.
[0029] Figure 9 This is an example of a half-side data list for a schematic diagram of the concurrent points of the triangular mesh holes in this application.
[0030] Figure 10 A diagram illustrating the selection of consecutive adjacent half-sides for common points in a triangular mesh. Figure 1 .
[0031] Figure 11 A diagram illustrating the selection of consecutive adjacent half-sides for common points in a triangular mesh. Figure 2 .
[0032] Figure 12 This is a schematic diagram of the triangular mesh hole repair in this application.
[0033] Figure 13 This is an example of a half-side data structure for illustrating the concurrent points of the quadrilateral mesh holes in this application.
[0034] Figure 14 This is an example of a half-side data list for a schematic diagram of the concurrent points of the quadrilateral mesh holes in this application.
[0035] Figure 15 A diagram illustrating the selection of consecutive adjacent half-sides for the common points of holes in a quadrilateral grid. Figure 1 .
[0036] Figure 16 A diagram illustrating the selection of consecutive adjacent half-sides for the common points of holes in a quadrilateral grid. Figure 2 .
[0037] Figure 17 This is a schematic diagram illustrating the subdivision and repair of quadrilateral grid holes in this application.
[0038] Figure 18 This is a rendering of the model before the holes in this application were repaired.
[0039] Figure 19 This is a rendering of the model after the holes in this application have been repaired.
[0040] Figure 20 The electronic device structure diagram for implementing the mesh hole finding and repair method in the embodiments of this application is shown in the following figure.
[0041] Figure 21 This is a schematic diagram illustrating the process of finding and repairing holes in a model mesh for an electronic device according to an embodiment of this application.
[0042] Figure 22 The structural block diagram of the 3D printing equipment for realizing the mesh hole finding and repair method of this application is shown.
[0043] Figure 23 This is a schematic diagram of the slicing and printing process after the mesh hole repair is completed according to the method of this application.
[0044] Label Explanation:
[0045] Electronic device 12; 3D printing equipment 13; mobile storage device 14; processing unit 121; storage unit 122; computer program 123; controller 131; memory 132; printing control program 133.
[0046] Model 111; Hole 112; Repair surface 113; Vertex 301; Edge 302; Surface 303; Mesh hole 304; Start point 401; Half edge 402; Opposite edge 403; Surface element 404; Boundary edge 405.
[0047] Mesh data traversal module 100; half-side structure construction module 200; boundary set determination module 300; axis point determination module 400; closed loop construction module 500; hole contour storage module 600; hole contour acquisition module 700; non-triangular polygon acquisition module 800; non-triangular polygon subdivision module 900; triangular mesh conversion module 1000; mesh shading and rendering module 1100. Detailed Implementation
[0048] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application.
[0050] Figure 1 This is a flowchart of the method for finding and repairing holes in a model mesh according to an embodiment of this application. As shown in the figure, the method for finding and repairing holes in a model mesh according to this application includes the following steps: S100. Obtain and traverse the model triangular mesh data; S200. Construct a half-edge data structure including half-edge, opposite edge, face pointer, and starting point using face units; S300. Obtain the half-edge whose corresponding face pointer is empty in the half-edge data structure and determine it as the boundary edge set; S400. Select one half-edge in the boundary set in turn and determine the starting point of the opposite side of the selected half-edge as the axis point; S500. Using the pivot point as the axis and swinging clockwise, select the next adjacent half that is close to the selected half until multiple consecutive adjacent halfs are selected in sequence to form a closed loop. S600. The closed loop is determined as the polygonal outline of the model mesh hole and stored.
[0051] Wherein, the endpoints of the half-side and the opposite side are the same but in opposite directions. The face pointer includes the complete topological connection relationship between the half-side, the opposite side, the starting point, and the face unit. The half-side data structure also includes the second half-side adjacent to the half-side connection, and the first half-side adjacent to the half-side connection.
[0052] In addition, the model mesh hole finding and repair method of this application also includes optional steps: S700. Obtain the polygonal outline of the holes in the model mesh; S800. Obtain non-triangular polygons from a polygon outline; S900. Subdivide the non-triangular polygon into multiple triangular grids; S1000. Extract triangles from the polygon outline and convert them into a triangular mesh; S1100. The triangular mesh is colored and rendered.
[0053] Figure 2 This is a structural diagram of the model mesh hole finding and repair device according to an embodiment of this application. As shown in the figure, the model mesh hole finding and repair device of this application includes: Mesh data traversal module 100 is used to acquire and traverse model triangular mesh data; Half-edge structure construction module 200 is used to construct a half-edge data structure including half-edge, opposite edge, face pointer, and starting point through face units; Boundary set determination module 300 is used to obtain the half-edges with null corresponding face pointers in the half-edge data structure and determine them as boundary set; The pivot point determination module 400 is used to select one half of the boundary edge set in sequence and determine the starting point of the opposite side of the selected half of the boundary edge as the pivot point. The closed loop forming module 500 is used to select the next adjacent half of the selected half with the axis point as the axis and in a clockwise swing direction until multiple consecutive adjacent halfs are selected in sequence to form a closed loop. The hole contour storage module 600 is used to determine and store the closed loop as the polygonal contour of the model mesh hole.
[0054] In addition, the model mesh hole finding and repair device of this application also includes: Hole contour acquisition module 700 is used to acquire the polygonal contours of holes in the model mesh; Non-triangular polygon acquisition module 800 is used to acquire non-triangular polygons in a polygon outline; Non-triangular polygon subdivision module 900 is used to subdivide the non-triangular polygon into multiple triangular meshes; Triangular mesh conversion module 1000 is used to obtain triangles in polygon outlines and convert them into triangular meshes; The mesh shading and rendering module 1100 is used to shading and rendering the triangular mesh.
[0055] Figure 3This is a schematic diagram illustrating the common point of triangular mesh holes in this application. As shown in the figure, the example illustrates a scenario where two triangular mesh holes on the model surface share a common point. This represents the first type of technical problem that the mesh hole finding and repair method in this application needs to solve. In the figure, v1-v7 are all vertices 301; the edges 302 connecting each vertex 301 are the edges of the triangular mesh; the shaded triangular mesh is the face 303 that can be displayed normally on the triangular mesh; as can be seen from the figure, the two mesh holes 304 containing f4 and f6 share a common vertex v2. The two empty triangular meshes f4 and f6 are mesh holes 304; the dashed lines circled on f4 and f6 in the figure indicate empty spaces.
[0056] Figure 4 This is a schematic diagram illustrating the common point of quadrilateral mesh holes in this application. As shown in the figure, the example illustrates a scenario where two quadrilateral mesh holes on the model surface share a common point. This represents the second type of technical problem that the mesh hole finding and repair method in this application needs to solve. In the figure, v1-v7 are all vertices 301; the edges 302 connecting each vertex 301 are the mesh edges; the shaded triangular meshes are the faces 303 that can be displayed normally on the triangular meshes; as can be seen from the figure, the two mesh holes 304 containing f3 and f5 share a common vertex v2. The two empty quadrilateral meshes f3 and f5 are mesh holes 304; the dashed lines circled on f3 and f4 in the figure indicate empty spaces.
[0057] Figure 5 This is a reference description of the half-side data structure of this application. Figure 1 As shown in the figure, this diagram is used to coordinate with... Figure 6 and Figure 7 A brief explanation of the half-side data structure is provided. The diagram illustrates two triangular meshes sharing a common edge, comprising four vertices (v1-v4) (301), five edges (302), and two faces (f1 and f2) (303).
[0058] Figure 6 This is a reference description of the half-side data structure of this application. Figure 2 As shown in the figure, Figure 6 Will Figure 5 The two triangular meshes sharing a common edge are shown in the diagram and converted into a half-edge data structure. Figure 5The five edges 302 in the diagram correspond to the ten half edges e1-e10 in this figure. However, it should be noted that when constructing a face pointer using a face cell containing a mesh as the description group, these ten half edges may be distinguished as half edges or opposite edges; when constructing the relationship between adjacent half edges using a half edge as the description group, the front and rear adjacent half edges may be distinguished as the front half edge and the back half edge; the face pointer includes the complete topological connection relationship between the half edge, opposite edge, starting point, and face cell; and the outermost half edge, because its half edge lacks a corresponding face pointer, is defined as a boundary edge.
[0059] As shown in the figure, taking the face unit 404 where f1 is located as an example, the starting point 401 includes v1, v2, and v3; the half-side 402 includes e1, e3, and e5; the opposite side 403 includes e2, e4, and e6; correspondingly, e2 is called the opposite side of e1, e4 is called the opposite side of e3, and e6 is called the opposite side of e5.
[0060] Correspondingly, with e1 as the descriptor group, e5 is called the first half of e1, and e3 is called the second half of e1; with e3 as the descriptor group, e1 is called the first half of e3, and e5 is called the second half of e3; with e5 as the descriptor group, e3 is called the first half of e5, and e1 is called the second half of e5.
[0061] Accordingly, taking the face unit 404 where f2 is located as an example, the starting point 401 includes v3, v2, and v4; the half-side 402 includes e4, e7, and e9; the opposite side 403 includes e3, e8, and e10; correspondingly, e3 is called the opposite side of e4, e8 is called the opposite side of e7, and e10 is called the opposite side of e9.
[0062] Correspondingly, with e4 as the description group, e9 is called the first half of e4, and e7 is called the second half of e4; with e7 as the description group, e4 is called the first half of e7, and e9 is called the second half of e7; with e9 as the description group, e7 is called the first half of e9, and e4 is called the second half of e9.
[0063] In particular, since the two triangular meshes in this figure lack adjacent meshes outside, taking the face element 404 where f1 is located as an example, the opposite edge e2 and the opposite edge e6 can be defined as boundary edge 405 at this time, and are represented by dashed lines in the figure.
[0064] Specifically, in the half-side data structure, in order to save on data storage, when storing the data of half-sides, taking half-side e1 as an example, only the starting point v1 and direction of e1 are stored; taking the other half-side e2 as an example, that is, the opposite side of e1 e2, only the starting point v2 and direction of e2 are stored; the two half-sides e1 and e2 together represent the complete information of line segment v1-v2.
[0065] Figure 7This is a reference description of the half-side data structure of this application. Figure 3 As shown in the figure, the table in this figure describes... Figure 6 The topological relationships between the various starting points, half-edges, opposite edges, face elements, first half-edges, and second half-edges are shown. It's important to note that half-edges e1, e3, and e5 correspond to face element f1; half-edges e4, e7, and e9 correspond to face element f2; this corresponds precisely to... Figure 6 The mid-surface element f1 and the surface element f2. And... Figure 6 In the figure, the face elements corresponding to half of e6, e10, e8, and e2 are missing. Therefore, the face element parts corresponding to half of e6, e10, e8, and e2 are also empty in this figure, and their corresponding front and back halves are also empty.
[0066] above Figure 5 , Figure 6 , Figure 7 Using a simple example of two grids to illustrate a half-side data structure, the technical process of this method will be explained below.
[0067] Figure 8 This is an example of half of the data structure for the schematic diagram of the concurrent points of the triangular mesh holes in this application. As shown in the figure, this figure corresponds to... Figure 3 The example illustrates a scenario where two triangular mesh holes on the model surface share a common point. It's important to note that the mesh in this diagram represents the triangular mesh containing f1-f7, which is a portion of the mesh from a complete 3D model. Therefore, the outer ring portions e6, e10, e28, e26, e20, e12, and e16 do not belong to this mesh. Figure 6 The boundary shown.
[0068] Conversely, the triangular grids containing f4 and f6 in this diagram correspond exactly to... Figure 3 The mesh hole is 304; therefore, execute Figure 1 In step S200, a half-edge data structure including half-edges, opposite edges, face pointers, and starting points is constructed using face units. At this time, face units f4 and f6 corresponding to this graph are missing; therefore, the face pointers corresponding to half-edges e14, e17, and e2 are empty, meaning the complete topological connection relationship between half-edges, opposite edges, starting points, and face units is empty; similarly, the face pointers corresponding to half-edges e22, e23, and e8 are also empty, meaning the complete topological connection relationship between half-edges, opposite edges, starting points, and face units is also empty; therefore, execution... Figure 1 In step S300, the half-edges with empty face pointers are obtained from the half-edge data structure and determined as the boundary edge set. At this time, the half-edges e14, e17, and e2 at position f4 in this figure, and the half-edges e22, e23, and e8 at position f6, are the boundary edge set.
[0069] Figure 9 This is an example of a half-side data list for a schematic diagram showing the concurrent points of the triangular mesh holes in this application. As shown in the figure, the table in this figure describes... Figure 8 The topological relationships between the various starting points, half-edges, opposite edges, face units, first half-edges, and second half-edges are defined. It's important to note that face unit f4 corresponding to half-edges e14, e17, and e2 is empty; face unit f6 corresponding to half-edges e22, e23, and e8 is empty; the face pointers corresponding to face units f4 and f6 are also empty, as are the information for the corresponding first and second half-edges. The face pointers contain the complete topological connections between the half-edges, opposite edges, starting points, and face units. Therefore, execution... Figure 1 In step S300, the half-edges with empty face pointers are obtained from the half-edge data structure and determined as the boundary edge set; that is, half-edges e14, e17, e2 and half-edges e22, e23, e8 are determined as the boundary edge set.
[0070] Figure 10 A diagram illustrating the selection of consecutive adjacent half-sides for common points in a triangular mesh. Figure 1 As shown in the figure, this figure is... Figure 8 Based on this, the half-sides e14, e17, and e2, and the half-sides e22, e23, and e8 were determined as the boundary set; however, this presents a technical problem as described in the background of this application. If the mesh holes are independent of each other, then the outline of the holes can be determined when determining the boundary set. If adjacent mesh holes have a common vertex v2 as shown in this figure, it becomes difficult to distinguish the polygon enclosed by the half-sides e14, e17, and e2, and the half-sides e22, e23, and e8 as individual holes. As shown in the figure, when searching for the hole boundary path along half e17 starting from v6, there are two choices at the starting point v2: one is to search for the hole boundary path along half e22, and the other is to search for the hole boundary path along half e2. The former will generate incorrect hole information such as half e17, e22, e23, and e8 when forming the hole closed contour; while the latter can generate correct hole information such as half e17, e2, and e14 when forming the hole closed contour.
[0071] Figure 11 A diagram illustrating the selection of consecutive adjacent half-sides for common points in a triangular mesh. Figure 2 As shown in the figure, this figure is... Figure 8 Based on this, the half-edges e14, e17, and e2, and the half-edges e22, e23, and e8 were determined as the boundary set; therefore, the execution... Figure 1 In step S400, one half-edge is selected sequentially from the set of boundary edges, and the starting point of the opposite edge of the selected half-edge is determined as the axis point.
[0072] It is important to note that the pivot point is determined by the starting point of the opposite side of the selected half, not by its ending point. This is because, in the half-side data structure, to save data storage, taking half-side e14 in this diagram as an example, only the starting point v1 and direction of e14 are stored, not the ending point information. Therefore, the starting point v6 of the opposite side e14, e13, is used as the pivot point for this determination.
[0073] For example, within the hole region where f4 is located, if half-edge e14 is selected, since the face pointers corresponding to half-edges e14, e17, and e2 are empty, and the data of the adjacent edges before and after half-edge e14 is not stored, the adjacent edge e17 cannot be directly determined from half-edge e14. In this case, it is necessary to use the starting point v6 of the opposite edge e13 of half-edge e14 to determine the pivot point. It should be noted that adjacent half-edges are based on directed, end-to-end connection. Therefore, further execution... Figure 1 In step S500, the next adjacent half-side is selected with the pivot point as the axis and in a clockwise swing direction until multiple consecutive adjacent half-sides are selected to form a closed loop. Since the next adjacent half-side of the starting point v6 where the pivot point is located is only e17, half-side e17 is part of the closed loop.
[0074] For example, within the area of the hole where f4 is located, if half-side e17 is selected, then the starting point v2 of the opposite side e18 of e17 needs to be used as the pivot point for this determination; then the next half-side adjacent to the selected half-side e17 can be either half-side e22 or half-side e2; thus, further execution... Figure 1 Step S500, as shown, involves selecting the next adjacent half-side in a clockwise direction, centered on the pivot point, until multiple consecutive adjacent half-sides form a closed loop. It can be seen that in a clockwise direction with the pivot point v2 as the pivot point, half-side e2 is the closest adjacent half-side e17, therefore half-side e2 is part of the closed loop. This process is repeated until the closed loop of the mesh hole containing f4 and the closed loop of the mesh hole containing f6 are obtained. Then, the next step... Figure 1 In step S600, the closed loop is determined as the polygonal outline of the model mesh hole and stored; thus, the model mesh hole data can be determined and stored.
[0075] Figure 12 This is a schematic diagram illustrating the repair of triangular mesh holes in this application. As shown in the figure, this diagram... Figure 1 Based on step S600, the model mesh hole data is determined and stored. Since the meshes at positions f4 and f6 are triangular, therefore, during execution... Figure 1In steps S800-S900, the steps of obtaining non-triangular polygons in the polygon outline in step S800 and subdividing the non-triangular polygons into multiple triangular meshes in step S900 do not need to be performed; only the following steps need to be performed. Figure 1 Steps S700, S1000, and S1100 ultimately achieve the color rendering of the triangular mesh at positions f4 and f6, thus completing the repair of the mesh holes with common vertices shown in this figure.
[0076] Figure 13 This is an example of a half-side data structure for illustrating the concurrent points of the quadrilateral mesh holes in this application. As shown in the figure, this figure corresponds to... Figure 4 The example illustrates a scenario where the model surface contains two quadrilateral mesh holes with a common point. It's important to note that the default mesh in this diagram represents the triangular mesh containing f1-f5, which is a portion of the mesh from a complete 3D model. Therefore, the outer ring halves h6, h10, h24, h22, h18, h12, and h16 do not belong to this mesh. Figure 6 The boundary shown.
[0077] Conversely, the triangular grids containing f3 and f5 in this diagram correspond exactly to... Figure 4 The mesh hole is 304; therefore, execute Figure 1 In step S200, a half-edge data structure including half-edges, opposite edges, face pointers, and starting points is constructed using face units. At this time, face units f3 and f5 corresponding to this graph are missing; therefore, the face pointers corresponding to half-edges h15, h11, h13, and h2 are empty, meaning the complete topological connection relationship between half-edges, opposite edges, starting points, and face units is empty. Similarly, the face pointers corresponding to half-edges h20, h21, h23, and h8 are also empty, meaning the complete topological connection relationship between half-edges, opposite edges, starting points, and face units is also empty. Therefore, execution... Figure 1 In step S300, the half-edges with empty face pointers are obtained from the half-edge data structure and determined as the boundary edge set. At this time, the half-edges h15, h11, h13, and h2 at position f3 in this figure, and the half-edges h20, h21, h23, and h8 at position f5, are the boundary edge set.
[0078] Figure 14 This is an example of a half-side data list for a schematic diagram showing the concurrent points of the quadrilateral mesh holes in this application. As shown in the figure, the table in this figure describes... Figure 13The topological relationships between the various starting points, half-edges, opposite edges, face units, first half-edges, and second half-edges are defined. It's important to note that face unit f3 corresponding to half-edges h15, h11, h13, and h2 is empty; face unit f5 corresponding to half-edges h20, h21, h23, and h8 is empty; the face pointers corresponding to face units f3 and f5 are also empty, as are the information for the corresponding first and second half-edges. The face pointers contain the complete topological connections between the half-edges, opposite edges, starting points, and face units. Therefore, execution... Figure 1 In step S300, the half-sides with empty face pointers are obtained from the half-side data structure and determined as the boundary edge set; that is, the half-sides h15, h11, h13, h2 and the half-sides h20, h21, h23, h8 are determined as the boundary edge set.
[0079] Figure 15 A diagram illustrating the selection of consecutive adjacent half-sides for the common points of holes in a quadrilateral grid. Figure 1 As shown in the figure, this figure is... Figure 13 Based on this, the half-sides h15, h11, h13, h2 and h20, h21, h23, h8 were determined as the boundary set; however, the same technical problem described in the background of this application still exists. If the mesh holes are independent of each other, the outline of the holes can be determined when determining the boundary set. If adjacent mesh holes have a common vertex v2 as shown in this figure, it is not easy to distinguish the polygon enclosed by the half-sides h15, h11, h13, h2 and h20, h21, h23, h8 as individual holes. As shown in the figure, when searching for the hole boundary path along half h13 starting from v6, there are two choices at the starting point v2: one is to search for the hole boundary path along half h20, and the other is to search for the hole boundary path along half h2. The former will generate incorrect hole information such as half h13, h20, h21, h23, and h8 when forming the hole closed contour; while the latter can generate correct hole information such as half h13, h2, h15, and h11 when forming the hole closed contour.
[0080] Figure 16 A diagram illustrating the selection of consecutive adjacent half-sides for the common points of holes in a quadrilateral grid. Figure 2 As shown in the figure, this figure is... Figure 13 Based on this, the half-edges h15, h11, h13, and h2, and the half-edges h20, h21, h23, and h8 were determined as the set of boundary edges; therefore, the execution... Figure 1 In step S400, one half-edge is selected sequentially from the set of boundary edges, and the starting point of the opposite edge of the selected half-edge is determined as the axis point.
[0081] It is also important to note that the pivot point is determined by the starting point of the opposite side of the selected half, not by the ending point of the selected half. This is because, in the half-side data structure, to save data storage, taking half-side h11 in this diagram as an example, when storing the data of half-side, only the starting point v5 and direction of h11 are stored, not the ending point information of h11; therefore, the starting point v6 of the opposite side h12 of h11 is used as the pivot point determined in this case.
[0082] For example, within the hole region where f3 is located, if half-edge h11 is selected, since the face pointers corresponding to half-edges h11, h13, h2, and h15 are empty, and the data of the adjacent edges before and after half-edge h11 is not stored, the adjacent h13 cannot be directly determined from half-edge h11. In this case, it is necessary to use the starting point v6 of the opposite edge h12 of half-edge h11 to determine the pivot point. It should be noted that adjacent half-edges are based on directed, end-to-end connection. Therefore, further execution... Figure 1 In step S500, the next adjacent half of the selected half is selected in a clockwise direction with the axis point as the axis, until multiple consecutive adjacent halfs are selected to form a closed loop. Since the next adjacent half of the starting point v6 where the axis point is located is only h13, half h13 is part of the closed loop.
[0083] For example, within the area of the hole where f5 is located, if half of h13 is selected, then the starting point v2 of h13's opposite side h14 needs to be used as the axis point for this determination; then the next half adjacent to the selected half of h13 can be either half of h20 or half of h2; thus, further execution... Figure 1 Step S500, as shown, involves selecting the next adjacent half-side in a clockwise direction, centered on the pivot point, until multiple consecutive adjacent half-sides form a closed loop. It can be seen that in a clockwise direction with the pivot point v2 as the pivot point, half-side h2 is the closest adjacent half-side h13, therefore half-side h2 is part of the closed loop. This process is repeated until the closed loop of the mesh hole containing f3 and the closed loop of the mesh hole containing f5 are obtained. Then, the following steps are executed... Figure 1 In step S600, the closed loop is determined as the polygonal outline of the model mesh hole and stored; thus, the model mesh hole data can be determined and stored.
[0084] Figure 17 This is a schematic diagram illustrating the subdivision and repair of quadrilateral mesh holes in this application. As shown in the figure, this diagram... Figure 1 Based on step S600, the model mesh hole data is determined and stored. Since the quadrilateral meshes at positions f3 and f5 are non-triangular, therefore, during execution... Figure 1In steps S800-S900, it is necessary to obtain the non-triangular polygons in the polygon outline and subdivide the non-triangular polygons into multiple triangular meshes. Specifically, when subdividing the non-triangular polygons into multiple triangular meshes, the process can be flexible. It is possible to subdivide the polygon mesh by connecting the closest vertices or by connecting the farthest vertices. For example, in the quadrilateral mesh on the left side of this figure, connecting the two farthest vertices v5 and v2 subdivides the left quadrilateral mesh into triangular meshes f31 and f32. Similarly, the quadrilateral mesh on the right side of this figure can be subdivided into triangular meshes f51 and f52. Then execute... Figure 1 Steps S1000 and S1100 ultimately achieve the color rendering of the triangular meshes at positions f31, f32, f51, and f52; thus completing the repair of the mesh holes with common vertices shown in this figure.
[0085] Figure 18 This is a rendering of the model before hole repair in this application. As shown in the figure, this image is a display of the model before hole repair in the preprocessing software using the method of this application. Specifically, it can be seen that model 111 in the figure has two quadrilateral holes 112, and the two holes 112 share a common vertex.
[0086] Figure 19 This is an image showing the effect of hole repair in the model of this application. As shown in the figure, this image displays the effect of hole repair in the preprocessing software using the method of this application. Specifically, you can see... Figure 18 The two quadrilateral holes 112 on the model 111 are repaired to form the four triangular repair surfaces 113 shown in this figure.
[0087] Figure 20 The electronic device structure diagram for implementing the mesh hole finding and repair method of this application embodiment is shown in the figure. As shown, the electronic device 12 in this figure is exemplified by having a processing unit 121. As shown, an electronic device 12 includes a processing unit 121 and a storage unit 122; wherein the storage unit 122 stores a computer program 123 or instructions that can be executed by the processing unit 121. The computer program 123 or instructions are executed by the processing unit 121 to enable the processing unit 121 to perform actions such as... Figure 1 The steps in the process.
[0088] Storage unit 122 is the third aspect of this application, providing a non-transitory computer-readable storage medium; wherein, storage unit 122 stores instructions executable by at least one processing unit 121, so that when at least one processing unit 121 executes, it performs the following... Figure 1 The steps in the process.
[0089] Storage unit 122 is defined as a non-transitory computer-readable storage medium, which can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as those implemented during execution. Figure 1 The processing unit 121 executes various server functions and data processing by running the non-transient computer program 123, instructions, and modules stored in the storage unit 122, thereby achieving the above-mentioned functions. Figure 1 The corresponding embodiments involve steps involving a computer and a processing unit.
[0090] Storage unit 122 may include a stored program area and a stored data area, wherein the stored program area may store the operating system and applications required for at least one function; the stored data area may store data created when the electronic device 12 is used. Furthermore, storage unit 122 may include a high-speed random access memory unit, and may also include non-transient storage units, such as at least one disk storage device, flash memory device, or other non-transient solid-state storage device. In some embodiments, storage unit 122 may optionally include storage units remotely located relative to processing unit 121, these remote storage units being connected via a network to the electronic device performing model-supported classification generation. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0091] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application-specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processing unit, which may be a dedicated or general-purpose programmable processing unit, capable of receiving data and instructions from a storage system, at least one input unit, and at least one output device, and transmitting data and instructions to the storage system, the at least one input unit, and the at least one output device.
[0092] These computer programs 123 (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processing unit and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, storage unit, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processing unit, including machine-readable media that receive machine instructions determined to be machine-readable signals. The term “machine-readable signal” refers to any signal used to provide machine instructions and / or data to a programmable processing unit.
[0093] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.
[0094] Figure 21 This diagram illustrates the process of finding and repairing holes in a model mesh using an electronic device according to an embodiment of this application. As shown, the user runs a model preprocessing software program through the electronic device 12 to find and repair holes in the model mesh. Subsequently, the stored overall 3D data is sliced to obtain the sliced image data required for the printing stage.
[0095] Figure 22 The structural block diagram of the 3D printing device for implementing the mesh hole finding and repair method of this application is shown in the figure. As shown, a 3D printing device 13 includes a controller 131 and a memory 132; wherein the memory 132 stores a printing control program 133 or instructions that can be executed by the controller 131. The printing control program 133 or instructions are executed by the controller 131 to enable the controller 131 to perform actions such as... Figure 1 The steps in this process are because the 3D printing device 13 can also embed the program function of the mesh hole finding and repair method of this application as needed.
[0096] Figure 23 This diagram illustrates the slicing and printing process following the completion of mesh hole repair using the method described in this application. As shown, the user imports the slice image data obtained after slicing processing into the 3D printing device 13 using a mobile storage device 14 for exposure and printing, thereby obtaining a solid printed model after the hole mesh has been found and repaired.
[0097] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for finding and repairing holes in a model mesh, characterized in that, include: Get and traverse the model's triangular mesh data; A half-edge data structure, including half-edge, opposite edge, face pointer, and starting point, is constructed using face cells; In the half-side data structure, obtain the half-side whose corresponding face pointer is empty and determine it as the boundary edge set; Select one half-edge in sequence from the set of boundary edges and determine the starting point of the opposite side of the selected half-edge as the axis point; Using the pivot point as the center and swinging clockwise, select the next adjacent half that is close to the selected half until multiple consecutive adjacent halfs are selected in sequence to form a closed loop; The closed loop is defined as the polygonal outline of the model mesh hole and stored.
2. The method for finding and repairing holes in a model mesh according to claim 1, characterized in that, Also includes: Obtain the polygonal outlines of the holes in the model mesh; Extract non-triangular polygons from a polygon outline; The non-triangular polygon is subdivided into multiple triangular grids; Extract triangles from the polygon outline and convert them into a triangular mesh; The triangular mesh is then colored and rendered.
3. The method for finding and repairing holes in a model mesh according to claim 1, characterized in that, The endpoints of the half-side and the opposite side are the same but in opposite directions.
4. The method for finding and repairing holes in a model mesh according to claim 1, characterized in that, The face pointer includes the complete topological connection relationship between the half-edge, the opposite edge, the starting point, and the face unit.
5. The method for finding and repairing holes in a model mesh according to claim 1, characterized in that, The half-side data structure also includes a second half adjacent to the half-side and a first half adjacent to the half-side.
6. A device for finding and repairing holes in a model mesh, characterized in that, include: Grid The data traversal module is used to acquire and traverse the model's triangular mesh data; The half-edge structure construction module is used to construct a half-edge data structure, including half-edge, opposite edge, face pointer, and starting point, using face units; The boundary set determination module is used to obtain the half-edges with null corresponding face pointers in the half-edge data structure and determine them as the boundary set; The pivot point determination module is used to select one half of the boundary edge set in sequence and determine the starting point of the opposite side of the selected half of the boundary edge as the pivot point. The closed loop forming module is used to select the next adjacent half of the selected half with the axis point as the axis and in a clockwise swing direction until multiple consecutive adjacent halfs are selected in sequence to form a closed loop. The hole contour storage module is used to determine and store the closed loop as the polygonal contour of the model mesh hole.
7. A device for finding and repairing holes in a model mesh, characterized in that, Also includes: The hole outline acquisition module is used to acquire the polygonal outline of the holes in the model mesh; The non-triangular polygon acquisition module is used to acquire non-triangular polygons in a polygon outline; A non-triangular polygon subdivision module is used to subdivide the non-triangular polygon into multiple triangular meshes; The triangular mesh conversion module is used to extract triangles from polygon outlines and convert them into triangular meshes. The mesh shading and rendering module is used to shading and rendering the triangular mesh.
8. An electronic device, characterized in that, include: At least one processing unit; and a storage unit communicatively connected to the at least one processing unit; wherein, The storage unit stores instructions that can be executed by the at least one processing unit. When the at least one processing unit executes the instructions, it implements the steps of the model mesh hole finding and repair method as described in claim 1 or 2.
9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores a computer program, which, when executed by the processing unit, implements the steps of the model mesh hole finding and repair method as described in claim 1 or 2.
10. A computer program product, characterized in that, The computer program product includes computer instructions, which, when executed by a computer, implement the steps of the model mesh hole finding and repair method as described in claim 1 or 2.