A three-dimensional model lightweight mesh preprocessing method, device and storage medium

By preprocessing the three-dimensional model grid, processing abnormal data of surfaces and points, the problem of poor quality in real-life three-dimensional models in lightweight processing is solved, achieving more efficient lightweight processing and better model quality.

CN118397215BActive Publication Date: 2025-02-25湖南省第一测绘院 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410445512.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-15
Publication Date
2025-02-25
Estimated Expiration
2044-04-15

AI Technical Summary

Technical Problem

During the lightweight processing of real-life three-dimensional models, they fail to effectively process the noise data and wrong patches in the grid, resulting in the impact of the appearance details of the model, low lightweighting rate and high complexity, which may lead to processing failure.

Method used

A three-dimensional model lightweight grid preprocessing method is proposed, which can be processed by processing the surface, including T-type connection processing, isolated surface processing, repeated surface processing, and processing points, including isolated vertex processing and repeated vertex processing, to improve the grid Quality, easy to follow-up lightweight processing.

Benefits of technology

Through pre-processing methods, repeated vertices, repeated vertices, isolated vertices, isolated vertices and T-shaped connections are effectively removed, which improves the overall quality of the three-dimensional model grid, simplifies the lightweight processing process, improves the lightweight rate and successful processing Rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397215B_ABST
    Figure CN118397215B_ABST
Patent Text Reader

Abstract

The present invention discloses a lightweight mesh preprocessing method for a three-dimensional model, which first processes the surface and then processes the point, wherein the surface processing process includes: processing T-type connections: obtaining each edge in a triangular mesh and saving adjacent vertices and triangular faces; extracting all adjacent edges of each edge according to adjacent vertices and triangular faces; searching all edges of the mesh and saving all free edges; traversing the free edges and sequentially adding all adjacent edges as candidate sets according to adjacency relationships; if all free edges have completed traversal, terminating the detection process and obtaining all T-type connection structures; and repairing all T-type connection structures. Compared with the prior art, the present invention can improve the overall quality of the real-scene three-dimensional model mesh and facilitate subsequent lightweight processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of model simulation, and in particular to a three-dimensional model lightweight grid preprocessing method, device and storage medium. Background Art

[0002] Realistic 3D models are widely used in important industries such as digital twins, geographic surveying and mapping, environmental monitoring, and land and resources management due to their rich scene details, realistic geometric appearance, and delicate texture mapping. However, real-life 3D models may contain too much noise data and erroneous patches, which will not only seriously affect the appearance details of the model, but also affect the lightweight processing of the model. In the lightweight processing process of traditional real-life 3D models, mesh preprocessing is usually not considered, resulting in a large amount of invalid redundant data remaining in the model, which seriously affects the overall lightweight rate and increases the complexity of lightweighting, which may lead to the failure of the lightweighting process. In view of this, a lightweight mesh preprocessing method, device, and storage medium for 3D models are proposed. Summary of the invention

[0003] The purpose of the present invention is to provide a three-dimensional model lightweight mesh preprocessing method, device and storage medium, which can improve the overall quality of the real-scene three-dimensional model mesh and facilitate subsequent lightweight processing.

[0004] The above technical objectives of the present invention are achieved through the following technical solutions:

[0005] A lightweight mesh preprocessing method for a three-dimensional model first processes the surface and then processes the points, wherein the surface processing process includes:

[0006] For T-type connection processing:

[0007] A1. Get each edge in the triangle mesh and save the adjacent vertices and triangles.

[0008] A2. Extract all adjacent edges of each edge based on adjacent vertices and triangles;

[0009] A3. Search all edges of the grid and save all free edges;

[0010] A4. Traverse the free edges and add all adjacent edges as candidate sets in sequence according to the adjacency relationship;

[0011] A5: Perform loop closure detection on all edges in the candidate set. If the loop closure is not satisfied, go to step A4.

[0012] A6. If there is a loop, detect the normal of the triangles around the loop and the number of edges of the loop. If it is an inner loop or the number of edges is less than a preset threshold, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4;

[0013] A7, determine the longest edge in the candidate set, and determine whether it overlaps with other edges. If so, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4;

[0014] A8. If all free edges are traversed, the detection process is terminated and all T-type connection structures are obtained;

[0015] A9. Repair all T-connection structures.

[0016] In a preferred embodiment, the T-shaped connection structure includes a first triangular mesh, a second triangular mesh and at least one connecting edge, the first triangular mesh and the second triangular mesh share an edge, which is defined as a shared edge, the two endpoints of the shared edge are defined as a first endpoint and a second endpoint, respectively, the vertex of the first triangular mesh opposite to the shared edge is defined as a first vertex, the vertex of the second triangular mesh opposite to the shared edge is defined as a second vertex, one end of the connecting edge is connected to the first vertex, and the other end is connected to the shared edge, and the connection point between the connecting edge and the shared edge is defined as an intermediate point, and the process of repairing the T-shaped connection structure includes:

[0017] B1, deleting the second triangular mesh;

[0018] B2. Add a triangular mesh consisting of the first endpoint, the middle point adjacent to the first endpoint and the second vertex, a triangular mesh consisting of the second endpoint, the middle point adjacent to the second endpoint and the second vertex, and a triangular mesh consisting of two adjacent middle points and the second vertex.

[0019] In a preferred embodiment, the process of surface treatment further includes:

[0020] To delete isolated faces:

[0021] C1. Index the edges of the triangular mesh and record the number of indexes of each edge of the triangular mesh;

[0022] C2. Delete the triangle mesh where the index number of each edge is 1.

[0023] In a preferred embodiment, the process of surface treatment further includes:

[0024] To delete duplicate faces:

[0025] D1. Sort the three vertex indexes of the triangle mesh according to a predetermined rule, and then sort each face;

[0026] D2. Compare the indexes of two adjacent faces. If they are the same, they are duplicate faces. Delete one of them.

[0027] In a preferred embodiment, the point processing process includes:

[0028] To delete isolated vertices:

[0029] E1. Traverse all triangle meshes and mark the indexed vertices;

[0030] E2. Delete unmarked vertices.

[0031] In a preferred embodiment, the point processing process includes:

[0032] Remove duplicate vertices:

[0033] F1. Sort the coordinate values ​​of the vertices and calculate the distance between any two adjacent vertices;

[0034] F2. When the distance between two adjacent vertices is less than the preset threshold, delete one of them.

[0035] A three-dimensional model lightweight mesh preprocessing device includes a surface processing module and a point processing module. During processing, the surface processing module is first used to perform surface processing, and then the point processing module is used to perform point processing. The surface processing module includes:

[0036] T-type connection processing unit, including:

[0037] The first functional part is used to obtain each edge in the triangular mesh and save adjacent vertices and triangular faces;

[0038] The second functional unit is used to extract all adjacent edges of each edge according to adjacent vertices and triangles;

[0039] The third functional part is used to search all the edges of the grid and save all the free edges;

[0040] The fourth functional part is used to traverse the free edges and add all adjacent edges as candidate sets in sequence according to the adjacency relationship;

[0041] The fifth functional part is used to perform loop detection on all edges in the candidate set, and if it is not satisfied, go to step A4;

[0042] The sixth functional unit is used to detect the normal of the triangles around the loop and the number of edges of the loop if there is a loop. When it is an inner loop or the number of edges is less than a preset threshold, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4;

[0043] The seventh functional unit is used to determine the longest edge in the candidate set, and determine whether it overlaps with other edges. If so, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4;

[0044] The eighth functional part is used to terminate the detection process if all free edges are traversed, and obtain all T-type connection structures;

[0045] The ninth functional part is used to repair all T-type connection structures.

[0046] In a preferred embodiment, the T-shaped connection structure includes a first triangular mesh, a second triangular mesh and at least one connecting edge, the first triangular mesh and the second triangular mesh share an edge, which is defined as a shared edge, the two endpoints of the shared edge are defined as a first endpoint and a second endpoint, respectively, the vertex of the first triangular mesh opposite to the shared edge is defined as a first vertex, the vertex of the second triangular mesh opposite to the shared edge is defined as a second vertex, one end of the connecting edge is connected to the first vertex, and the other end is connected to the shared edge, the connection point between the connecting edge and the shared edge is defined as an intermediate point, and the process of repairing the T-shaped connection structure is performed using a T-shaped connection structure repair function module, and the T-shaped connection structure repair function module includes:

[0047] A mesh deletion functional unit is used to delete the second triangular mesh; a triangular mesh adding unit is used to add a triangular mesh consisting of the first endpoint, the middle point adjacent to the first endpoint and the second vertex, a triangular mesh consisting of the second endpoint, the middle point adjacent to the second endpoint and the second vertex, and a triangular mesh consisting of two adjacent middle points and the second vertex.

[0048] In a preferred embodiment, the surface processing module further includes:

[0049] Isolated surface processing functional unit:

[0050] The triangle mesh index unit is used to index the edges of the triangle mesh and record the index times of each edge of the triangle mesh; the triangle mesh deletion unit is used to delete the triangle mesh whose index times of each edge is 1.

[0051] In a preferred embodiment, the surface processing module further includes:

[0052] Repeated surface processing function module, including:

[0053] The sorting function unit is used to sort the three vertex indexes of the triangle mesh according to a predetermined rule, and then sort each face; the duplicate face deletion module is used to compare the indexes of two adjacent faces, and the same faces are duplicate faces and one of them is deleted.

[0054] In a preferred embodiment, the point processing module includes:

[0055] Isolated vertex processing function module, including:

[0056] The vertex marking unit is used to traverse all triangle meshes and mark the indexed vertices; the isolated point deletion unit is used to delete unmarked vertices.

[0057] In a preferred embodiment, the point processing module includes:

[0058] Repeat the vertex processing function module, including:

[0059] The vertex distance comparison unit is used to sort the coordinate values ​​of the vertices and calculate the distance between any two adjacent vertices; the duplicate vertex deletion unit is used to delete one of the two adjacent vertices when the distance between them is less than a preset threshold.

[0060] A computer-readable storage medium stores a computer program, which implements the steps of the three-dimensional model lightweight grid preprocessing method when executed by a processor.

[0061] Compared with the prior art, the present invention proposes a mesh preprocessing method for the lightweight processing of real-life three-dimensional models, which can effectively deal with problems such as repeated vertices, repeated facets, isolated vertices, isolated facets and T-type connections, thereby improving the overall quality of the real-life three-dimensional model mesh and facilitating subsequent lightweight processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 This is a schematic diagram of the grid display of this real-life 3D model.

[0063] Figure 2 This is a schematic diagram of vertex and vertex index data.

[0064] Figure 3 This is a schematic diagram of a T-type connection (with only one connecting edge).

[0065] Figure 4 This is a schematic diagram of a T-type connection (with multiple connecting edges).

[0066] Figure 5This is a schematic diagram of T-edge repair (when there are multiple connected edges). DETAILED DESCRIPTION

[0067] The present invention is further described in detail below in conjunction with the accompanying drawings.

[0068] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.

[0069] Realistic 3D models are usually composed of many adjacent local block models. Each block is an independent mesh, and each block contains multiple LOD models from low-poly to high-poly. Figure 1 The local mesh of the real-life 3D model is shown. Oblique photography models are usually generated through active or passive scanning. Errors will inevitably occur during the point cloud triangulation process, resulting in defects in the model mesh. These defects usually manifest as duplicate vertices, duplicate facets, isolated vertices, isolated facets, and T-connections. These problems may cause lightweight face reduction and texture baking failure.

[0070] The real-life 3D mesh data includes vertex data and vertex index data. The vertex data defines the vertex coordinates of the model, and the vertex index data defines the triangular facets of the model (taking a triangular mesh as an example). Figure 2 A schematic diagram of vertex and vertex index data is given.

[0071] In order to solve the problems of repeated vertices, repeated facets, isolated vertices, isolated facets and T-type connections, a lightweight mesh preprocessing method for three-dimensional models is proposed as follows:

[0072] A lightweight mesh preprocessing method for a three-dimensional model first processes the surface and then processes the points, wherein the surface processing process includes:

[0073] For T-type connection processing:

[0074] A1. Get each edge in the triangle mesh and save the adjacent vertices and triangles.

[0075] A2. Extract all adjacent edges of each edge based on adjacent vertices and triangles;

[0076] A3. Search all edges of the grid and save all free edges;

[0077] A4. Traverse the free edges and add all adjacent edges as candidate sets in sequence according to the adjacency relationship;

[0078] A5: Perform loop closure detection on all edges in the candidate set. If the loop closure is not satisfied, go to step A4.

[0079] A6. If there is a loop, detect the normal of the triangles around the loop and the number of edges of the loop. If it is an inner loop or the number of edges is less than a preset threshold, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4;

[0080] A7, determine the longest edge in the candidate set, and determine whether it overlaps with other edges. If so, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4;

[0081] A8. If all free edges are traversed, the detection process is terminated and all T-type connection structures are obtained;

[0082] A9. Repair all T-connection structures.

[0083] The following are the explanations of the relevant terms in the above steps:

[0084] Free edge: When an edge is referenced by only one triangle face, it is a free edge;

[0085] Candidate set: A set of adjacent free edges, used for further T-connection detection, so it is called a candidate set;

[0086] Loop detection: When the free edges of the candidate set are connected into a closed loop, there may be a T-type connection. The detection of closed loops is called loop detection.

[0087] Preset threshold: The detection of the number of loop edges requires setting a threshold to filter the detection process. A too large threshold will affect the detection performance.

[0088] Further, the T-shaped connection structure includes a first triangular mesh, a second triangular mesh and at least one connecting edge, the first triangular mesh and the second triangular mesh share an edge, which is defined as a shared edge, two endpoints of the shared edge are defined as a first endpoint and a second endpoint, respectively, a vertex of the first triangular mesh opposite to the shared edge is defined as a first vertex, a vertex of the second triangular mesh opposite to the shared edge is defined as a second vertex, one end of the connecting edge is connected to the first vertex, and the other end is connected to the shared edge, and a connection point between the connecting edge and the shared edge is defined as an intermediate point, and a process of repairing the T-shaped connection structure includes:

[0089] B1, deleting the second triangular mesh;

[0090] B2. Add a triangular mesh consisting of the first endpoint, the middle point adjacent to the first endpoint and the second vertex, a triangular mesh consisting of the second endpoint, the middle point adjacent to the second endpoint and the second vertex, and a triangular mesh consisting of two adjacent middle points and the second vertex.

[0091] In order to explain the repair process of T-type connection in more detail, the following is a description with specific examples:

[0092] There is only one connecting edge:

[0093] like Figure 3 As shown. Vertex D is on edge BC, resulting in the following Figure 3 (a) T-type connection shown. Figure 3 The topological structure of the T-connection shown in (a) is equivalent to Figure 3 (b) The BCD region is shown. Figure 3 The BCD region shown in (a) is not a legal polygon structure, so it needs to be removed. The specific processing method is to delete the edge BC, connect vertices D and E, delete triangle BCE in the vertex index data, and add triangles BDE and CDE.

[0094] There are multiple connected edges:

[0095] like Figure 4 By translating the coordinates of vertices D, E, and F without changing the topological structure of the model, we can get Figure 4 (b) The T-shaped edge structure is actually that the edges BD, DE, EF, and FC overlap with the edge BC, and there is no triangle filling in the BDEFC area. The vertices D, E, and F are on the edge BC, resulting in the following Figure 4 (a) T-type connection shown. Figure 4 The topological structure of the T-connection shown in (a) is equivalent to Figure 4 (b) The BDEFC region shown. Figure 4 The BDEFC region shown in (a) is not a legal polygonal structure, so it needs to be removed. Figure 5 The specific processing method is as follows:

[0096] (1) Delete the triangle BCG in the vertex index data;

[0097] (2) Add triangles BDG, DEG, EFG and FCG.

[0098] In this embodiment, the process of surface processing further includes:

[0099] Delete isolated faces. The detection of isolated faces requires searching the index times of the edges, that is, the index times of each edge of an isolated face is 1. An isolated face does not have any connection with other faces. Deleting an isolated face does not affect other data and can be deleted directly. Figure 2 In the vertex index data shown, the vertex data corresponding to the isolated face is directly deleted, and the subsequent vertex index data are moved forward in sequence. Specifically, the process of deleting the isolated face includes:

[0100] C1. Index the edges of the triangular mesh and record the number of indexes of each edge of the triangular mesh;

[0101] C2. Delete the triangle mesh where the index number of each edge is 1.

[0102] Furthermore, the face-to-face processing process also includes:

[0103] Delete duplicate faces. Duplicate faces mean that the vertex indexes of two faces are exactly the same. When searching, you need to compare the vertex indexes of any two faces. In order to reduce the time complexity, first sort the three vertex indexes of the face according to certain rules, and then sort each face. Duplicate faces can be determined by comparing the indexes of two adjacent faces. The time complexity is O (n-1). Duplicate faces can be deleted directly without affecting other data. The subsequent vertex index data is moved forward in sequence. Specifically, the process of deleting duplicate faces includes:

[0104] D1. Sort the three vertex indexes of the triangle mesh according to a predetermined rule, and then sort each face;

[0105] D2. Compare the indexes of two adjacent faces. If they are the same, they are duplicate faces. Delete one of them.

[0106] Furthermore, the point processing process includes:

[0107] Delete isolated vertices. Figure 2 As shown in the figure, there is no vertex data indexed. For the retrieval of isolated vertices, all triangles can be traversed and the indexed vertices can be marked. Unmarked vertices are isolated vertices. These data are redundant data and should be deleted, and the subsequent vertex data should be moved forward. Since the positions of the subsequent vertex data have changed, the values ​​of the vertex index data must also be updated. Specifically, the process of deleting isolated vertices includes:

[0108] E1. Traverse all triangle meshes and mark the indexed vertices;

[0109] E2. Delete unmarked vertices.

[0110] Furthermore, the point processing process includes:

[0111] Delete duplicate vertices, which are vertices with the same coordinate values ​​or distances less than a certain threshold. The search for duplicate vertices requires comparing the distances between any two vertices, and the time complexity is O(n2). To improve the search efficiency, first sort the coordinate values ​​of the vertices (the time complexity is O(nlgn)), then calculate the distance between any two adjacent vertices (the time complexity is O(n-1)), and when the distance is less than the threshold, they are judged to be duplicate vertices. The process of deleting duplicate vertices includes:

[0112] F1. Sort the coordinate values ​​of the vertices and calculate the distance between any two adjacent vertices;

[0113] F2. When the distance between two adjacent vertices is less than the preset threshold, delete one of them.

[0114] The insertion or deletion of vertices will affect the vertex index data, so the preprocessing of the mesh should process the triangle faces first and then the vertices. Therefore, in this embodiment, the processing order of the mesh data is: isolated faces, duplicate faces, T-connections, isolated points and duplicate points.

[0115] Embodiment 2

[0116] A three-dimensional model lightweight mesh preprocessing device includes a surface processing module and a point processing module. During processing, the surface processing module is first used to perform surface processing, and then the point processing module is used to perform point processing. The surface processing module includes:

[0117] T-type connection processing unit, including:

[0118] The first functional part is used to obtain each edge in the triangular mesh and save adjacent vertices and triangular faces;

[0119] The second functional unit is used to extract all adjacent edges of each edge according to adjacent vertices and triangles;

[0120] The third functional part is used to search all the edges of the grid and save all the free edges;

[0121] The fourth functional part is used to traverse the free edges and add all adjacent edges as candidate sets in sequence according to the adjacency relationship;

[0122] The fifth functional part is used to perform loop detection on all edges in the candidate set, and if it is not satisfied, go to step A4;

[0123] The sixth functional unit is used to detect the normal of the triangles around the loop and the number of edges of the loop if there is a loop. When it is an inner loop or the number of edges is less than a preset threshold, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4;

[0124] The seventh functional unit is used to determine the longest edge in the candidate set, and determine whether it overlaps with other edges. If so, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4;

[0125] The eighth functional part is used to terminate the detection process if all free edges are traversed, and obtain all T-type connection structures;

[0126] The ninth functional part is used to repair all T-type connection structures.

[0127] Further, the T-shaped connection structure includes a first triangular mesh, a second triangular mesh and at least one connecting edge, the first triangular mesh and the second triangular mesh share an edge, which is defined as a shared edge, two endpoints of the shared edge are defined as a first endpoint and a second endpoint, respectively, a vertex of the first triangular mesh opposite to the shared edge is defined as a first vertex, a vertex of the second triangular mesh opposite to the shared edge is defined as a second vertex, one end of the connecting edge is connected to the first vertex, and the other end is connected to the shared edge, and a connection point between the connecting edge and the shared edge is defined as an intermediate point, and a process of repairing the T-shaped connection structure is performed using a T-shaped connection structure repair function module, and the T-shaped connection structure repair function module includes:

[0128] A mesh deletion functional unit is used to delete the second triangular mesh; a triangular mesh adding unit is used to add a triangular mesh consisting of the first endpoint, the middle point adjacent to the first endpoint and the second vertex, a triangular mesh consisting of the second endpoint, the middle point adjacent to the second endpoint and the second vertex, and a triangular mesh consisting of two adjacent middle points and the second vertex.

[0129] Furthermore, the surface processing module also includes:

[0130] Isolated surface processing functional unit:

[0131] The triangle mesh index unit is used to index the edges of the triangle mesh and record the index times of each edge of the triangle mesh; the triangle mesh deletion unit is used to delete the triangle mesh whose index times of each edge is 1.

[0132] Furthermore, the surface processing module also includes:

[0133] Repeated surface processing function module, including:

[0134] The sorting function unit is used to sort the three vertex indexes of the triangle mesh according to a predetermined rule, and then sort each face; the duplicate face deletion module is used to compare the indexes of two adjacent faces. The same faces are duplicate faces, and one of them is deleted.

[0135] Further, the point processing module includes:

[0136] The isolated vertex processing function module includes: a vertex marking unit for traversing all triangle meshes and marking the indexed vertices; and an isolated point deletion unit for deleting unmarked vertices.

[0137] Further, the point processing module includes:

[0138] The duplicate vertex processing function module includes: a vertex distance comparison unit, which is used to sort the coordinate values ​​of the vertices and calculate the distance between any two adjacent vertices; and a duplicate vertex deletion unit, which is used to delete one of the two adjacent vertices when the distance between them is less than a preset threshold.

[0139] Embodiment 3

[0140] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of implementing the three-dimensional model lightweight mesh preprocessing method are implemented.

[0141] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "include..." or "comprise..." do not exclude the existence of other elements in the process, method, article or terminal device including the elements. In addition, in this article, "greater than", "less than", "exceed" and the like are understood to exclude the number itself; "above", "below", "within" and the like are understood to include the number itself.

[0142] The above description of the embodiments is to facilitate the understanding and use of the present invention by those skilled in the art. It is obvious that those skilled in the art can easily make various modifications to the embodiments and apply the general principles described herein to other embodiments without creative work. Therefore, the present invention is not limited to the above embodiments. Improvements and modifications made by those skilled in the art based on the disclosure of the present invention without departing from the scope of the present invention should be within the protection scope of the present invention.

Claims

1. A lightweight mesh preprocessing method for a three-dimensional model, characterized in that: First, the surface is processed, and then the point is processed. The surface processing process includes: For T-type connection processing: A1. Get each edge in the triangle mesh and save the adjacent vertices and triangles. A2. Extract all adjacent edges of each edge based on adjacent vertices and triangles; A3. Search all edges of the grid and save all free edges; A4. Traverse the free edges and add all adjacent edges as candidate sets in sequence according to the adjacency relationship; A5: Perform loop closure detection on all edges in the candidate set. If the loop closure is not satisfied, go to step A4. A6. If there is a loop, detect the normal of the triangles around the loop and the number of edges of the loop. If it is an inner loop or the number of edges is less than a preset threshold, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4; A7, determine the longest edge in the candidate set, and determine whether it overlaps with other edges. If so, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4; A8. If all free edges are traversed, the detection process is terminated and all T-type connection structures are obtained; A9. Repair all T-type connection structures; The point processing process includes: To delete isolated vertices: E1. Traverse all triangle meshes and mark the indexed vertices; E2. Delete unmarked vertices.

2. A three-dimensional model lightweight mesh preprocessing method according to claim 1, characterized in that: The T-shaped connection structure includes a first triangular mesh, a second triangular mesh and at least one connecting edge, the first triangular mesh and the second triangular mesh share an edge, which is defined as a shared edge, two endpoints of the shared edge are defined as a first endpoint and a second endpoint, respectively, a vertex of the first triangular mesh opposite to the shared edge is defined as a first vertex, a vertex of the second triangular mesh opposite to the shared edge is defined as a second vertex, one end of the connecting edge is connected to the first vertex, and the other end is connected to the shared edge, and a connection point between the connecting edge and the shared edge is defined as an intermediate point, and a process of repairing the T-shaped connection structure includes: B1, deleting the second triangular mesh; B2. Add a triangular mesh consisting of the first endpoint, the middle point adjacent to the first endpoint and the second vertex, a triangular mesh consisting of the second endpoint, the middle point adjacent to the second endpoint and the second vertex, and a triangular mesh consisting of two adjacent middle points and the second vertex.

3. A three-dimensional model lightweight mesh preprocessing method according to claim 1, characterized in that: The face-to-face treatment process also includes: To delete isolated faces: C1. Index the edges of the triangular mesh and record the number of indexes of each edge of the triangular mesh; C2. Delete the triangle mesh where the index number of each edge is 1.

4. The method for preprocessing lightweight mesh of a three-dimensional model according to claim 1, characterized in that: The face-to-face treatment process also includes: To delete duplicate faces: D1. Sort the three vertex indexes of the triangle mesh according to the predetermined rules, and then Sort the faces; D2. Compare the indexes of two adjacent faces. If they are the same, they are duplicate faces. Delete one of them.

5. The method for preprocessing lightweight mesh of a three-dimensional model according to claim 1, characterized in that: The point processing process includes: Remove duplicate vertices: F1. Sort the coordinate values ​​of the vertices and calculate the distance between any two adjacent vertices; F2. When the distance between two adjacent vertices is less than the preset threshold, delete one of them.

6. A three-dimensional model lightweight mesh preprocessing device, characterized in that: It includes a surface processing module and a point processing module. During processing, the surface processing module is used to perform surface processing first, and then the point processing module is used to perform point processing. The surface processing module includes: T-type connection processing unit, including: The first functional part is used to obtain each edge in the triangular mesh and save adjacent vertices and triangular faces; The second functional unit is used to extract all adjacent edges of each edge according to adjacent vertices and triangles; The third functional part is used to search all the edges of the grid and save all the free edges; The fourth functional part is used to traverse the free edges and add all adjacent edges as candidate sets in sequence according to the adjacency relationship; The fifth functional part is used to perform loop detection on all edges in the candidate set, and if it is not satisfied, go to step A4; The sixth functional unit is used to detect the normal of the triangles around the loop and the number of edges of the loop if there is a loop. When it is an inner loop or the number of edges is less than a preset threshold, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4; The seventh functional unit is used to determine the longest edge in the candidate set, and determine whether it overlaps with other edges. If so, delete the candidate set in the free edge and go to step A4; otherwise, go to step A4; The eighth functional part is used to terminate the detection process if all free edges are traversed, and obtain all T-type connection structures; The ninth functional part is used to repair all T-type connection structures; The point processing process includes: To delete isolated vertices: E1. Traverse all triangle meshes and mark the indexed vertices; E2. Delete unmarked vertices.

7. A three-dimensional model lightweight mesh preprocessing device according to claim 6, characterized in that: The T-shaped connection structure includes a first triangular mesh, a second triangular mesh and at least one connecting edge. The first triangular mesh and the second triangular mesh share an edge, which is defined as a shared edge. Two endpoints of the shared edge are defined as a first endpoint and a second endpoint, respectively. A vertex of the first triangular mesh opposite to the shared edge is defined as a first vertex. A vertex of the second triangular mesh opposite to the shared edge is defined as a second vertex. One end of the connecting edge is connected to the first vertex, and the other end is connected to the shared edge. A connection point between the connecting edge and the shared edge is defined as an intermediate point. The process of repairing the T-shaped connection structure is performed using a T-shaped connection structure repairing function module. The T-shaped connection structure repairing function module includes: A mesh deleting functional unit, used for deleting the second triangular mesh; A triangle mesh adding unit is used to add a triangle mesh consisting of the first endpoint, the middle point adjacent to the first endpoint and the second vertex, a triangle mesh consisting of the second endpoint, the middle point adjacent to the second endpoint and the second vertex, and a triangle mesh consisting of two adjacent middle points and the second vertex.

8. A three-dimensional model lightweight mesh preprocessing device according to claim 6, characterized in that: The surface processing module also includes: Isolated surface processing function module, including: A triangle mesh index unit is used to index the edges of the triangle mesh and record the index times of each edge of the triangle mesh; The triangle mesh deletion unit is used to delete the triangle mesh whose index number of each edge is 1.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the three-dimensional model lightweight mesh preprocessing method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Simplified method and device for edge collapse of 3D geometry graphics

    CN105006022A

  • 3D printing-oriented triangular mesh hole segmentation method and system

    CN110544255A