CAD model broken surface processing method, device and equipment and medium
By automatically identifying and processing broken faces in the CAD model, and using watertight grids and quad-tree search structure methods, the problem of low efficiency in the CAD model's broken face treatment in the prior art is solved, and automation, reversibility and efficient broken face repair are achieved.
Patent Information
- Application Number
- CN202510495984.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-04-21
AI Technical Summary
The prior art is difficult to automatically handle surface defects in CAD models, resulting in engineering operations failures, and rely on manual identification and processing, which is inefficient.
By importing and repairing the initial CAD model, establishing a watertight mesh data structure, identifying and grouping broken faces, performing virtual edge merging and topological relationship updates, and fitting virtual continuous surfaces in combination with the quad-tree search structure to achieve broken face merging and repair.
Automatic detection and processing of CAD model broken surfaces is realized, which significantly reduces manual intervention, improves processing efficiency, and ensures reversibility of operations, avoids shape deformation and accuracy losses in traditional geometric repair.
Smart Images

Figure CN120030948A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer-aided design, and in particular to a method, device, equipment and medium for processing broken surfaces of CAD models. Background Art
[0002] A type of topological surface with a narrow structure often appears on the surface of digital models of aircraft and automobiles. The dimensions of the two parameter directions at the narrow structure will differ greatly, thus forming a certain narrow area in the model. This type of topological surface is called a "broken surface". The existence of broken surface defects does not have a direct impact on the integrity and correctness of the model's topological structure, but it will lead to the failure of downstream engineering operations, such as surface intersection or offset when the model is changed, surface meshing in finite element analysis, process planning in CNC machining, tool path calculation, etc. This type of defect is common in the features of rib ends, corners, inner and outer edges of digital models of aircraft structural parts, caused by non-standard modeling operations, frequent surface cutting, entity Boolean operations or system accuracy problems. Because it is difficult to detect with the naked eye and the workload is large and complicated, it is usually not convenient to detect by manual interaction. Therefore, most of them are based on manual recognition and manual processing, and an automated and universal solution has not yet been proposed. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a CAD model broken surface processing method, device, equipment and medium, which can automatically adjust the broken surface of the CAD model without changing the geometric definition of the original model, and the operation is completely reversible to meet the practical needs of engineering. The specific scheme is as follows:
[0004] In a first aspect, the present application discloses a method for processing a CAD model surface, comprising:
[0005] Import and repair the initial CAD model, and build a watertight mesh data structure to obtain virtual surfaces;
[0006] Traversing and identifying the current virtual faces that meet the preset broken face determination condition as broken faces, so as to obtain a broken face set; wherein the preset broken face determination condition is that the minimum opposite edge distance of the boundary pairs constructed by the non-adjacent boundaries of the virtual faces is less than a preset distance threshold;
[0007] Regrouping the facet set according to a set partitioning method that shares the same boundary or vertex to obtain a plurality of facet groups;
[0008] Performing virtual edge merging, boundary topological relationship updating and discrete mesh fusion processing on all broken faces in each broken face group to obtain a target virtual face after the broken faces are merged;
[0009] The target virtual surface is subjected to a two-dimensional mapping process of a discrete grid to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and a corresponding virtual continuous surface is fitted based on the two-dimensional discrete grid distribution using a quadtree search structure.
[0010] Optionally, traversing and identifying the current virtual faces that meet a preset face-break determination condition as face-breaks to obtain a face-break set includes:
[0011] Using non-adjacent boundaries in each of the virtual faces to construct corresponding boundary pairs, and using the minimum opposite side distance of the boundary pairs in each of the virtual faces as the opposite side distance to be compared of the corresponding current virtual face;
[0012] Comparing the size relationship between the distances of the opposite sides to be compared and a preset distance threshold to obtain a corresponding comparison result;
[0013] The current virtual surface corresponding to the to-be-compared opposite edge distance whose comparison result is less than the preset distance threshold is set as a broken surface to obtain a broken surface set.
[0014] Optionally, the constructing corresponding boundary pairs by using non-adjacent boundaries in each of the virtual faces, and taking the minimum opposite side distance of the boundary pairs in each of the virtual faces as the opposite side distance to be compared of the corresponding current virtual face, includes:
[0015] Taking any boundary in the current virtual surface as the current boundary, constructing a corresponding boundary pair according to the current boundary and a target boundary not adjacent to the current boundary, and calculating the opposite side distance between the boundary pairs;
[0016] Taking any other boundary except the current boundary as a new current boundary, and jumping to execute the step of constructing a corresponding boundary pair according to the current boundary and a target boundary not adjacent to the current boundary, until the opposite side distances of all boundary pairs of the current virtual surface are obtained;
[0017] The minimum opposite side distance among the opposite side distances is used as the opposite side distance to be compared of the current virtual surface.
[0018] Optionally, the merging of virtual edges and updating of boundary topological relationships of all broken faces in each broken face group includes:
[0019] Identifying common edges between the broken faces in the broken face group;
[0020] Acquire a virtual edge associated with the first endpoint of the common edge as a first virtual edge to be merged, so as to merge the first virtual edge to be merged to obtain a first target virtual edge;
[0021] Acquire a virtual edge associated with the tail endpoint of the common edge as a second virtual edge to be merged, so as to merge the second virtual edge to be merged to obtain a second target virtual edge;
[0022] Merging and updating each broken surface based on the first target virtual edge and the second target virtual edge to obtain a number of target virtual surfaces after the corresponding broken surfaces are merged;
[0023] The topological relationship between the target virtual surfaces is updated to obtain the target boundary topological relationship.
[0024] Optionally, the discrete grid fusion processing of the target virtual surface includes:
[0025] Based on the preprocessed watertight grid data structure, the discrete grids of adjacent target virtual surfaces are stitched according to the correspondence between discrete grid points to generate a target discrete grid of the target virtual surface.
[0026] Optionally, the performing a two-dimensional mapping process of a discrete grid on the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane includes:
[0027] A conformal mapping algorithm is used to perform two-dimensional mapping processing on the target discrete grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane.
[0028] Optionally, the using a quadtree search structure and fitting a corresponding virtual continuous surface based on the two-dimensional discrete grid distribution includes:
[0029] Using the quadtree search structure to locate each two-dimensional discrete grid in the local area in the two-dimensional plane and perform local fitting processing through interpolation or approximation algorithm to obtain a local parametric surface;
[0030] Through the hierarchical relationship of the quadtree search structure, the local parameter surfaces are seamlessly spliced to obtain a virtual continuous surface.
[0031] In a second aspect, the present application discloses a CAD model surface processing device, comprising:
[0032] The structure building module is used to import and repair the initial CAD model and build a watertight grid data structure to obtain virtual surfaces;
[0033] A broken face recognition module is used to traverse and recognize that the current virtual face that meets the preset broken face judgment condition is a broken face, so as to obtain a broken face set; wherein the preset broken face judgment condition is that the minimum opposite edge distance of the boundary pair constructed by the non-adjacent boundaries of the virtual face is less than a preset distance threshold;
[0034] A group division module, used for regrouping the broken face set according to a set division method sharing the same boundary or vertex to obtain a plurality of broken face groups;
[0035] A broken face merging module is used to merge virtual edges, update boundary topological relationships, and perform discrete mesh fusion processing on all broken faces in each broken face group to obtain a target virtual face after the broken faces are merged;
[0036] The surface fitting module is used to perform two-dimensional mapping processing of discrete grids on the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and to fit the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution using a quadtree search structure.
[0037] In a third aspect, the present application discloses an electronic device, including:
[0038] Memory, used to store computer programs;
[0039] The processor is used to execute the computer program to implement the steps of the above-mentioned CAD model surface processing method.
[0040] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned CAD model fragmentation processing method are implemented.
[0041] It can be seen that the present application discloses a method for processing broken surfaces of CAD models, including: importing and repairing the initial CAD model, establishing a watertight grid data structure to obtain a virtual surface; traversing and identifying the current virtual surface that meets the preset broken surface judgment condition as a broken surface, to obtain a broken surface set; wherein the preset broken surface judgment condition is that the minimum edge distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than the preset distance threshold; regrouping the broken surface set according to the set partitioning method sharing the same boundary or vertex to obtain a number of broken surface groups; merging virtual edges, updating boundary topological relationships, and fusion processing of discrete grids for all broken surfaces in each of the broken surface groups to obtain a target virtual surface after the broken surfaces are merged; performing two-dimensional mapping processing of discrete grids on the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and fitting the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution using a quadtree search structure. It can be seen that by automatically traversing and detecting broken surfaces, manual intervention is significantly reduced, and broken surfaces can also be determined. Dynamically group broken faces by sharing boundaries / vertices to avoid repeated operations and improve processing efficiency. Only virtual edges are merged and virtual faces are reconstructed without changing the original geometric data. The operation is completely reversible, avoiding geometric shape deformation or precision loss in traditional geometric repair. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0043] Figure 1 A flow chart of a CAD model surface processing method disclosed in this application;
[0044] Figure 2 A schematic diagram of a virtual surface and virtual edge of a CAD model disclosed in this application;
[0045] Figure 3 A schematic diagram of a neighborhood virtual surface of a virtual surface E of a CAD model disclosed in this application;
[0046] Figure 4 A schematic diagram of virtual edge merging and target virtual surface of a CAD model disclosed in this application;
[0047] Figure 5 A schematic diagram of discrete grid stitching of a CAD model disclosed in the present application;
[0048] Figure 6 A schematic diagram of a CAD model before merging broken surfaces disclosed in this application;
[0049] Figure 7 A schematic diagram of a model after merging the broken surfaces of a CAD model disclosed in this application;
[0050] Figure 8 This is a schematic diagram of the structure of a CAD model crushing surface processing device disclosed in this application;
[0051] Fig. 9 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0053] In the traditional CFD (Computational Fluid Dynamics) mesh generation process, the geometry often needs to be cleaned up before mesh generation, and then the user needs to identify all geometric errors and repair them one by one. This repair process often requires a lot of manual interaction and the use of complex graphical interfaces, such as professional geometry processing software, and is highly dependent on the operator's experience. For complex models composed of a large number of parts, the cost of manual repair is even higher.
[0054] In addition, before the numerical simulation begins, it is necessary to define the CAD (Computer Aided Design) model, then generate the computational mesh, and set the boundary conditions, materials, and solution parameters. This process is called the pre-processing of numerical simulation. The pre-processing of numerical simulation is the main performance bottleneck of numerical simulation of complex problems. It involves a lot of manual intervention, and its efficiency is heavily dependent on user experience. Reliable and efficient automatic pre-processing algorithms are the key to improving the efficiency and accuracy of numerical simulation. It should be pointed out that the most important link in the pre-processing process is the processing of the CAD model, which specifically includes two steps: model repair and feature simplification. Among them, model repair is used to convert dirty geometry with errors into "clean" geometry that meets the requirements of mesh generation.
[0055] A type of topological surface with a narrow structure often appears on the surface of digital models of aircraft and automobiles. The dimensions of the two parameter directions at the narrow structure will differ greatly, thus forming a certain narrow area in the model. This type of topological surface is called a "broken surface". The existence of broken surface defects does not have a direct impact on the integrity and correctness of the model's topological structure, but it will lead to the failure of downstream engineering operations, such as surface intersection or offset when the model is changed, surface meshing in finite element analysis, process planning in CNC machining, tool path calculation, etc. This type of defect is common in the rib ends, corners, inner and outer edges of digital models of aircraft structural parts, and is caused by non-standard modeling operations, frequent surface cutting, entity Boolean operations or system accuracy problems. Because it is difficult to detect with the naked eye and the workload is large and complicated, it is usually not convenient to detect by manual interaction.
[0056] Most of the existing methods for dealing with broken surface defects rely on manual identification and manual processing. This processing method is very time-consuming and labor-intensive when facing complex models, especially for an assembly consisting of thousands of parts, which is unrealistic to detect only by manpower. For manually selected broken surfaces, they are all achieved by changing the actual geometric shape of the model. This type of operation involves a lot of geometric calculations and is not necessarily reversible. In addition, due to sampling accuracy, there will inevitably be geometric errors between the new and old surfaces.
[0057] To this end, the present invention provides a CAD model broken surface processing solution, which can automatically adjust the broken surfaces of the CAD model without changing the geometric definition of the original model, and the operation is completely reversible, meeting the engineering practical requirements.
[0058] Refer to Figure 1 As shown, an embodiment of the present invention discloses a CAD model broken surface processing method, including:
[0059] Step S11: Import and repair the initial CAD model, and establish a watertight mesh data structure to obtain virtual surfaces.
[0060] In this embodiment, the initial CAD model is processed for model surface gaps to obtain a repaired CAD model without surface gaps, and then the repaired CAD model is meshed and generated to obtain a virtual surface. It can be understood that according to the CAD model repair requirements in the numerical simulation pre-processing process, the initial CAD model with gaps has gaps. In order to obtain accurate mesh generation results, it is necessary to perform surface gap repair processing on the initial CAD model with gaps to obtain a repaired CAD model without surface gaps. It should be noted that generating the initial CAD model based on the actual parameter information of the parts in the CAD model repair requirements is a conventional generation method, such as a reverse engineering method based on measurement data, a forward design method based on design parameters, and a hybrid design method combining the two, which is not specifically limited. The CAD model repair requirements can specifically be a repair requirement for a type of broken surface with a narrow structure that often appears on the digital model surface of aircraft, automobiles, etc. Further, the repaired CAD model is meshed and generated to obtain a virtual surface containing discrete surfaces and continuous surfaces. It can be understood that after the initial CAD model is repaired by gap repairing, the repaired CAD model is obtained, and the watertight grid data structure of the repaired CAD model is further generated by the watertight grid generation method, wherein the watertight grid generation framework is a tool or method for constructing the data structure of the repaired CAD model. In the processing of the repaired CAD model, the grid is a discretized representation of the model surface. A watertight grid means that the connection between the grids is tight and gapless, just like a seal, and this feature is crucial for subsequent accurate calculation and analysis. Using this framework to establish a data structure can organize the various parts of the repaired CAD model in an orderly and standardized manner, which is convenient for subsequent various operations on the model. Specifically, after the data structure of the repaired CAD model is established by the watertight grid generation framework, each virtual surface obtained contains two parts: a discrete surface and a continuous surface. A discrete surface is obtained by discretizing a continuous surface, and it is composed of a series of discrete points, lines, and surface elements. In the subsequent processing process, operations on discrete surfaces are easier to implement. The continuous surface is the surface part that maintains the original continuous characteristics, which reflects the overall shape and geometric characteristics of the surface. That is, the solid geometric data. When the CAD model repair requirement is any one or several structural parts in the aircraft structure, such as the wing rib end, fuselage corner, inner and outer edges, it is easy to produce geometric fragments in narrow areas. Therefore, after the initial CAD model is obtained, the gap is repaired to obtain the repaired CAD model, such as the repaired wing rib end CAD model, there is still a need to repair the broken surface. The corresponding virtual surface represents the topological surface of the repaired wing rib end CAD model after the gap is repaired.
[0061] Step S12: traverse and identify the current virtual faces that meet the preset broken face determination condition as broken faces to obtain a broken face set; wherein the preset broken face determination condition is that the minimum opposite edge distance of the boundary pairs constructed by the non-adjacent boundaries of the virtual faces is less than a preset distance threshold.
[0062] In this embodiment, corresponding boundary pairs are constructed using non-adjacent boundaries in each of the virtual surfaces, and the minimum opposite side distance of the boundary pairs in each of the virtual surfaces is used as the opposite side distance to be compared of the corresponding current virtual surface; specifically, any boundary in the current virtual surface is used as the current boundary, so as to construct a corresponding boundary pair based on the current boundary and a target boundary that is not adjacent to the current boundary, and calculate the opposite side distance between the boundary pairs; any other boundary except the current boundary is used as the new current boundary, and the step of constructing a corresponding boundary pair based on the current boundary and a target boundary that is not adjacent to the current boundary is jumped to execute until the opposite side distances of all boundary pairs of the current virtual surface are obtained; the minimum opposite side distance among the opposite side distances is used as the opposite side distance to be compared of the current virtual surface. It can be understood that first, any boundary in the current virtual surface is used as the current boundary, and then a boundary that is not connected to the current boundary is searched from the current virtual surface as the target boundary, such as Figure 2 As shown in the figure, the current virtual face abcde, if the current boundary selected is ab, then the target boundaries that are not connected to it are cd and de. Therefore, the constructed boundary pairs are (ab, cd) and (ab, de). Then the distance between the opposite edges of the current boundary and the target boundary in the boundary pair is calculated, that is, and , further, traverse the other boundaries of the current virtual surface (boundaries except the current boundary), and obtain the boundary pairs of other boundaries respectively, such as the target boundaries ae and ed of the current boundary bc, and construct boundary pairs (bc, ae) and (bc, ed), and then calculate the opposite side distance between the current boundary and the target boundary in the boundary pair, that is, get and ; The target boundaries of the current boundary cd are ab and ae, and the constructed boundary pairs are (cd, ab) and (cd, ae). Then, the distance between the opposite edges of the current boundary and the target boundary in the boundary pair is calculated, that is, and At this time, all the opposite side distances of the current virtual surface are compared to obtain the minimum opposite side distance : The minimum opposite side distance is used as the opposite side distance to be compared of the current virtual surface. Similarly, the opposite side distances to be compared of each virtual surface are obtained.
[0063] In this embodiment, the size relationship between each of the distances of the opposite sides to be compared and the preset distance threshold is compared to obtain a corresponding comparison result; the current virtual surface corresponding to the distance of the opposite sides to be compared whose comparison result is less than the preset distance threshold is set as a broken surface to obtain a broken surface set. It can be understood that the preset distance threshold is set by the user. It should be noted that in the process of setting the preset distance threshold, it is necessary to make corresponding settings according to the previous CAD model repair requirements. For example: in aircraft structural parts, if the broken surface is usually caused by a millimeter-level narrow area, the distance threshold can be set to 0.5mm (millimeter); if the model accuracy requirement is high, the distance threshold can be set to a smaller value (such as 0.05mm). If the distance threshold set by the user is too large, the broken surface will be missed; if the distance threshold is too small, the normal virtual surface will be mistakenly judged as a broken surface. Therefore, the distance threshold needs to be specifically set and optimized in combination with the model characteristics and mesh generation accuracy requirements in the specific CAD model repair requirements. After setting the preset distance threshold, the distances between each to-be-compared edge are compared with the preset distance threshold. If the comparison result shows that one or several to-be-compared edge distances are less than the preset distance threshold, it indicates that there is a local narrow area in the CAD model (such as caused by non-standard modeling or Boolean operation). Then the corresponding current virtual surface is set as a broken surface and added to the broken surface set. In this way, the minimum edge distance parameter is combined with the boundary spacing calculation to realize the automatic detection and classification of broken surfaces, which significantly reduces manual intervention.
[0064] It should be noted that the broken faces in the broken face set can be displayed in a highlighted manner. Users can quickly identify broken faces in the CAD model, avoid manual full model inspection, and significantly improve efficiency. The highlighted display allows users to confirm or exclude misjudged broken faces (such as false positive results caused by improper parameter threshold settings) to ensure the accuracy of the processing results. It also provides users with the opportunity to actively select broken faces, and supports flexible adjustment of the processing range (for example, only repairing broken faces in key areas) to meet personalized needs. In addition, in addition to highlighting, different colors can be assigned according to the characteristics of the broken faces (such as the distance to the opposite side and the size of the area) to intuitively reflect the severity or type of the broken faces. For example, red indicates high-priority broken faces (50% below the distance threshold), and yellow indicates medium priority. Or, add a wireframe or semi-transparent bounding box around the broken face to highlight its spatial position and shape to avoid visual interference.
[0065] Step S13: regrouping the facet set according to the set partitioning method of sharing the same boundary or vertex to obtain a plurality of facet groups.
[0066] In this embodiment, first define the 1-neighborhood virtual faces of a virtual face: For all virtual surfaces Virtual surfaces that have common boundaries or common points are called virtual surfaces. A 1-neighborhood virtual face, virtual face The set of all 1-neighborhood virtual faces of .like Figure 3 As shown, the 1-neighborhood virtual faces of virtual face E are A, B, C, D, F, G, H, and I. Based on the above definition of 1-domain virtual faces, the adjacency relationship of virtual faces is obtained. Based on the above definition of neighborhood, all the broken faces in the broken face set are grouped and divided. Specifically, the union-find algorithm is used and each broken face in the broken face set is dynamically merged based on the adjacency relationship to obtain several broken face groups. The operation process is as follows:
[0067] At initialization, each facet is an independent set; all adjacency relationships are traversed, and if two facets are adjacent, their sets are merged; finally, several non-intersecting facet groups are obtained, each group corresponding to a local area to be merged. Since the time complexity of the union-find set is close to linear, the facet classification in large-scale models can be efficiently processed. By grouping, the facet merging operation is limited to the local area (within the same group), avoiding topological conflicts caused by cross-region operations.
[0068] Based on the adjacency relationship, the broken faces in the virtual face are classified. Specifically, the set of broken faces to be merged is: , traverse the collection All the fragments to be merged , respectively get the current broken surface The 1-neighborhood virtual face set of , we get a series of sets C:
[0069] ;
[0070] Furthermore, using the union-find algorithm, sets with the same elements Merge and finally get a set with no intersection between them. , that is, we get several broken surface groups, where n≥m.
[0071] .
[0072] For example: If the broken surface group Contains the wing leading edge fragments, Contains the fragments of the rear fuselage, merged Will not affect The geometric structure of the network ensures the independence and security of the operation. The adjacency graph is naturally compatible with the union-find algorithm, the former provides input, and the latter provides grouping logic. It supports any adjacency forms such as rings and chains. For example, the loop formed by the fragments A→B→C→A can still be correctly merged; even in the face of tens of thousands of fragments, the low time complexity of the union-find algorithm can still ensure efficient grouping. The established adjacency network provides connection information between fragments, and the union-find algorithm uses this information to dynamically merge connected fragments into independent groups. This classification method based on adjacency relationships not only ensures the locality and efficiency of the merging operation, but also avoids the complex traversal of the global model. It is the core technical support for automated fragment processing.
[0073] Step S14: performing virtual edge merging, boundary topological relationship updating and discrete mesh fusion processing on all broken faces in each broken face group to obtain a target virtual face after the broken faces are merged.
[0074] In this embodiment, the common edges between each broken face in the broken face group are identified; the virtual edge associated with the first endpoint of the common edge is obtained as the first virtual edge to be merged, so as to merge the first virtual edge to be merged to obtain a first target virtual edge; the virtual edge associated with the tail endpoint of the common edge is obtained as the second virtual edge to be merged, so as to merge the second virtual edge to be merged to obtain a second target virtual edge; based on the first target virtual edge and the second target virtual edge, each broken face is merged and updated to obtain a number of target virtual faces after the corresponding broken faces are merged; the topological relationship between each target virtual face is updated to obtain a target boundary topological relationship. It can be understood that the common edges of a group of virtual faces to be merged are identified. Figure 4 Take e7 as an example, the common edge is then obtained, and the virtual edges associated with the first and last endpoints of the common edge are merged. Figure 4 For example, the virtual edges associated with the first endpoint of the common edge are e5 and e6. At this time, the two virtual edges e5 and e6 are merged into the long edge e9. Similarly, the virtual edges associated with the tail endpoint of the common edge are obtained and the associated virtual edges are merged. Figure 4 For example, the virtual edges associated with the common edge first and second endpoints are e2 and e3. At this time, the two virtual edges e2 and e3 are merged into the long edge e8. In this way, the broken surfaces f1 and f2 are updated to the target virtual surface f3. The boundary condition of the target virtual surface f3 is {e1, e8, e4, e9}. At the same time, the target boundary topological relationship of other virtual surfaces topologically connected to the target virtual surface f3 is updated.
[0075] In this embodiment, based on the preprocessed watertight grid data structure, the discrete grids of adjacent target virtual surfaces are stitched according to the corresponding relationship of discrete grid points to generate the target discrete grids of the target virtual surfaces. It can be understood that during the broken surface merging process, in addition to updating the topological relationship, it is also necessary to update the discrete grids on the virtual surfaces. Since this broken surface merging operation is performed after the CAD model gap repair, the grid points between two adjacent virtual surfaces are in one-to-one correspondence at this time, and only the corresponding discrete grid points need to be stitched accordingly. The stitching result of the discrete grid points is as Figure 5 shown, where the discrete grid points of the target virtual surface and the target virtual surface are the virtual points on the dotted line in Figure 5 . Due to the one-to-one correspondence of the grid points, during the stitching process of the discrete grid points, through one-to-one correspondence stitching, the stitching result on the right side in Figure 5 is obtained.
[0076] Step S15: Perform two-dimensional mapping processing on the discrete grids of the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and use a quadtree search structure and fit a corresponding virtual continuous surface based on the two-dimensional discrete grid distribution.
[0077] In this embodiment, the conformal mapping algorithm is used to perform two-dimensional mapping processing on the target discrete grids of the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane. It can be understood that the target discrete grids on the target virtual surface are used as the initial mapping grids, and the conformal mapping algorithm is used to map them to the two-dimensional plane to obtain a two-dimensional discrete grid distribution on the two-dimensional plane. This mapping processing is convenient for operation in the two-dimensional space during subsequent geometric operations, and this mapping is a mapping that keeps the local angle unchanged.
[0078] In this embodiment, the quadtree search structure is used to locate each two-dimensional discrete grid in the local area of the two-dimensional plane and perform local fitting processing through interpolation or approximation algorithm to obtain a local parametric surface; through the hierarchical relationship of the quadtree search structure, each local parametric surface is seamlessly spliced to obtain a virtual continuous surface. It can be understood that in the two-dimensional plane, based on the distribution of the mapped two-dimensional discrete grids, a quadtree search structure is established, and the quadtree search structure recursively subdivides the plane area (four local areas) to form a hierarchical spatial index, realize efficient spatial division and data query, and provide support for subsequent parametric surface fitting. Specifically, the quadtree can quickly locate the area to which each two-dimensional discrete grid in the local area of the two-dimensional plane belongs, and the local parametric surface is generated by fitting through interpolation or approximation algorithm. In this way, when it is necessary to fit the parametric surface of a certain area, all relevant two-dimensional discrete grids in the area are quickly retrieved through the quadtree as input data for interpolation or approximation, and then the local parametric surface is generated by fitting through the interpolation or approximation algorithm. Then, the local parametric surfaces are seamlessly spliced through hierarchical relationships to obtain a virtual continuous surface, which, as a continuous geometric representation of the virtual surface, can accurately describe the geometric characteristics of the original three-dimensional surface.
[0079] Specifically, a quadtree search structure is established in a two-dimensional plane to fit the parametric surface. In this way, for any target discrete grid, by calculating the barycentric coordinates of the three-dimensional triangle to which the target discrete grid belongs, the two-dimensional parameter coordinates of the point can be quickly obtained; similarly, given any two-dimensional discrete grid, the barycentric coordinates of the two-dimensional triangle to which it belongs can be obtained through a quadtree search, and then the corresponding three-dimensional point coordinates can be obtained. Thus, the data structure serves as a continuous geometric object of the current virtual surface:
[0080] typedef struct VirtualConSurface{
[0081] Grid* m_2dGrid;
[0082] Tree* m_searchTree;
[0083] }VirtualConSurface;
[0084] Figure 6 The schematic diagram of the aircraft model before the fragments are merged is shown. Figure 6It can be seen that before the broken faces are merged, there are multiple fine topological faces (broken faces) on the model surface. These broken faces are usually located in narrow areas (such as rib ends and corners), showing geometrically discontinuous local face patches. There are small gaps or irregular boundaries (such as jagged edges) between the broken faces, and the size of the broken faces is small. The broken faces are connected by shared boundaries or vertices to form a local adjacency network, but the overall topological structure is complex and irregular.
[0085] like Figure 7 As shown in the figure, after the broken faces are merged, a continuous and smooth topological surface (target virtual surface) is formed in the local area, the original fine broken faces and irregular boundaries are eliminated, and the geometry of the new virtual surface is consistent with the original model, without introducing obvious deformation or error. The merging operation reduces the number of faces in the model and simplifies the topological structure (such as merging multiple small faces into one large face). The connection relationship between the new virtual face and the adjacent faces is optimized, avoiding the topological conflict caused by the original broken faces. The merged virtual surface has a continuous discrete grid structure, and the grid points are seamlessly connected, meeting the requirements of downstream engineering applications (such as CFD grid generation).
[0086] By comparison, it is found that before merging, a large number of fine facets are distributed on the surface of the model, but after merging, these facets are integrated into a few continuous facets; the edges of the broken faces before merging are irregular (such as jagged or uneven), but after merging, the edges are smooth and continuous; the connection relationship between the broken faces before merging is complex (such as crossing or overlapping), but after merging, the connection relationship is simplified and regular; the discrete grids before merging may have gaps or discontinuities, but after merging, the grid points are seamlessly connected to form a high-quality watertight grid. Combining the watertight grid generation framework with conformal mapping technology, the stitching of discrete grids and the reconstruction of continuous surfaces are realized, ensuring the geometric accuracy of downstream engineering applications (such as CFD grid generation).
[0087] It can be seen that the present application discloses a method for processing broken surfaces of CAD models, including: importing and repairing the initial CAD model, establishing a watertight grid data structure to obtain a virtual surface; traversing and identifying the current virtual surface that meets the preset broken surface judgment condition as a broken surface, to obtain a broken surface set; wherein the preset broken surface judgment condition is that the minimum edge distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than the preset distance threshold; regrouping the broken surface set according to the set partitioning method sharing the same boundary or vertex to obtain a number of broken surface groups; merging virtual edges, updating boundary topological relationships, and fusion processing of discrete grids for all broken surfaces in each of the broken surface groups to obtain a target virtual surface after the broken surfaces are merged; performing two-dimensional mapping processing of discrete grids on the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and fitting the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution using a quadtree search structure. It can be seen that by automatically traversing and detecting broken surfaces, manual intervention is significantly reduced, and broken surfaces can also be determined. Dynamically group broken faces by sharing boundaries / vertices to avoid repeated operations and improve processing efficiency. Only virtual edges are merged and virtual faces are reconstructed without changing the original geometric data. The operation is completely reversible, avoiding geometric shape deformation or precision loss in traditional geometric repair.
[0088] Reference Figure 8 As shown, the present invention also discloses a CAD model surface processing device, comprising:
[0089] The structure building module 11 is used to import and repair the initial CAD model and build a watertight grid data structure to obtain a virtual surface;
[0090] A broken face recognition module 12 is used to traverse and recognize that the current virtual face that meets the preset broken face determination condition is a broken face, so as to obtain a broken face set; wherein the preset broken face determination condition is that the minimum opposite edge distance of the boundary pair constructed by the non-adjacent boundaries of the virtual face is less than a preset distance threshold;
[0091] A group division module 13 is used to regroup the fragment face set according to a set division method that shares the same boundary or vertex to obtain a plurality of fragment face groups;
[0092] A broken face merging module 14 is used to merge virtual edges, update boundary topological relationships, and perform discrete mesh fusion processing on all broken faces in each broken face group to obtain a target virtual face after the broken faces are merged;
[0093] The surface fitting module 15 is used to perform a two-dimensional mapping process of discrete grids on the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and to fit a corresponding virtual continuous surface based on the two-dimensional discrete grid distribution using a quadtree search structure.
[0094] It can be seen that the present application discloses importing and repairing the initial CAD model, establishing a watertight grid data structure to obtain a virtual face; traversing and identifying the current virtual face that meets the preset broken face judgment condition as a broken face, to obtain a broken face set; wherein the preset broken face judgment condition is that the minimum opposite edge distance of the boundary pair constructed by the non-adjacent boundaries of the virtual face is less than the preset distance threshold; regrouping the broken face set according to the set division method sharing the same boundary or vertex to obtain a number of broken face groups; merging virtual edges, updating boundary topological relationships, and fusion processing of discrete grids for all broken faces in each of the broken face groups to obtain a target virtual face after the broken faces are merged; performing two-dimensional mapping processing of discrete grids on the target virtual face to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and fitting the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution using a quadtree search structure. It can be seen that by automatically traversing and detecting broken faces, manual intervention is significantly reduced, and broken faces can also be determined. Dynamically group broken faces by sharing boundaries / vertices to avoid repeated operations and improve processing efficiency. Only virtual edges are merged and virtual faces are reconstructed without changing the original geometric data. The operation is completely reversible, avoiding geometric shape deformation or precision loss in traditional geometric repair.
[0095] Furthermore, the present application also discloses an electronic device. Fig. 9 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0096] Fig. 9 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the CAD model surface processing method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0097] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0098] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0099] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0100] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the CAD model surface processing method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25.
[0101] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the above-disclosed CAD model fragmentation processing method is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the above-disclosed embodiments, and will not be repeated here.
[0102] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0103] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. The steps of the method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly with hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory RAM (Random Access Memory), memory, read-only memory ROM (Read Only Memory), electrically programmable EPROM (Electrically Programmable Read Only Memory), electrically erasable programmable EEPROM (ElectricErasable Programmable Read Only Memory), register, hard disk, removable disk, CD-ROM (CompactDisc-Read Only Memory), or any other form of storage medium known in the technical field.
[0104] Finally, 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 a process, method, article or 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 device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0105] The scheme provided by the present invention is introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for processing a CAD model surface, characterized in that: include: Import and repair the initial CAD model, and build a watertight mesh data structure to obtain virtual surfaces; Traversing and identifying the current virtual faces that meet the preset broken face determination condition as broken faces, so as to obtain a broken face set; wherein the preset broken face determination condition is that the minimum opposite edge distance of the boundary pairs constructed by the non-adjacent boundaries of the virtual faces is less than a preset distance threshold; Regrouping the facet set according to a set partitioning method that shares the same boundary or vertex to obtain a plurality of facet groups; Performing virtual edge merging, boundary topological relationship updating and discrete mesh fusion processing on all broken faces in each broken face group to obtain a target virtual face after the broken faces are merged; The target virtual surface is subjected to a two-dimensional mapping process of a discrete grid to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and a corresponding virtual continuous surface is fitted based on the two-dimensional discrete grid distribution using a quadtree search structure.
2. The CAD model surface processing method according to claim 1, characterized in that: The traversing and identifying the current virtual faces that meet the preset face-breaking determination condition as face-breaking faces, so as to obtain a face-breaking face set, includes: Using non-adjacent boundaries in each of the virtual faces to construct corresponding boundary pairs, and using the minimum opposite side distance of the boundary pairs in each of the virtual faces as the opposite side distance to be compared of the corresponding current virtual face; Comparing the size relationship between the distances of the opposite sides to be compared and a preset distance threshold to obtain a corresponding comparison result; The current virtual surface corresponding to the to-be-compared opposite edge distance whose comparison result is less than the preset distance threshold is set as a broken surface to obtain a broken surface set.
3. The CAD model surface processing method according to claim 2, characterized in that: The step of constructing corresponding boundary pairs by using non-adjacent boundaries in each of the virtual faces, and taking the minimum opposite side distance of the boundary pairs in each of the virtual faces as the opposite side distance to be compared of the corresponding current virtual face, includes: Taking any boundary in the current virtual surface as the current boundary, constructing a corresponding boundary pair according to the current boundary and a target boundary not adjacent to the current boundary, and calculating the opposite side distance between the boundary pairs; Taking any other boundary except the current boundary as a new current boundary, and jumping to execute the step of constructing a corresponding boundary pair according to the current boundary and a target boundary not adjacent to the current boundary, until the opposite side distances of all boundary pairs of the current virtual surface are obtained; The minimum opposite side distance among the opposite side distances is used as the opposite side distance to be compared of the current virtual surface.
4. The CAD model surface processing method according to claim 1, characterized in that: The merging of virtual edges and updating of boundary topological relationships of all broken faces in each broken face group includes: Identifying common edges between the broken faces in the broken face group; Acquire a virtual edge associated with the first endpoint of the common edge as a first virtual edge to be merged, so as to merge the first virtual edge to be merged to obtain a first target virtual edge; Acquire a virtual edge associated with the tail endpoint of the common edge as a second virtual edge to be merged, so as to merge the second virtual edge to be merged to obtain a second target virtual edge; Merging and updating each broken surface based on the first target virtual edge and the second target virtual edge to obtain a number of target virtual surfaces after the corresponding broken surfaces are merged; The topological relationship between the target virtual surfaces is updated to obtain the target boundary topological relationship.
5. The CAD model surface processing method according to claim 1, characterized in that: The discrete grid fusion processing of the target virtual surface includes: Based on the preprocessed watertight grid data structure, the discrete grids of adjacent target virtual surfaces are stitched according to the correspondence between discrete grid points to generate a target discrete grid of the target virtual surface.
6. The CAD model surface processing method according to claim 5, characterized in that: The step of performing a two-dimensional mapping process of discrete grids on the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane includes: A conformal mapping algorithm is used to perform two-dimensional mapping processing on the target discrete grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane.
7. The CAD model surface processing method according to claim 1, characterized in that: The method of using a quadtree search structure and fitting a corresponding virtual continuous surface based on the two-dimensional discrete grid distribution includes: Using the quadtree search structure to locate each two-dimensional discrete grid in the local area in the two-dimensional plane and perform local fitting processing through interpolation or approximation algorithm to obtain a local parametric surface; Through the hierarchical relationship of the quadtree search structure, the local parameter surfaces are seamlessly spliced to obtain a virtual continuous surface.
8. A CAD model surface processing device, characterized in that: include: The structure building module is used to import and repair the initial CAD model and build a watertight grid data structure to obtain virtual surfaces; A broken face recognition module is used to traverse and recognize that the current virtual face that meets the preset broken face determination condition is a broken face, so as to obtain a broken face set; wherein the preset broken face determination condition is that the minimum opposite edge distance of the boundary pair constructed by the non-adjacent boundaries of the virtual face is less than a preset distance threshold; A group division module, used for regrouping the broken face set according to a set division method sharing the same boundary or vertex to obtain a plurality of broken face groups; A broken face merging module is used to merge virtual edges, update boundary topological relationships, and perform discrete mesh fusion processing on all broken faces in each broken face group to obtain a target virtual face after the broken faces are merged; The surface fitting module is used to perform two-dimensional mapping processing of discrete grids on the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and to fit the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution using a quadtree search structure.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the steps of the CAD model surface processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the CAD model surface processing method as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Topology-guaranteed complex thin-walled workpiece model middle surface extraction method based on virtual segmentation
CN107908880A
Virtual curved surface processing method and device, storage medium and electronic device
CN118505927A
Method for optimizing broken surface of three-dimensional model of vane pump
CN119129128A
Cited By
GPU-based BRep model watertight grid conversion and topology reconstruction method
CN120580388A
A GPU-based BRep model watertight mesh conversion and topology reconstruction method
CN120580388B