Hole gap repairing method and device for vehicle body modeling
By using automated boundary loop detection and triangular patch repair, combined with Laplace smoothing adjustment, the problem of balancing geometry and topology in hole and gap repair is solved, improving repair efficiency and quality consistency, and is applicable to vehicle body modeling.
Patent Information
- Application Number
- CN202511383302.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2026-02-03
AI Technical Summary
In existing technologies, hole and crevice repair methods cannot simultaneously take into account both geometry and topology, resulting in low repair efficiency and cumbersome manual operation, making it difficult to guarantee consistent quality.
Holes are identified by automated boundary ring detection, the boundary rings are covered with triangular patches, and the shape and normal direction of the triangular patches are adjusted by Laplacian smoothing and topology optimization to generate a high-quality 3D mesh model of the vehicle body.
It achieves efficient hole repair, maintains the manifold properties of the mesh, improves repair efficiency and quality consistency, reduces manual intervention, and ensures the stability of the model in aerodynamic simulation.
Smart Images

Figure CN121456986A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automotive engineering technology, and in particular to a method and apparatus for repairing holes and gaps in vehicle body modeling. Background Technology
[0002] In the automotive industry, in order to develop vehicle aerodynamic performance, the vehicle body model needs to be preprocessed before CFD simulation. This requires overall quality repair of the scanned vehicle body mesh, enabling the detection and repair of quality problems such as holes in the scanned model, and remeshing to reduce the mesh size.
[0003] In related technologies, based on the principles and characteristics of the methods, hole and crevice repair methods can be divided into two types: manual methods and data-driven methods. Manual methods typically rely on engineers to perform quality repair on scanned vehicle models through two approaches: first, importing the model into pre-processing software, where engineers manually inspect each point and surface to determine the types of problems such as holes and crevices, and then manually repair them based on experience; second, using functional plugins in the pre-processing software to automatically detect and locally repair specific types of defects. Data-driven methods mainly include two categories: traditional geometric methods and deep learning-based methods. Traditional methods can effectively preserve the model's topological structure, but often have shortcomings in restoring geometric details; while surface-driven repair-type hole-filling algorithms can perform image-level mesh repair by projecting the 3D mesh boundaries into a depth map, thereby restoring complex geometric shapes.
[0004] However, in related technologies, whether manual or data-driven methods for repairing holes and gaps, most methods involve a trade-off between geometry and topology, making it difficult to simultaneously address both. Furthermore, most methods focus only on a single type of defect. When multiple problems coexist, a single repair often introduces new structural errors, affecting the stability of the model in subsequent aerodynamic simulations. Moreover, the vehicle mesh after scanning and modeling still requires manual inspection and repair, which is highly dependent on skilled personnel, cumbersome, resource-intensive, and susceptible to human experience, resulting in low efficiency in hole repair and difficulty in ensuring consistent repair quality. These issues urgently need to be addressed. Summary of the Invention
[0005] This application provides a method and apparatus for repairing holes and gaps in vehicle body modeling, to solve the problems in related technologies. In most related technologies, it is difficult to simultaneously take into account both geometry and topology. Moreover, most methods only focus on a single type of defect. When multiple problems coexist, a single repair often leads to new structural errors, affecting the stability of the model in subsequent aerodynamic simulations. Furthermore, the vehicle body mesh after scanning and modeling still needs to be manually inspected and repaired, which is highly dependent on highly skilled personnel, cumbersome to operate, requires high resource investment, is easily affected by human experience, and leads to low efficiency in hole repair and difficulty in ensuring consistent repair quality.
[0006] The first aspect of this application provides a method for repairing holes and gaps in vehicle body modeling, comprising the following steps: reading a three-dimensional mesh model of the target vehicle body to obtain the topology of the three-dimensional mesh model and identifying at least one hole to be repaired in the topology; obtaining the number of vertices of the boundary ring corresponding to the at least one hole to be repaired, and covering the boundary ring with triangular facets according to the number of vertices until the number of vertices reaches a preset number to generate an initial repair vehicle body three-dimensional mesh model; adjusting the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body three-dimensional mesh model until the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body three-dimensional mesh model respectively meet the target shape, target direction, and target repair requirements to generate a final repair vehicle body three-dimensional mesh model.
[0007] Through the above technical means, the embodiments of this application can ensure the identification of all holes without omission through automated boundary loop detection, and effectively maintain the manifold properties of the mesh while efficiently filling the holes using classic triangulation, laying a good topological foundation for subsequent processing; finally, by adjusting the steps, the geometric smoothness and visual consistency of the triangular patch repair area are effectively improved, and possible non-manifold errors are corrected. While taking into account both geometry and topology, the repair efficiency of holes is effectively improved, ensuring the consistency of the repair quality of the final repaired 3D mesh model of the vehicle body.
[0008] Optionally, in one embodiment of this application, identifying at least one hole to be repaired in the topology includes: traversing each boundary of each grid corresponding to the topology to obtain boundary edges belonging to a single face; based on the boundary edges, collecting boundary vertices connected to the boundary edges, and connecting the boundary edges and the boundary vertices to generate the boundary loop, so as to identify the at least one hole to be repaired based on the boundary loop.
[0009] Through the above technical means, the embodiments of this application can obtain the boundary edges belonging to a single face by traversing each boundary of each grid corresponding to the topology structure, and determine the hole to be repaired based on the boundary edges to generate a boundary loop. This can accurately understand the closed boundary range of the hole in the vehicle body model, thereby avoiding omission of the hole to be repaired or misjudgment of the position and size of the hole to be repaired. At the same time, the embodiments of this application can also store the hole to be repaired in the form of a boundary loop, providing a direct basis for the repair of the hole to be repaired.
[0010] Optionally, in one embodiment of this application, obtaining the number of vertices of the boundary ring corresponding to the at least one hole to be repaired, and covering the boundary ring with triangular facets according to the number of vertices until the number of vertices reaches a preset number to generate an initial repair vehicle body 3D mesh model, includes: identifying multiple consecutive vertices in the boundary ring that satisfy a triangular shape to generate the first triangle to be repaired in the boundary ring; covering the first triangle to be repaired in the boundary ring with the triangular facets to repair the first triangle to be repaired in the boundary ring; removing the repaired first triangle to be repaired from the boundary ring to generate a new boundary ring, and identifying multiple consecutive vertices in the new boundary ring that satisfy a triangular shape to generate the first triangle to be repaired in the new boundary ring, and covering the first triangle to be repaired in the new boundary ring with the triangular facets until the number of vertices reaches a preset number to generate the initial repair vehicle body 3D mesh model.
[0011] Through the above technical means, the embodiments of this application can quickly repair boundary loops by identifying triangles, repairing triangles, and trimming triangles. Only one triangle is added at a time and the vertex list is modified, which helps to maintain the manifold properties of the mesh in the vehicle body 3D mesh model and will not generate self-intersecting or non-manifold edges, thus providing a good foundation for further processing of the initial repair of the vehicle body 3D mesh model.
[0012] Optionally, in one embodiment of this application, adjusting the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model until the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model reach the target shape, target direction, and target repair requirements, respectively, to generate the final repair vehicle body 3D mesh model, includes: adjusting the vertex positions of the triangular facets to the target positions based on a Laplacian smoothing strategy to complete the shape adjustment of the triangular facets; and adjusting the normal direction of the triangular facets to be in the same normal direction as the original mesh corresponding to the vehicle body 3D mesh model to complete the normal direction adjustment of the triangular facets.
[0013] Through the above technical means, the embodiments of this application can adjust the shape and normal direction of the triangular facets to ensure that the normal direction of all newly added triangular facets in the final repaired vehicle body 3D mesh model faces outward and is consistent with the surrounding original vehicle body surface, thereby ensuring that the repaired part can maintain the same lighting effect as the original vehicle body during rendering, and there will be no black blocks or display errors.
[0014] Optionally, in one embodiment of this application, after generating the final repaired vehicle body 3D mesh model, the method further includes: detecting the geometry and topology of the final repaired 3D mesh model; and, if the geometry and topology do not meet the target fusion conditions with the original mesh corresponding to the vehicle body 3D mesh model, readjusting the shape, normal direction, and non-manifold edges of the triangular facets in the final repaired vehicle body 3D mesh model until the geometry and topology meet the target fusion conditions with the original mesh corresponding to the vehicle body 3D mesh model.
[0015] Through the above technical means, the embodiments of this application can adjust the shape, normal direction and non-manifold edge of the triangular facet in the repair area when the geometry and topology of the final repaired vehicle body 3D mesh model cannot maintain high-quality fusion with the original mesh corresponding to the original vehicle body 3D mesh model. This ensures that the repaired area in the target vehicle body model can maintain a high degree of fusion with the original area before repair.
[0016] A second aspect of this application provides a hole and gap repair device for vehicle body modeling, comprising: an identification module for reading a three-dimensional mesh model of a target vehicle body to obtain the topology of the three-dimensional mesh model and identify at least one hole to be repaired in the topology; a repair module for obtaining the number of vertices of the boundary ring corresponding to the at least one hole to be repaired, and covering the boundary ring with triangular facets according to the number of vertices until the number of vertices reaches a preset number to generate an initial repair vehicle body three-dimensional mesh model; and an adjustment module for adjusting the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body three-dimensional mesh model until the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body three-dimensional mesh model reach the target shape, target direction, and target repair requirements, respectively, to generate a final repair vehicle body three-dimensional mesh model.
[0017] Through the above technical means, the embodiments of this application can ensure the identification of all holes without omission through automated boundary loop detection, and effectively maintain the manifold properties of the mesh while efficiently filling the holes using classic triangulation, laying a good topological foundation for subsequent processing; finally, by adjusting the steps, the geometric smoothness and visual consistency of the triangular patch repair area are effectively improved, and possible non-manifold errors are corrected. While taking into account both geometry and topology, the repair efficiency of holes is effectively improved, ensuring the consistency of the repair quality of the final repaired 3D mesh model of the vehicle body.
[0018] Optionally, in one embodiment of this application, the identification module includes: a traversal unit, configured to traverse each boundary of each grid corresponding to the topology to obtain boundary edges belonging to a single face; and an identification unit, configured to collect boundary vertices connected to the boundary edges based on the boundary edges, and connect the boundary edges and the boundary vertices to generate the boundary loop, so as to identify the at least one hole to be repaired based on the boundary loop.
[0019] Through the above technical means, the embodiments of this application can obtain the boundary edges belonging to a single face by traversing each boundary of each grid corresponding to the topology structure, and determine the hole to be repaired based on the boundary edges to generate a boundary loop. This can accurately understand the closed boundary range of the hole in the vehicle body model, thereby avoiding omission of the hole to be repaired or misjudgment of the position and size of the hole to be repaired. At the same time, the embodiments of this application can also store the hole to be repaired in the form of a boundary loop, providing a direct basis for the repair of the hole to be repaired.
[0020] Optionally, in one embodiment of this application, the repair module includes: a generation unit, configured to identify multiple consecutive vertices in the boundary ring that satisfy a triangular shape to generate a first triangle to be repaired in the boundary ring; a repair unit, configured to cover the first triangle to be repaired in the boundary ring with the triangular facets to repair the first triangle to be repaired in the boundary ring; and a removal unit, configured to remove the repaired first triangle to be repaired from the boundary ring to generate a new boundary ring, and identify multiple consecutive vertices in the new boundary ring that satisfy a triangular shape to generate a first triangle to be repaired in the new boundary ring, and cover the first triangle to be repaired in the new boundary ring with the triangular facets until the number of vertices reaches a preset number to generate the initial repair vehicle body 3D mesh model.
[0021] Through the above technical means, the embodiments of this application can quickly repair boundary loops by identifying triangles, repairing triangles, and trimming triangles. Only one triangle is added at a time and the vertex list is modified, which helps to maintain the manifold properties of the mesh in the vehicle body 3D mesh model and will not generate self-intersecting or non-manifold edges, thus providing a good foundation for further processing of the initial repair of the vehicle body 3D mesh model.
[0022] Optionally, in one embodiment of this application, the adjustment module includes: a first adjustment unit, used to adjust the vertex position of the triangular facet to a target position based on a Laplacian smoothing strategy, so as to complete the shape adjustment of the triangular facet; and a second adjustment unit, used to adjust the normal direction of the triangular facet to be in the same normal direction as the original mesh corresponding to the three-dimensional mesh model of the vehicle body, so as to complete the adjustment of the normal direction of the triangular facet.
[0023] Through the above technical means, the embodiments of this application can adjust the shape and normal direction of the triangular facets to ensure that the normal direction of all newly added triangular facets in the final repaired vehicle body 3D mesh model faces outward and is consistent with the surrounding original vehicle body surface, thereby ensuring that the repaired part can maintain the same lighting effect as the original vehicle body during rendering, and there will be no black blocks or display errors.
[0024] Optionally, in one embodiment of this application, it further includes: a detection module, used to detect the geometry and topology of the final repaired three-dimensional mesh model after generating the final repaired vehicle body mesh model; and a processing module, used to readjust the shape, normal direction, and non-manifold edges of the triangular facets in the final repaired vehicle body mesh model until the geometry and topology satisfy the target fusion conditions with the original mesh corresponding to the vehicle body mesh model, if the geometry and topology do not meet the target fusion conditions with the original mesh corresponding to the vehicle body mesh model.
[0025] Through the above technical means, the embodiments of this application can adjust the shape, normal direction and non-manifold edge of the triangular facet in the repair area when the geometry and topology of the final repaired vehicle body 3D mesh model cannot maintain high-quality fusion with the original mesh corresponding to the original vehicle body 3D mesh model. This ensures that the repaired area in the target vehicle body model can maintain a high degree of fusion with the original area before repair.
[0026] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the hole and gap repair method for vehicle body modeling as described in the above embodiments.
[0027] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for repairing holes and gaps in vehicle body modeling.
[0028] A fifth aspect of this application provides a computer program product, including a computer program that, when executed, is used to implement the above-described method for repairing holes and gaps in vehicle body modeling.
[0029] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0030] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a hole and gap repair method for vehicle body modeling provided according to an embodiment of this application; Figure 2 This is a schematic diagram of a hole / gap and the repair result according to an embodiment of this application; Figure 3 This is a schematic diagram of a rapid scanning modeling system for vehicle bodies with holes and gaps according to an embodiment of this application; Figure 4 This is a schematic diagram of the hole and gap repair device for vehicle body modeling provided in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application.
[0031] Figure label: 10- Hole and gap repair device for vehicle body modeling; 100- Identification module, 200- Repair module and 300- Adjustment module; 501- Memory, 502- Processor and 503- Communication interface. Detailed Implementation
[0032] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0033] The following describes a method and apparatus for repairing holes and gaps in vehicle body modeling, based on embodiments of this application, with reference to the accompanying drawings. Regarding the related technologies mentioned in the background section, most hole and gap repair methods struggle to simultaneously consider both geometry and topology; and most methods focus only on a single type of defect. When multiple problems coexist, a single repair often introduces new structural errors, affecting the stability of the model in subsequent aerodynamic simulations. Furthermore, the scanned vehicle body mesh requires manual inspection and repair, which heavily relies on highly skilled personnel, is cumbersome, resource-intensive, and susceptible to human experience, leading to low efficiency and difficulty in ensuring consistent repair quality. This application provides a method for repairing holes and gaps in vehicle body modeling. In this method, at least one hole to be repaired can be identified based on the topology of the target vehicle's 3D mesh model, and repaired using triangular facets until a final repaired 3D mesh model of the vehicle body is generated. This approach achieves the goal of identifying all holes without omission through automated boundary loop detection, and effectively maintains the manifold properties of the mesh while efficiently filling holes using classic triangulation, laying a solid topological foundation for subsequent processing. Finally, Laplacian smoothing and topology optimization steps effectively improve the geometric smoothness and visual consistency of the triangular patch repair area, and correct potential non-manifold errors. By balancing geometry and topology, this approach significantly improves hole repair efficiency and ensures consistent repair quality, ultimately generating a high-quality, repaired 3D vehicle body mesh model. This addresses the challenges of most hole and gap repair methods in the field, which struggle to simultaneously consider both geometry and topology. Furthermore, most methods focus on a single type of defect, and when multiple problems coexist, a single repair often introduces new structural errors, affecting the model's stability in subsequent aerodynamic simulations. Additionally, the scanned and modeled vehicle body mesh requires manual inspection and repair, which is highly dependent on skilled personnel, cumbersome, resource-intensive, and susceptible to human experience, leading to low hole repair efficiency and difficulty in ensuring consistent repair quality.
[0034] Specifically, Figure 1 This is a flowchart illustrating a method for repairing holes and gaps in vehicle body modeling, as provided in an embodiment of this application.
[0035] like Figure 1 As shown, this method for repairing holes and gaps in vehicle body modeling includes the following steps: In step S101, the three-dimensional mesh model of the target vehicle body is read to obtain the topology of the three-dimensional mesh model of the vehicle body, and at least one hole to be repaired in the topology is identified.
[0036] Understandably, the target vehicle here can be understood as the specific vehicle used in the body modeling and hole / gap repair task. The body 3D mesh model here can be understood as a 3D digital model composed of discrete mesh units, constructed by collecting the geometric data of the actual body of the target vehicle using digital technology, based on its actual physical prototype.
[0037] In some embodiments, when repairing holes and gaps in the three-dimensional mesh model of the target vehicle body, this application can first obtain the three-dimensional mesh model of the target vehicle body, which facilitates the repair analysis and scheme simulation of the holes and gaps appearing in the modeling of the target vehicle body in the computer, avoiding the risk of vehicle body damage caused by actual physical operations.
[0038] Furthermore, embodiments of this application can obtain the topology of the three-dimensional mesh model of the target vehicle body, and determine the continuity of the target vehicle body geometry by the characteristics of the connection relationship between vertices, edges and meshes in the topology. By judging whether there are single vertices, broken edges, missing meshes, etc. in the topology, the holes and gaps of the vehicle body itself can be accurately located, and data interference that may be caused during scanning, such as temporary data gaps caused by occlusion, can be eliminated.
[0039] In this embodiment, the topology may, but is not limited to, using a boundary representation (B-Rep) data structure based on polygon meshes. This structure effectively organizes vertices, edges, and faces, as well as their topological relationships, and accurately describes the geometric and topological information of the model. This facilitates the rapid reading of large-scale model files using efficient data parsing algorithms, automatically identifies the topological structure within the model, and enables the analysis of the relationships between faces, edges, and vertices.
[0040] Finally, the embodiments of this application can identify the actual holes and gaps in the body model of the target vehicle by recognizing the holes to be repaired in the topology, thus providing accurate coordinates for the subsequent actual body repair of the target vehicle.
[0041] This application embodiment can provide accurate and reliable digital basis for repairing holes and gaps in the vehicle body by obtaining the three-dimensional mesh model of the target vehicle body and the topology of the three-dimensional mesh model of the vehicle body. Then, based on the topology, the holes to be repaired are identified. By distinguishing between real hole defects and data interference through the topology, the positioning of the holes to be repaired is ensured to be accurate, providing data support for the subsequent repair and verification of holes and gaps.
[0042] Optionally, in one embodiment of this application, identifying at least one hole to be repaired in the topology includes: traversing each boundary of each grid corresponding to the topology to obtain the boundary edges belonging to a single face; based on the boundary edges, collecting the boundary vertices connected to the boundary edges, and connecting the boundary edges and the boundary vertices to generate a boundary loop, so as to identify at least one hole to be repaired based on the boundary loop.
[0043] In actual implementation, when identifying holes to be repaired based on topological structure, this application may, but is not limited to, rely on the characteristics of the vertices and edges of the topological structure for identification in order to ensure the accuracy of identification.
[0044] Specifically, in this application embodiment, the boundary edges belonging to a single face in the topology can be obtained by traversing each boundary of each grid corresponding to the topology, and then the boundary vertices connected to the boundary edges can be collected based on the boundary edges. By connecting the boundary edges and the boundary vertices, a boundary loop can be generated, which is the hole to be repaired.
[0045] For example, if the obtained 3D mesh model of the target vehicle body is a 3D mesh model with holes, then the holes must have unpaired boundary edges. This is because in a manifold mesh, an edge is usually shared by two faces. If an edge belongs to only one face, it is a boundary edge, which is part of the hole.
[0046] At this point, the embodiment of this application can traverse every edge in the manifold mesh corresponding to the three-dimensional mesh model of the vehicle body and check whether each edge is a boundary edge, that is, whether it is an unpaired edge. If an unpaired boundary edge is found, the embodiment of this application can start from this boundary edge, trace along the connected boundary edges, collect all the boundary vertices that are connected end to end, and connect these vertices in sequence to form a closed boundary loop. This boundary loop represents a hole to be repaired, and the boundary of the boundary loop is the boundary of the hole to be repaired.
[0047] Additionally, for ease of computer processing, those skilled in the art can initialize an empty list using an algorithm: boundary_loops. This empty list is used to store all found boundary loops, i.e., all holes are stored in boundary_loops.
[0048] This application embodiment can obtain the boundary edges belonging to a single face by traversing each boundary of each mesh corresponding to the topology structure, and determine the hole to be repaired by generating a boundary loop based on the boundary edges. This can accurately understand the closed boundary range of the hole in the vehicle body model, thereby avoiding omission of the hole to be repaired or misjudgment of the position and size of the hole to be repaired. At the same time, this application embodiment can also store the hole to be repaired in the form of a boundary loop, providing a direct basis for the repair of the hole to be repaired.
[0049] Step S102: Obtain the number of vertices of the boundary ring corresponding to at least one hole to be repaired, and cover the boundary ring with triangular facets according to the number of vertices until the number of vertices reaches a preset number, so as to generate an initial repair vehicle body three-dimensional mesh model.
[0050] In other embodiments, after identifying the hole to be repaired, this application can obtain the number of vertices of the boundary ring corresponding to the hole to be repaired, and then use triangular facets to cover the boundary ring, that is, use triangular facets to repair the hole until the number of vertices reaches a preset number, thereby generating an initial repair vehicle body three-dimensional mesh model.
[0051] Here, the preset quantity refers to the number of vertices that have been pre-set. When the number of vertices of the boundary ring corresponding to the hole to be repaired reaches this number, it means that the repair of the hole to be repaired by covering the boundary ring with triangular facets has reached the end condition, the hole to be repaired has been initially repaired, and the initial repair vehicle body 3D mesh model can be generated.
[0052] Specifically, in this embodiment of the application, the boundary ring can be gradually covered by triangular facets, which is equivalent to repairing a portion of the boundary ring, i.e., the hole to be repaired, each time until the boundary ring is completely repaired and the number of vertices is zero, that is, the hole to be repaired is initially repaired.
[0053] This application embodiment can gradually repair the boundary ring by obtaining the number of vertices of the boundary ring corresponding to the hole to be repaired until the number of vertices of the boundary ring is cleared to zero. This ensures that the hole to be repaired can be completely covered by the triangular facets, without any unrepaired omissions, and finally completes the initial repair of the hole to be repaired.
[0054] Optionally, in one embodiment of this application, the number of vertices of the boundary ring corresponding to at least one hole to be repaired is obtained, and the boundary ring is covered with triangular facets according to the number of vertices until the number of vertices reaches a preset number to generate an initial repair vehicle body 3D mesh model, including: identifying multiple consecutive vertices in the boundary ring that satisfy the triangular shape to generate the first triangle to be repaired in the boundary ring; covering the first triangle to be repaired in the boundary ring with triangular facets to repair the first triangle to be repaired in the boundary ring; removing the repaired first triangle to be repaired from the boundary ring to generate a new boundary ring, and identifying multiple consecutive vertices in the new boundary ring that satisfy the triangular shape to generate the first triangle to be repaired in the new boundary ring, and covering the first triangle to be repaired in the new boundary ring with triangular facets until the number of vertices reaches a preset number to generate an initial repair vehicle body 3D mesh model.
[0055] In actual implementation, when this application obtains the number of vertices of the boundary ring corresponding to the hole to be repaired, and uses triangular facets to cover the boundary ring to repair the hole based on the number of vertices, it is necessary to first identify multiple consecutive vertices in the boundary ring that satisfy the triangular shape, generate the first triangle to be repaired in the boundary ring, and then use triangular facets to cover the first triangle to be repaired to repair the triangle, thereby completing the partial repair of the hole to be repaired.
[0056] By generating the triangle to be repaired through vertex recognition, the triangle to be repaired can coincide with the triangle facet to the greatest extent, thereby ensuring that the repair of the hole to be repaired can be completely covered and minimizing the amount of unnecessary repair work.
[0057] After repairing the first triangle to be repaired, its contents can be removed from the boundary ring because the hole has been repaired, generating a new boundary ring. Similarly, embodiments of this application can identify multiple consecutive vertices that satisfy the triangle shape in the new boundary ring to generate the first triangle to be repaired in the new boundary ring.
[0058] Then, the first triangle to be repaired in the new boundary ring is covered with a triangular facet, and the first triangle to be repaired in the new boundary ring is repaired. Then, the repaired triangle to be repaired is removed from the new boundary ring. This process is repeated until the final boundary ring has only three vertices left. The last triangle to be repaired is then generated. The last triangle to be repaired is then covered with a triangular facet. At this point, the number of vertices in the boundary ring reaches zero, the hole to be repaired has been repaired, and the initial repair vehicle body 3D mesh model can be generated.
[0059] Specifically, in a computer, embodiments of this application may, but are not limited to, perform the following operations on each boundary ring in the three-dimensional mesh model of the vehicle body: First, obtain the number of vertices for each boundary ring. If the number of vertices on the boundary ring is greater than 3, repeat the triangle repair process. That is, first find a triangle formed by three consecutive vertices (vi-1, vi, vi+1) on the boundary ring, where vertex vi should be a convex point, and the triangle (vi-1, vi, vi+1) should not contain any other vertices on the ring to ensure that the generated triangle is valid. That is, the triangle must be completely located inside the area enclosed by the hole boundary and cannot intersect with other parts of the boundary ring. This filters out candidate vertices that would cause invalid or incorrect triangles, ensuring that each repair of the triangle facet and each cut of the triangle is correctly and gradually filling the hole.
[0060] The triangle is covered with a triangular facet, and the triangle after covering the facet is removed from the boundary ring. The repaired triangle (vi-1, vi, vi+1) is added to the mesh of the vehicle body 3D mesh model, which is equivalent to filling a small part of the hole to be repaired with this triangle.
[0061] Repeat this process, and the ring will become smaller and smaller. When only 3 vertices remain on the ring, these last three vertices are directly combined into a triangle and covered with a triangular facet before being added to the mesh of the vehicle body 3D mesh model, until each hole to be repaired is completely covered by a shape composed of multiple triangles.
[0062] The embodiments of this application can quickly repair boundary loops by identifying triangles, repairing triangles, and trimming triangles. Only one triangle is added at a time and the vertex list is modified, which helps to maintain the manifold properties of the mesh in the vehicle body 3D mesh model and avoids generating self-intersecting or non-manifold edges, providing a good foundation for further processing of the initial repair of the vehicle body 3D mesh model.
[0063] Step S103: Adjust the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model until the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model meet the target shape, target direction, and target repair requirements, respectively, and generate the final repair vehicle body 3D mesh model.
[0064] Understandably, after repairing the hole using triangular facets, the resulting repair shape is actually a "patch-like" overlay formed by multiple triangular facets, and the initial repaired triangular mesh model is a very coarse model.
[0065] Based on this, in some embodiments, after obtaining the initial repair vehicle body three-dimensional mesh model, the shape, normal direction and non-manifold edge of the triangular facet in the initial repair vehicle body three-dimensional mesh model can be adjusted until the shape, normal direction and non-manifold edge of the triangular facet in the initial repair vehicle body three-dimensional mesh model reach the target shape, target direction and target repair requirements respectively, and the final repair vehicle body three-dimensional mesh model is generated.
[0066] The target shape here can be understood as the shape that the triangular facets in the repaired 3D mesh model of the vehicle body should achieve. This includes both the required geometric shape and standards for the triangular facets, such as ensuring they approximate equilateral or isosceles triangles to avoid excessive distortion and guaranteeing the quality of the mesh elements; and the local shape requirements of the facets themselves or the expected geometric shape after repair, such as matching the original curved surface shape of the corresponding area of the vehicle body, including the smooth curvature of the body waistline and the flatness of planar areas, to ensure seamless integration between the repaired area and the original vehicle mesh. The specific target shape can be set by those skilled in the art according to actual needs; this embodiment is merely illustrative and does not impose specific limitations.
[0067] In this context, the normal direction of the triangular facet can be understood as the direction perpendicular to the surface of the triangular facet. This normal direction represents the front face (or the outward-facing side) of the triangular facet. Using this normal direction ensures that the front faces of all triangular facets face the same direction, thus guaranteeing the consistency of the triangular facet orientation and consequently the consistency of the repaired surface. The target direction can be understood here as the orientation of the front facet of the triangular facet. The non-manifold edges of the triangular facets can be understood here as an erroneous topology that disrupts the topology of this model when repairing the hole to be repaired.
[0068] The target repair requirement can be understood here as ensuring that no edge of the initial repair vehicle body 3D mesh model is shared by three or more faces, thus preventing erroneous topology. This condition ensures that the repaired mesh is "manifold," facilitating subsequent simulations, processing, and other operations.
[0069] In brief, the embodiments of this application can detect and repair non-manifold edges (e.g., an edge shared by more than two faces) or duplicate faces that may be caused by triangulation, ensuring that the output mesh is a clean manifold mesh. Adjusting the non-manifold edges of the triangular faces to meet the target repair requirements means ensuring that no incorrect topology is created during the process of filling and repairing holes. The generated patch must be seamlessly integrated with the original vehicle body, with each edge strictly shared by two faces, making the final model an effective solid model that can be used for tasks such as 3D printing and fluid simulation. Figure 2 As shown, Figure 2 This is a schematic diagram of the hole and gap and the repair result of one embodiment of this application.
[0070] The embodiments of this application can adjust the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body triangular mesh model to ensure that the final generated repair vehicle body 3D mesh model is an effective solid model that can be used for tasks such as 3D printing and fluid simulation.
[0071] Optionally, in one embodiment of this application, the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model are adjusted until the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model reach the target shape, target direction, and target repair requirements, respectively, to generate the final repair vehicle body 3D mesh model. This includes: adjusting the vertex positions of the triangular facets to the target positions based on a Laplacian smoothing strategy to complete the shape adjustment of the triangular facets; and adjusting the normal direction of the triangular facets to be in the same normal direction as the original mesh corresponding to the vehicle body 3D mesh model to complete the normal direction adjustment of the triangular facets.
[0072] Based on the descriptions of other embodiments, it is understood that the embodiments of this application can adjust the shape, normal direction and non-manifold edge of the triangular facet in the initial repair hole to achieve the target shape, target direction and target repair requirements, thereby generating the final repaired three-dimensional mesh model of the vehicle body.
[0073] Specifically, when adjusting the shape of the triangular facet, this application mainly uses a Laplacian smoothing strategy, which is achieved by adjusting the vertex positions of the triangular facet to the target positions. For example, slightly moving a vertex. Here, the target position refers to the optimal geometric coordinates that the vertex should ultimately fall on in order for the triangular facet to achieve the target shape (such as regularization, conforming to the vehicle body geometry).
[0074] Furthermore, regarding the adjustment of the normal direction of the triangular facets, the embodiments of this application mainly adjust the normal direction of all triangular facets to be in the same direction as the front facet of the triangular facet. That is, the normal direction of all triangular facets on the new patch covered in the initial repair vehicle body 3D mesh model is consistent with the normal direction (facing) of the original vehicle body (corresponding to the original vehicle body 3D mesh model of the target vehicle), ensuring visually seamless connection and correct lighting rendering.
[0075] For example, embodiments of this application can optimize and repair potentially coarse triangular patches (such as uneven shapes, inconsistent normals, or non-manifold structures) in the initial repair vehicle body 3D mesh model.
[0076] For example, embodiments of this application can use the Laplacian Smoothing strategy to slightly adjust the position of the vertices of the triangular facets or move the boundary vertices of the triangular facets, so that the patch area of the repaired triangular facets becomes flatter and smoother, better integrates into the surrounding mesh geometry, and avoids sharp or uneven defects.
[0077] Furthermore, embodiments of this application can also adjust the normal direction of the triangular facets so that the normal direction (i.e., the orientation of the face) of all added triangular facets is consistent with the normal direction of the surrounding original mesh facets, thereby ensuring the visual and geometric consistency of the entire model.
[0078] The embodiments of this application can adjust the shape and normal direction of the triangular facets to ensure that the normal direction of all newly added triangular facets in the final repaired vehicle body 3D mesh model faces outward and is consistent with the surrounding original vehicle body surface. This ensures that the repaired part can maintain the same lighting effect as the original vehicle body during rendering, and there will be no black blocks or display errors.
[0079] Optionally, in one embodiment of this application, after generating the final repair vehicle body 3D mesh model, the method further includes: detecting the geometry and topology of the final repair 3D mesh model; if the geometry and topology do not meet the target fusion conditions with the original mesh corresponding to the vehicle body 3D mesh model, readjusting the shape, normal direction, and non-manifold edges of the triangular patches in the final repair vehicle body 3D mesh model until the geometry and topology meet the target fusion conditions with the original mesh corresponding to the vehicle body 3D mesh model.
[0080] In other embodiments, after generating the final repair 3D mesh model and before actually outputting the final repair 3D mesh model, this application can also detect the geometry and topology of the final repair 3D mesh model. If the geometry and topology of the final repair vehicle body 3D mesh model do not meet the target fusion conditions, the shape, normal direction and non-manifold edge of the triangular facet in the initial repair hole are adjusted again until the geometry and topology and the original mesh corresponding to the vehicle body 3D mesh model meet the target fusion conditions.
[0081] Here, the target fusion condition can be understood as the requirement that the repaired area in the final repaired 3D mesh model can maintain high-quality fusion with the original mesh corresponding to the original vehicle body 3D mesh model in terms of both geometry and topology.
[0082] The method used when readjusting the shape, normal direction, and non-manifold edges of the triangular facets in the final repair vehicle body 3D mesh model is the same as that used when adjusting the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model, and will not be repeated in this embodiment.
[0083] The embodiments of this application can adjust the shape, normal direction, and non-manifold edges of the triangular patches in the repair area when the geometry and topology of the finally repaired vehicle body 3D mesh model cannot maintain high-quality fusion with the original mesh corresponding to the original vehicle body 3D mesh model. This ensures that the repaired area in the target vehicle body model can maintain a high degree of fusion with the original area before repair.
[0084] It should be noted that all steps in the embodiments of this application can be written as algorithms and integrated into a computer, which facilitates the automated hole and gap repair processing of the target vehicle body model. Figure 3 This is a schematic diagram of a rapid scanning modeling system for vehicle bodies with holes and gaps according to an embodiment of this application, as shown below. Figure 3 As shown, the processing steps of this system can be specifically represented, but are not limited to, as follows: S1: Input: Input the 3D model file of the vehicle body; S2: Data parsing and reading: Reads large-scale model files and automatically identifies the topological structure in the model, realizing the correlation analysis of faces, edges, and vertices; S3: Automatic Detection: Automatically scans the model surface, extracts all existing mesh holes and gaps (which can be regarded as small holes to be repaired) topological defects, and determines the mesh hole and gap structure areas; S4: Parameter settings and manual intervention: Users can adjust parameters and intervene manually according to actual needs, and can set parameters such as the selection of the repair area; S5: Automatic Repair: Automatically performs remeshing to repair detected and selected holes and gaps with high quality; S6: Output: The output is a 3D model file after automatic detection and mesh optimization.
[0085] The hole and gap repair method for vehicle body modeling proposed in this application can identify at least one hole to be repaired based on the topology of the target vehicle's 3D mesh model and repair it using triangular facets until a final repaired 3D mesh model of the vehicle body is generated. This achieves a clear mathematical expression of problems such as unclosed boundaries, holes, and gaps in the mesh structure using topological structures, and designs corresponding automated detection and repair algorithms accordingly. This ensures the method's engineering practicality and replicability, facilitating its widespread application in practical engineering and scientific research scenarios. By combining efficient automatic detection algorithms with controllable parameterized manual intervention, the method can accurately identify and locate specific problem areas requiring repair. Simultaneously, optimized fully automatic hole and gap filling algorithms achieve high-quality repair, effectively improving the model's integrity and subsequent processing effects. While considering both geometric shape and topological structure, it ensures that all types of hole and gap defects can be accurately detected and repaired. A multi-level detection strategy reduces the missed detection rate, ensuring consistent repair quality and effectively improving the efficiency of hole repair, ultimately generating a high-quality, repaired 3D mesh model of the vehicle body. This solves the problems that most hole and gap repair methods in related technologies cannot simultaneously take into account both geometry and topology; and most methods only focus on a single type of defect. When multiple problems coexist, a single repair often leads to new structural errors, affecting the stability of the model in subsequent aerodynamic simulations. Furthermore, the vehicle body mesh after scanning and modeling still needs to be manually inspected and repaired, which is highly dependent on highly skilled personnel, cumbersome, resource-intensive, and easily influenced by human experience, resulting in low hole repair efficiency and difficulty in ensuring consistent repair quality.
[0086] Next, referring to the accompanying drawings, a hole and gap repair device for vehicle body modeling proposed according to an embodiment of this application is described.
[0087] Figure 4 This is a schematic diagram of the hole and gap repair device for vehicle body modeling according to an embodiment of this application.
[0088] like Figure 4 As shown, the hole and gap repair device 10 for vehicle body modeling includes: an identification module 100, a repair module 200, and an adjustment module 300.
[0089] The identification module 100 is used to read the three-dimensional mesh model of the target vehicle body to obtain the topology of the three-dimensional mesh model of the vehicle body, and to identify at least one hole to be repaired in the topology.
[0090] Repair module 200 is used to obtain the number of vertices of the boundary ring corresponding to at least one hole to be repaired, and to cover the boundary ring with triangular facets according to the number of vertices until the number of vertices reaches a preset number, so as to generate an initial repair vehicle body 3D mesh model.
[0091] The adjustment module 300 is used to adjust the shape, normal direction and non-manifold edge of the triangular facets in the initial repair vehicle body 3D mesh model until the shape, normal direction and non-manifold edge of the triangular facets in the initial repair vehicle body 3D mesh model reach the target shape, target direction and target repair requirements respectively, and generate the final repair vehicle body 3D mesh model.
[0092] Optionally, in one embodiment of this application, the identification module 100 includes a traversal unit and an identification unit.
[0093] The traversal unit is used to traverse each boundary of each grid corresponding to the topology to obtain the boundary edges belonging to a single face.
[0094] The identification unit is used to collect boundary vertices connected to the boundary edges based on the boundary edges, and connect the boundary edges and boundary vertices to generate a boundary loop, so as to identify at least one hole to be repaired based on the boundary loop.
[0095] Optionally, in one embodiment of this application, the repair module 200 includes: a generation unit, a repair unit, and a removal unit.
[0096] The generation unit is used to identify multiple consecutive vertices in the boundary loop that satisfy the triangle shape, so as to generate the first triangle to be repaired in the boundary loop.
[0097] The repair unit is used to cover the first triangle to be repaired in the boundary ring with a triangular facet to repair the first triangle to be repaired in the boundary ring.
[0098] The removal unit is used to remove the first triangle to be repaired from the boundary ring after the removal and repair process to generate a new boundary ring. It also identifies multiple consecutive vertices in the new boundary ring that satisfy the triangle shape to generate the first triangle to be repaired in the new boundary ring. The first triangle to be repaired in the new boundary ring is then covered with a triangle facet until the number of vertices reaches a preset number to generate the initial repaired vehicle body 3D mesh model.
[0099] Optionally, in one embodiment of this application, the adjustment module 300 includes: a first adjustment unit and a second adjustment unit.
[0100] The first adjustment unit is used to adjust the vertex positions of the triangular facet to the target positions based on the Laplace smoothing strategy, so as to complete the shape adjustment of the triangular facet.
[0101] The second adjustment unit is used to adjust the normal direction of the triangular facet to be in the same normal direction as the original mesh corresponding to the three-dimensional mesh model of the vehicle body, so as to complete the adjustment of the normal direction of the triangular facet.
[0102] Optionally, in one embodiment of this application, it further includes a detection module and a processing module.
[0103] The detection module is used to detect the geometry and topology of the final repaired 3D mesh model after it has been generated.
[0104] The processing module is used to readjust the shape, normal direction, and non-manifold edges of the triangular patches in the final repaired vehicle body 3D mesh model when the geometry and topology do not meet the target fusion conditions of the original mesh corresponding to the vehicle body 3D mesh model. This adjustment continues until the geometry and topology meet the target fusion conditions of the original mesh corresponding to the vehicle body 3D mesh model.
[0105] It should be noted that the explanation of the above-described embodiment of the hole and gap repair method for vehicle body modeling also applies to the hole and gap repair device for vehicle body modeling in this embodiment, and will not be repeated here.
[0106] The hole and gap repair device for vehicle body modeling proposed in this application can identify at least one hole to be repaired based on the topological structure of the target vehicle's 3D mesh model and repair it using triangular facets until a final repaired 3D mesh model of the vehicle body is generated. This achieves a clear mathematical expression of problems such as unclosed boundaries, holes, and gaps in the mesh structure using topological structures, and designs corresponding automated detection and repair algorithms accordingly. This ensures the engineering practicality and replicability of the method, facilitating its widespread application in practical engineering and scientific research scenarios. By combining efficient automatic detection algorithms with controllable parameterized manual intervention, it can accurately identify and locate specific problem areas requiring repair. Simultaneously, through optimized fully automatic hole and gap filling algorithms, it achieves high-quality repair, effectively improving the integrity of the model and the subsequent processing effect. While considering geometric shape and topological structure, it ensures that all types of hole and gap defects can be accurately detected and repaired. The multi-level detection strategy reduces the missed detection rate, ensures the consistency of repair quality, effectively improves the efficiency of hole repair, and ultimately generates a high-quality repaired 3D mesh model of the vehicle body. This solves the problems that most hole and gap repair methods in related technologies cannot simultaneously take into account both geometry and topology; and most methods only focus on a single type of defect. When multiple problems coexist, a single repair often leads to new structural errors, affecting the stability of the model in subsequent aerodynamic simulations. Furthermore, the vehicle body mesh after scanning and modeling still needs to be manually inspected and repaired, which is highly dependent on highly skilled personnel, cumbersome, resource-intensive, and easily influenced by human experience, resulting in low hole repair efficiency and difficulty in ensuring consistent repair quality.
[0107] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.
[0108] When the processor 502 executes the program, it implements the hole and gap repair method for vehicle body modeling provided in the above embodiments.
[0109] Furthermore, electronic devices also include: Communication interface 505 is used for communication between memory 501 and processor 502.
[0110] The memory 501 is used to store computer programs that can run on the processor 502.
[0111] Memory 501 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0112] If the memory 501, processor 502, and communication interface 505 are implemented independently, then the communication interface 505, memory 501, and processor 502 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0113] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 505 are integrated on a single chip, then the memory 501, processor 502, and communication interface 505 can communicate with each other through an internal interface.
[0114] Processor 502 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0115] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for repairing holes and gaps based on vehicle body modeling.
[0116] This application also provides a computer program product, including a computer program that can run computer instructions. When the computer instructions are executed by a processor, they implement the hole and gap repair method for vehicle body modeling provided in this application.
[0117] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0118] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0119] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0120] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0121] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or more of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0122] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0123] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0124] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A method for repairing holes and gaps in vehicle body modeling, characterized in that, Includes the following steps: Read the three-dimensional mesh model of the target vehicle body to obtain the topology of the three-dimensional mesh model of the vehicle body, and identify at least one hole to be repaired in the topology; Obtain the number of vertices of the boundary ring corresponding to the at least one hole to be repaired, and cover the boundary ring with triangular facets according to the number of vertices until the number of vertices reaches a preset number, so as to generate an initial repair vehicle body three-dimensional mesh model. Adjust the shape, normal direction, and non-manifold edges of the triangular faces in the initial repair vehicle body 3D mesh model until the shape, normal direction, and non-manifold edges of the triangular faces in the initial repair vehicle body 3D mesh model meet the target shape, target direction, and target repair requirements, respectively, to generate the final repair vehicle body 3D mesh model.
2. The method according to claim 1, characterized in that, The process of identifying at least one hole to be repaired in the topology includes: Traverse each boundary of each grid corresponding to the topology to obtain the boundary edges belonging to a single face; Based on the boundary edge, collect the boundary vertices connected to the boundary edge, and connect the boundary edge and the boundary vertices to generate the boundary loop, so as to identify the at least one hole to be repaired based on the boundary loop.
3. The method according to claim 1, characterized in that, The step of obtaining the number of vertices of the boundary ring corresponding to the at least one hole to be repaired, and then covering the boundary ring with triangular patches according to the number of vertices until the number of vertices reaches a preset number, to generate an initial repair vehicle body 3D mesh model, includes: Identify multiple consecutive vertices in the boundary loop that satisfy the triangle shape to generate the first triangle to be repaired in the boundary loop; The first triangle to be repaired in the boundary ring is covered by the triangular facet to repair the first triangle to be repaired in the boundary ring. Remove the first triangle to be repaired from the boundary ring to generate a new boundary ring, and identify multiple consecutive vertices in the new boundary ring that satisfy the triangle shape to generate the first triangle to be repaired in the new boundary ring. Cover the first triangle to be repaired in the new boundary ring with the triangle facets until the number of vertices reaches a preset number to generate the initial repaired vehicle body 3D mesh model.
4. The method according to claim 1, characterized in that, The process of adjusting the shape, normal direction, and non-manifold edges of the triangular faces in the initial repair vehicle body 3D mesh model until these parameters meet the target shape, target direction, and target repair requirements, respectively, generates the final repair vehicle body 3D mesh model, including: Based on the Laplace smoothing strategy, the vertex positions of the triangular facets are adjusted to the target positions to complete the shape adjustment of the triangular facets; The normal direction of the triangular facet is adjusted to be in the same normal direction as the original mesh corresponding to the three-dimensional mesh model of the vehicle body, so as to complete the adjustment of the normal direction of the triangular facet.
5. The method according to claim 1, characterized in that, After generating the final repaired vehicle body 3D mesh model, the process also includes: Detect the geometry and topology of the final repaired 3D mesh model; If the geometry and topology do not meet the target fusion conditions with the original mesh corresponding to the vehicle body 3D mesh model, the shape, normal direction, and non-manifold edges of the triangular patches in the final repaired vehicle body 3D mesh model are readjusted until the geometry and topology meet the target fusion conditions with the original mesh corresponding to the vehicle body 3D mesh model.
6. A hole and gap repair device for vehicle body modeling, characterized in that, include: The identification module is used to read the three-dimensional mesh model of the target vehicle body to obtain the topology of the three-dimensional mesh model of the vehicle body, and to identify at least one hole to be repaired in the topology. The repair module is used to obtain the number of vertices of the boundary ring corresponding to the at least one hole to be repaired, and to cover the boundary ring with triangular facets according to the number of vertices until the number of vertices reaches a preset number, so as to generate an initial repair vehicle body three-dimensional mesh model. The adjustment module is used to adjust the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model until the shape, normal direction, and non-manifold edges of the triangular facets in the initial repair vehicle body 3D mesh model reach the target shape, target direction, and target repair requirements, respectively, and generate the final repair vehicle body 3D mesh model.
7. The apparatus according to claim 6, characterized in that, The identification module includes: A traversal unit is used to traverse each boundary of each grid corresponding to the topology to obtain the boundary edges belonging to a single face. The identification unit is used to collect the boundary vertices connected to the boundary edge based on the boundary edge, and connect the boundary edge and the boundary vertices to generate the boundary loop, so as to identify the at least one hole to be repaired based on the boundary loop.
8. An electronic device, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, the processor executing the program to implement the hole and gap repair method for vehicle body modeling as described in any one of claims 1-5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the hole and gap repair method for vehicle body modeling as described in any one of claims 1-5.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed, it is used to implement the hole and gap repair method for vehicle body modeling as described in any one of claims 1-5.