A method, device, equipment and medium for processing broken surfaces of CAD models
By establishing a watertight grid data structure and quad-tree search technology, the broken faces in the CAD model are automatically processed, and the automatic detection and processing of broken face defects is solved, which improves processing efficiency and maintains the original geometric integrity.
Patent Information
- Application Number
- CN202510495984.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-04-21
AI Technical Summary
In the prior art, the surface defects in the CAD model are difficult to detect and process automatically, resulting in downstream engineering operations failure, manual processing is time-consuming and labor-intensive, and geometric errors may be introduced.
By establishing a watertight mesh data structure, identifying and grouping broken faces, performing virtual edge merging and updating topological relationships, using quad-tree search to fit continuous surfaces, realizing automatic adjustment of broken faces without changing the original geometric definition.
Significantly reduce manual intervention, improve processing efficiency, avoid geometric deformation and accuracy losses, ensure operational reversibility, and meet engineering needs.
Smart Images

Figure CN120030948B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer-aided design, and particularly relates to a method, device, equipment and medium for processing broken surfaces of a CAD model. Background Art
[0002] In the digital models of aircraft, automobiles, etc., there often appears a type of topological surface with narrow structures. At the narrow structures, the dimensions in two parametric directions will vary greatly, thus forming a certain narrow area in the model. Such topological surfaces are called "broken surfaces". The existence of broken surface defects does not directly affect the integrity and correctness of the model topological structure, but will lead to the failure of various downstream engineering operations, such as surface intersection or offset during model modification, surface mesh generation in finite element analysis, process planning in numerical control machining, tool path calculation, etc. Such defects are common in features such as rib ends, corners, inner and outer edges of the digital models of aircraft structural parts, and are caused by non-standard modeling operations, frequent surface trimming, solid Boolean operations or system accuracy problems. Since it is difficult to detect by the naked eye and the workload is large and cumbersome, it is usually not convenient to detect in a manual interaction manner. Therefore, most are based on manual recognition and manual processing methods, and no automated and general solution has been proposed yet. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for processing broken surfaces of a CAD model, which can automatically adjust and process the broken surfaces of the CAD model, without changing the geometric definition of the original model, the operation is completely reversible, and it meets the engineering practical requirements. The specific solutions are as follows:
[0004] In a first aspect, the present application discloses a method for processing broken surfaces of a CAD model, including:
[0005] Import and repair the initial CAD model, and establish a watertight grid data structure to obtain a virtual surface;
[0006] Traverse and identify the current virtual surface that meets the preset broken surface determination condition as a broken surface to obtain a broken surface set; wherein, the preset broken surface determination condition is that the minimum opposite side distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than the preset distance threshold;
[0007] Re-group the broken surface set according to the set division method of sharing the same boundary or vertex to obtain several broken surface groups;
[0008] Perform virtual edge merging, boundary topological relationship update and discrete grid fusion processing on all the broken surfaces in each broken surface group to obtain the target virtual surface after broken surface merging;
[0009] Perform two-dimensional mapping processing on the target virtual surface to obtain a two-dimensional discrete grid distribution on a two-dimensional plane, and use a quadtree search structure to fit a corresponding virtual continuous surface based on the two-dimensional discrete grid distribution.
[0010] Optionally, traverse and identify the current virtual surface that meets the preset broken surface determination condition as a broken surface to obtain a set of broken surfaces, including:
[0011] Construct corresponding boundary pairs using non-adjacent boundaries in each of the virtual surfaces, and use the minimum opposite side distance of the boundary pairs in each of the virtual surfaces as the to-be-compared opposite side distance of the corresponding current virtual surface;
[0012] Compare the size relationship between each of the to-be-compared opposite side distances and a preset distance threshold to obtain corresponding comparison results;
[0013] Set the current virtual surface corresponding to the to-be-compared opposite side distance with a comparison result less than the preset distance threshold as a broken surface to obtain a set of broken surfaces.
[0014] Optionally, the step of constructing corresponding boundary pairs using non-adjacent boundaries in each of the virtual surfaces and using the minimum opposite side distance of the boundary pairs in each of the virtual surfaces as the to-be-compared opposite side distance of the corresponding current virtual surface includes:
[0015] Take any one boundary in the current virtual surface as the current boundary, construct a corresponding boundary pair according to the current boundary and a target boundary that is not adjacent to the current boundary, and calculate the opposite side distance between the boundary pair;
[0016] Take any one other boundary except the current boundary as the new current boundary, and jump to execute the step of constructing a corresponding boundary pair according to the current boundary and a target boundary that is not adjacent to the current boundary until the opposite side distances of all boundary pairs of the current virtual surface are obtained;
[0017] Take the minimum opposite side distance among the opposite side distances as the to-be-compared opposite side distance of the current virtual surface.
[0018] Optionally, perform virtual edge merging and boundary topology relationship updating on all broken surfaces in each of the broken surface groups, including:
[0019] Identify the common edges between each of the broken surfaces in the broken surface group;
[0020] Obtain the virtual edge associated with the start endpoint of the common edge as the first virtual edge to be merged, and perform merging processing on the first virtual edge to be merged to obtain a first target virtual edge;
[0021] Obtain the virtual edge associated with the end endpoint of the common edge as the second virtual edge to be merged, and perform merging processing on the second virtual edge to be merged to obtain a second target virtual edge;
[0022] Merge and update each fragmented surface based on the first target virtual edge and the second target virtual edge to obtain a number of target virtual surfaces after merging the corresponding fragmented surfaces;
[0023] Update the topological relationship between each of the target virtual surfaces to obtain the target boundary topological relationship.
[0024] Optionally, the discrete grid fusion processing of the target virtual surface includes:
[0025] Suture the discrete grids of adjacent target virtual surfaces according to the discrete grid point correspondence based on the preprocessed watertight grid data structure to generate the target discrete grid of the target virtual surface.
[0026] Optionally, the two-dimensional mapping processing of the discrete grid of the target virtual surface to obtain the two-dimensional discrete grid distribution on the two-dimensional plane includes:
[0027] Perform two-dimensional mapping processing on the target discrete grid of the target virtual surface using the conformal mapping algorithm to obtain the two-dimensional discrete grid distribution on the two-dimensional plane.
[0028] Optionally, the fitting of the corresponding virtual continuous surface using the quadtree search structure and based on the two-dimensional discrete grid distribution includes:
[0029] Use the quadtree search structure to locate each two-dimensional discrete grid belonging to the local area in the two-dimensional plane and perform local fitting processing through interpolation or approximation algorithms to obtain local parametric surfaces;
[0030] Seamlessly splice each of the local parametric surfaces through the hierarchical relationship of the quadtree search structure to obtain the virtual continuous surface.
[0031] In a second aspect, the present application discloses a CAD model fragmented surface processing device, including:
[0032] A structure establishment module, configured to import and repair an initial CAD model, establish a watertight grid data structure to obtain virtual surfaces;
[0033] A fragmented surface recognition module, configured to traverse and recognize the current virtual surface that meets the preset fragmented surface determination condition as a fragmented surface to obtain a fragmented surface set; wherein, the preset fragmented surface determination condition is that the minimum opposite side distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than a preset distance threshold;
[0034] A group division module, configured to re-group the fragmented surface set according to the set division method of sharing the same boundary or vertex to obtain a number of fragmented surface groups;
[0035] A broken surface merging module, configured to perform virtual edge merging, boundary topological relationship updating, and discrete grid fusion processing on all broken surfaces in each of the broken surface groups to obtain a target virtual surface after broken surface merging;
[0036] A surface fitting module, configured to 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 to fit a corresponding virtual continuous surface based on the two-dimensional discrete grid distribution.
[0037] In a third aspect, the present application discloses an electronic device, including:
[0038] A memory, configured to store a computer program;
[0039] A processor, configured to execute the computer program to implement the steps of the foregoing disclosed CAD model broken surface processing method.
[0040] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein, when the computer program is executed by a processor, the steps of the foregoing disclosed CAD model broken surface processing method are implemented.
[0041] It can be seen that the present application discloses a CAD model broken surface processing method, including: importing and repairing an 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 determination condition as a broken surface to obtain a broken surface set; wherein, the preset broken surface determination condition is that the minimum opposite side distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than a preset distance threshold; re-grouping the broken surface set according to the set division method of sharing the same boundary or vertex to obtain a number of broken surface groups; performing virtual edge merging, boundary topological relationship updating, and discrete grid fusion processing on all broken surfaces in each of the broken surface groups to obtain a target virtual surface after broken surface merging; performing 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 using a quadtree search structure to fit a corresponding virtual continuous surface based on the two-dimensional discrete grid distribution. Thus, it can be seen that by automatically traversing and detecting broken surfaces, manual intervention is significantly reduced, and broken surfaces can also be determined. By dynamically grouping broken surfaces through shared boundaries / vertices, repeated operations are avoided, the processing efficiency is improved, and only virtual edge merging and virtual surface reconstruction are performed without changing the original geometric data, and the operation is completely reversible, avoiding geometric shape deformation or accuracy loss in traditional geometric repair. Description of the Drawings
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to the provided drawings.
[0043] Figure 1 Flowchart of a method for processing broken surfaces of a CAD model disclosed in this application;
[0044] Figure 2 Schematic diagram of virtual surfaces and virtual edges of a CAD model disclosed in this application;
[0045] Figure 3 Schematic diagram of neighboring virtual surfaces of virtual surface E of a CAD model disclosed in this application;
[0046] Figure 4 Schematic diagram of virtual edge merging and target virtual surfaces of a CAD model disclosed in this application;
[0047] Figure 5 Schematic diagram after discrete grid stitching of a CAD model disclosed in this application;
[0048] Figure 6 Schematic diagram of the model before broken surface merging of a CAD model disclosed in this application;
[0049] Figure 7 Schematic diagram of the model after broken surface merging of a CAD model disclosed in this application;
[0050] Figure 8 Schematic diagram of the structure of a device for processing broken surfaces of a CAD model disclosed in this application;
[0051] Figure 9 Schematic diagram of the structure of an electronic device disclosed in this application. Detailed implementation manners
[0052] The following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0053] In the grid generation process of traditional CFD (Computational Fluid Dynamics), geometric cleaning operations are often required before grid generation. Then, users need to identify all geometric errors and repair them one by one. This repair process often requires a large amount of manual interaction, with the help of complex graphical interfaces, such as professional geometric processing software, and is highly dependent on the experience of operators. For complex models composed of a large number of components, the cost of manual repair is even higher.
[0054] In addition, before the numerical simulation starts, it is necessary to first define the CAD (Computer Aided Design) model, then generate the computational grid, and set boundary conditions, materials, and solution parameters, etc. This process is called the preprocessing of numerical simulation. The preprocessing of numerical simulation is the main performance bottleneck of numerical simulation of complex problems, involving a large amount of manual intervention, and its efficiency is highly dependent on user experience. A reliable and efficient automatic preprocessing algorithm is the key to improving the efficiency and accuracy of numerical simulation. It should be noted that the most important link in the preprocessing 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 the dirty geometry with errors into "clean" geometry that meets the requirements of grid generation.
[0055] On the surfaces of digital models such as airplanes and automobiles, there often appears a type of topological surface with narrow structures. At the narrow structures, the dimensions in the two parametric directions will vary greatly, thus forming a certain narrow area in the model. Such topological surfaces are called "broken surfaces". The existence of broken surface defects does not directly affect the integrity and correctness of the model topological structure, but will lead to the failure of downstream engineering operations, such as surface intersection or offset during model modification, surface mesh generation in finite element analysis, process planning in numerical control machining, tool path calculation, etc. Such defects are common in features such as rib ends, corners, and inner and outer edges of digital models of aircraft structural parts, and are caused by unregulated modeling operations, frequent surface trimming, solid Boolean operations, or system accuracy problems. Since it is difficult to detect with the naked eye and the workload is large and cumbersome, it is usually not convenient to detect by manual interaction.
[0056] Most of the existing treatment methods for broken surface defects rely on manual identification and manual processing. This treatment method is very time-consuming and laborious when dealing with complex models. Especially for an assembly consisting of thousands of parts, it is unrealistic to detect only by manpower. For the manually selected broken surfaces, they are all achieved by changing the actual geometry of the model. Such operations involve a large amount of geometric calculations, may not be reversible, and due to the sampling accuracy, there will inevitably be geometric errors between the new surface and the old surface.
[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] Referring 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 grid data structure to obtain virtual surfaces.
[0060] In this embodiment, the initial CAD model is processed for the gaps on the model surface 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 preprocessing of numerical simulation, there are gaps in the initial CAD model. In order to obtain accurate mesh generation results, it is necessary to repair the gaps on the surface of 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 part in the CAD model repair requirements is a conventional generation method, such as the reverse engineering method based on measurement data, the forward design method based on design parameters, and the hybrid design method combining the two, which is not specifically limited herein. The CAD model repair requirements can specifically be the repair requirements for a type of broken surface with a narrow structure that often appears on the digital model surfaces of aircraft, automobiles, etc. Further, the repaired CAD model is meshed and generated to obtain a virtual surface including discrete surfaces and continuous surfaces. It can be understood that after the initial CAD model is repaired by the gap repair method, a repaired CAD model is obtained, and then the watertight mesh data structure of the repaired CAD model is generated through the watertight mesh generation method. Among them, the watertight mesh 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 mesh is a discrete representation of the model surface. Watertight mesh means that the connection between meshes is tight and gapless, just like being sealed. This characteristic is crucial for subsequent accurate calculations and analyses. Using this framework to establish the data structure can organize each part of the repaired CAD model in an orderly and standardized manner, facilitating various subsequent operations on the model. Specifically, after establishing the data structure of the repaired CAD model through the watertight mesh generation framework, each obtained virtual surface includes two parts: discrete surfaces and continuous surfaces. The discrete surface is obtained by discretizing the continuous surface and is composed of a series of discrete point, line, and surface elements. In the subsequent processing, it is easier to operate on the discrete surface. The continuous surface is the part of the surface that retains the original continuous characteristics and reflects the overall shape and geometric features of the surface, that is, the solid geometric data. When the CAD model repair requirements are for aircraft structural parts, such as the CAD models of any one or several of the wing rib ends, fuselage corners, inner and outer edges, geometric fragments are likely to be generated in narrow areas. Therefore, after the initial CAD model is obtained, by performing gap repair processing on it to obtain a repaired CAD model, such as the repaired CAD model of the wing rib end, there is still a broken surface repair requirement. And the corresponding virtual surface represents the topological patch on the surface of the repaired CAD model of the wing rib end after gap repair.
[0061] Step S12: Traverse and identify the current virtual surface that meets the preset broken surface determination condition as a broken surface to obtain a set of broken surfaces; wherein, the preset broken surface determination condition is that the minimum opposite side distance of the boundary pairs constructed by the non-adjacent boundaries of the virtual surface is less than the preset distance threshold.
[0062] In this embodiment, non-adjacent boundaries in each of the virtual surfaces are used to construct corresponding boundary pairs, and the minimum opposite side distance of the boundary pairs in each of the virtual surfaces is used as the to-be-compared opposite side distance of the corresponding current virtual surface; specifically, any one boundary in the current virtual surface is used as the current boundary, and a corresponding boundary pair is constructed according to the current boundary and the target boundary that is not adjacent to the current boundary, and the opposite side distance between the boundary pairs is calculated; any other boundary except the current boundary is used as the new current boundary, and the step of constructing the corresponding boundary pair according to the current boundary and the target boundary that is not adjacent to the current boundary is executed by jumping, until the opposite side distances of all the boundary pairs of the current virtual surface are obtained; the minimum opposite side distance among the opposite side distances is used as the to-be-compared opposite side distance of the current virtual surface. It can be understood that, first, any one 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 in the current virtual surface as the target boundary. As Figure 2 shown, for the current virtual surface abcde, if the selected current boundary is ab, the target boundaries that are not connected to it are cd and de. Therefore, the constructed boundary pairs are (ab, cd) and (ab, de), and then the opposite side distance between the current boundary and the target boundary in the boundary pair is calculated, that is, and are obtained. Further, other boundaries (boundaries except the current boundary) of the current virtual surface are traversed, and the boundary pairs of other boundaries are respectively obtained. For example, the target boundaries of the current boundary bc are ae and ed, and the constructed boundary pairs are (bc, ae) and (bc, ed), and then the opposite side distance between the current boundary and the target boundary in the boundary pair is calculated, that is, and are obtained; the target boundaries of the current boundary cd are ab and ae, and the constructed boundary pairs are (cd, ab) and (cd, ae), and then the opposite side distance between the current boundary and the target boundary in the boundary pair is calculated, that is, and are obtained. At this time, all the opposite side distances of the current virtual surface are compared to obtain the minimum opposite side distance : . And the minimum opposite side distance is used as the to-be-compared opposite side distance of the current virtual surface. Similarly, the to-be-compared opposite side distances of each virtual surface are obtained.
[0063] In this embodiment, the size relationship between each of the to-be-compared opposite side distances and a preset distance threshold is compared to obtain corresponding comparison results; the current virtual surface corresponding to the to-be-compared opposite side distance with a comparison result 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 during the process of setting the preset distance threshold, corresponding settings need to be made according to the previous CAD model repair requirements. For example: in aircraft structural parts, if broken surfaces are usually caused by millimeter-level narrow areas, the distance threshold can be set to 0.5 mm (millimeter); if the model accuracy requirement is high, the distance threshold can be set to a smaller value (such as 0.05 mm). Since an overly large distance threshold set by the user will result in missed detection of broken surfaces; if the distance threshold is too small, normal virtual surfaces will be misjudged as broken surfaces. Therefore, the distance threshold needs to be specifically set and optimized in combination with the model features and mesh generation accuracy requirements in the specific CAD model repair requirements. After setting the preset distance threshold, the sizes between each of the to-be-compared opposite side distances and the preset distance threshold are respectively compared. When the comparison result shows that one or several of the to-be-compared opposite side distances are less than the preset distance threshold, it indicates that there are local narrow areas in the CAD model (such as caused by non-standard modeling or Boolean operations), then the corresponding current virtual surface is set as a broken surface and added to the broken surface set. In this way, through the minimum opposite side distance parameter, combined with the boundary spacing calculation, the automatic detection and classification of broken surfaces are realized, significantly reducing manual intervention.
[0064] It should be noted that the broken surfaces in the broken surface set can be displayed in a highlighted manner, allowing users to quickly identify the broken surfaces in the CAD model, avoiding manual full-model inspection, and significantly improving efficiency. And the highlighted display allows users to confirm or exclude misjudged broken surfaces (such as false positive results caused by improper parameter threshold settings), ensuring the accuracy of the processing results. The opportunity for users to actively select broken surfaces can also be provided, supporting flexible adjustment of the processing range (for example, only repairing the broken surfaces in key areas) to meet personalized needs. In addition, in addition to the highlighted display, different colors can be assigned according to the broken surface characteristics (such as opposite side distance, area size) to intuitively reflect the severity or type of the broken surface. For example: red indicates high-priority broken surfaces (50% below the distance threshold), and yellow indicates medium priority. Or, add a wireframe or a semi-transparent bounding box around the broken surface to highlight its spatial position and shape, avoiding visual interference.
[0065] Step S13: Re-group the broken surface set according to the set division method of sharing the same boundary or vertex to obtain several broken surface groups.
[0066] In this embodiment, first, the 1-neighborhood virtual surface of the virtual surface is defined: for a certain virtual surface in terms of, all virtual surfaces that have a common boundary or a common point with the virtual surface are called the virtual surface a 1-neighborhood virtual face, the virtual face The set composed of all 1-neighborhood virtual faces of is denoted as . As Figure 3 shown, the 1-neighborhood virtual faces of the virtual face E are A, B, C, D, F, G, H, I. Based on the above definition of 1-neighborhood virtual faces, the adjacency relationship of virtual faces is obtained. Based on the above neighborhood definition, all the fragmented faces in the fragmented face set are grouped and divided. Specifically, the disjoint-set algorithm is used and based on the adjacency relationship, each fragmented face in the fragmented face set is dynamically merged to obtain several fragmented face groups. The operation process is as follows:
[0067] At the initialization, each fragmented face is an independent set; traverse all adjacency relationships. If two fragmented faces are adjacent, then merge their belonging sets; finally, several non-intersecting fragmented face groups are obtained, and each group corresponds to a local area to be merged. Since the time complexity of the disjoint-set is close to linear, it can efficiently process the classification of fragmented faces in a large-scale model. Through grouping, the fragmented face merging operation is restricted to the local area (within the same group), avoiding topological conflicts caused by cross-area operations.
[0068] Based on this adjacency relationship, the fragmented faces in the virtual face are classified. Specifically, the set of fragmented faces to be merged is , traverse the set all the fragmented faces to be merged in , respectively obtain the 1-neighborhood virtual face set of the current fragmented face , and obtain a series of sets C:
[0069] ;
[0070] Furthermore, use the disjoint-set algorithm to merge the sets with the same elements. Finally, pairwise non-intersecting sets are obtained, that is, several fragmented face groups are obtained, where n≥m.
[0071] .
[0072] For example: If the fragmented face group contains the fragmented faces of the leading edge of the wing, and the group contains the fragmented faces of the rear part of the fuselage, merging will not affect The geometric structure ensures the independence and safety of operations. The adjacency relation graph is naturally compatible with the union-find algorithm. The former provides the input, and the latter provides the grouping logic. It supports any adjacency forms such as circular and chain-like. For example, a loop formed by fragmented surfaces A→B→C→A can still be correctly merged. Even in the face of tens of thousands of fragmented surfaces, the low time complexity of the union-find algorithm can still ensure efficient grouping. The established adjacency relation network provides the connection information between fragmented surfaces, and the union-find algorithm uses this information to dynamically merge connected fragmented surfaces into independent groups. This classification method based on adjacency relations not only ensures the locality and efficiency of the merging operation but also avoids complex traversal of the global model, which is the core technical support for automatic fragmented surface processing.
[0073] Step S14: Perform virtual edge merging, boundary topology relation updating, and discrete grid fusion processing on all fragmented surfaces in each of the fragmented surface groups to obtain the target virtual surface after fragmented surface merging.
[0074] In this embodiment, identify the common edges between the fragmented surfaces in the fragmented surface group; obtain the virtual edges associated with the starting endpoints of the common edges as the first virtual edges to be merged, and perform merging processing on the first virtual edges to be merged to obtain the first target virtual edges; obtain the virtual edges associated with the ending endpoints of the common edges as the second virtual edges to be merged, and perform merging processing on the second virtual edges to be merged to obtain the second target virtual edges; perform merging and updating on each fragmented surface based on the first target virtual edges and the second target virtual edges to obtain several target virtual surfaces after the corresponding fragmented surface merging; update the topological relations between the target virtual surfaces to obtain the target boundary topological relations. It can be understood that identify the common edges of a group of virtual surfaces to be merged. Figure 4 For example, the common edge is e7, and then obtain the virtual edges associated with the starting endpoint of the common edge and merge the associated virtual edges. Figure 4 For example, the virtual edges associated with the starting endpoint of the common edge are e5 and e6. At this time, merge the two virtual edges e5 and e6 into the long edge e9. Similarly, obtain the virtual edges associated with the ending endpoint of the common edge and merge the associated virtual edges. Figure 4 For example, the virtual edges associated with the starting endpoint of the common edge are e2 and e3. At this time, merge the two virtual edges e2 and e3 into the long edge e8. In this way, update the fragmented surfaces f1 and f2 to the target virtual surface f3. The boundary situation of the target virtual surface f3 is {e1, e8, e4, e9}, and at the same time, update the target boundary topological relations of other virtual surfaces that are topologically connected to the target virtual surface f3.
[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 grid of the target virtual surface. 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 surface. Since this broken surface merging operation is performed after the CAD model gap repair, the grid points between two adjacent virtual surfaces correspond one by one 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. Among them, 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 . Since the grid points correspond one by one, during the stitching process of the discrete grid points, through one-to-one corresponding stitching, the stitching result on the right side in Figure 5 is obtained.
[0076] Step S15: Perform two-dimensional mapping processing on the discrete grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on the 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 grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on the two-dimensional plane. It can be understood that the target discrete grid on the target virtual surface is used as the initial mapping grid, and it is mapped to the two-dimensional plane by using the conformal mapping algorithm to obtain a two-dimensional discrete grid distribution on the two-dimensional plane. This mapping processing is convenient for operating 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 region of the two-dimensional plane and perform local fitting processing through an interpolation or approximation algorithm to obtain a local parametric surface; through the hierarchical relationship of the quadtree search structure, the local parametric surfaces are seamlessly stitched together 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. The quadtree search structure recursively subdivides the plane region (four local regions) to form a hierarchical spatial index, realizing efficient spatial partitioning and data query, and providing support for subsequent parametric surface fitting. Specifically, the quadtree can quickly locate the regions to which each two-dimensional discrete grid in the local region of the two-dimensional plane belongs, and generate a local parametric surface by fitting through an interpolation or approximation algorithm. In this way, when it is necessary to fit the parametric surface of a certain region, all relevant two-dimensional discrete grids in the region are quickly retrieved through the quadtree and used as the input data for interpolation or approximation, and then a local parametric surface is generated by fitting through the interpolation or approximation algorithm. Then, the local parametric surfaces are seamlessly stitched together through the hierarchical relationship to obtain a virtual continuous surface. This surface, as the continuous geometric representation of the virtual surface, can accurately describe the geometric features of the original three-dimensional surface.
[0079] Specifically, a quadtree search structure is established in the two-dimensional plane for fitting the parametric surface. In this way, for any target discrete grid, by calculating the centroid coordinates of the three-dimensional triangle to which the target discrete grid belongs, the two-dimensional parametric coordinates of this point can be quickly obtained; similarly, given any two-dimensional discrete grid, the centroid coordinates of the two-dimensional triangle where it is located can be obtained through the quadtree search, and then the corresponding three-dimensional point coordinates can be obtained. Thus, this data structure serves as the 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 Shows a schematic diagram of the aircraft model before the broken surface merging. According to Figure 6It can be seen that before the broken surface merging, there are multiple small and fragmented topological surfaces (broken surfaces) on the model surface. These broken surfaces are usually located in narrow areas (such as the ends of ribs, corners), and are manifested as locally non - continuous patches geometrically. There are small gaps or irregular boundaries (such as serrated edges) between the broken surfaces, and the sizes of the broken surfaces are small. The broken surfaces are connected by shared boundaries or vertices to form a local adjacency network, but the overall topological structure is complex and irregular.
[0085] As Figure 7 shown, after the broken surface merging, a continuous and smooth topological surface (target virtual surface) is formed in the local area, eliminating the original small and fragmented patches and irregular boundaries. The geometric shape of the new virtual surface is consistent with the original model, without introducing obvious deformation or error. The merging operation reduces the number of patches in the model and simplifies the topological structure (such as merging multiple small patches into one large patch). The connection relationship between the new virtual surface and the adjacent patches is optimized, avoiding the topological conflicts caused by the original broken surfaces. 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 small and fragmented patches are distributed on the model surface, and after merging, these patches are integrated into a few continuous patches; before merging, the edges of the broken surfaces are irregular (such as serrated or uneven), and after merging, the edges are smooth and continuous; before merging, the connection relationships between the broken surfaces are complex (such as crossing or overlapping), and after merging, the connection relationships are simplified and regular; before merging, there may be gaps or discontinuities in the discrete grid, and after merging, the grid points are seamlessly connected to form a high - quality watertight grid. Combining the watertight grid generation framework with the conformal mapping technology, the stitching of the discrete grid and the reconstruction of the continuous surface 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 fragmented surfaces of a CAD model, including: importing and repairing an initial CAD model, establishing a watertight grid data structure to obtain virtual surfaces; traversing and identifying the current virtual surfaces that meet the preset fragmented surface determination conditions as fragmented surfaces to obtain a set of fragmented surfaces; wherein, the preset fragmented surface determination condition is that the minimum opposite side distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than a preset distance threshold; re-grouping the set of fragmented surfaces according to the set division method of sharing the same boundary or vertex to obtain several groups of fragmented surfaces; performing virtual edge merging, boundary topology relationship updating, and discrete grid fusion processing on all the fragmented surfaces in each group of fragmented surfaces to obtain the target virtual surface after fragmented surface merging; performing two-dimensional mapping processing on the discrete grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on the two-dimensional plane, and using a quadtree search structure to fit the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution. Thus, by automatically traversing and detecting fragmented surfaces, manual intervention is significantly reduced, and fragmented surfaces can also be determined. By dynamically grouping fragmented surfaces through shared boundaries / vertices, repeated operations are avoided, the processing efficiency is improved, and only virtual edge merging and virtual surface reconstruction are performed without changing the original geometric data, and the operation is completely reversible, avoiding geometric shape deformation or accuracy loss in traditional geometric repair.
[0088] Referring Figure 8 as shown, the present invention also correspondingly discloses a device for processing fragmented surfaces of a CAD model, including:
[0089] A structure establishment module 11, configured to import and repair an initial CAD model, and establish a watertight grid data structure to obtain virtual surfaces;
[0090] A fragmented surface recognition module 12, configured to traverse and identify the current virtual surfaces that meet the preset fragmented surface determination conditions as fragmented surfaces to obtain a set of fragmented surfaces; wherein, the preset fragmented surface determination condition is that the minimum opposite side distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than a preset distance threshold;
[0091] A group division module 13, configured to re-group the set of fragmented surfaces according to the set division method of sharing the same boundary or vertex to obtain several groups of fragmented surfaces;
[0092] A fragmented surface merging module 14, configured to perform virtual edge merging, boundary topology relationship updating, and discrete grid fusion processing on all the fragmented surfaces in each group of fragmented surfaces to obtain the target virtual surface after fragmented surface merging;
[0093] A surface fitting module 15, configured to perform two-dimensional mapping processing on the discrete grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on the two-dimensional plane, and use a quadtree search structure to fit the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution.
[0094] It can be seen that the present application discloses importing and repairing an initial CAD model, establishing a watertight mesh data structure to obtain virtual faces; traversing and identifying the current virtual faces that meet the preset broken face determination condition as broken faces to obtain a set of broken faces; wherein, the preset broken face determination condition is that the minimum opposite side distance of the boundary pair constructed by the non-adjacent boundaries of the virtual face is less than the preset distance threshold; regrouping the set of broken faces according to the set division method of sharing the same boundary or vertex to obtain several broken face groups; performing virtual edge merging, boundary topology relationship updating, and discrete grid fusion processing on all the broken faces in each broken face group to obtain the target virtual face after broken face merging; performing two-dimensional mapping processing on the discrete grid of the target virtual face to obtain the two-dimensional discrete grid distribution on the two-dimensional plane, and fitting the corresponding virtual continuous surface by using a quadtree search structure and based on the two-dimensional discrete grid distribution. Thus, it can be seen that by automatically traversing and detecting broken faces, manual intervention is significantly reduced, and broken faces can also be determined. By dynamically grouping broken faces through shared boundaries / vertices, repeated operations are avoided, the processing efficiency is improved, and only virtual edge merging and virtual face reconstruction are performed without changing the original geometric data, and the operation is completely reversible, avoiding geometric shape deformation or accuracy loss in traditional geometric repair.
[0095] Furthermore, the embodiment of the present application also discloses an electronic device Figure 9 is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure should not be considered as any limitation to the scope of use of the present application.
[0096] Figure 9 is a structural schematic diagram of an electronic device 20 provided by 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. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the CAD model broken face processing method disclosed in any of the foregoing 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 external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is made thereto here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made 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 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for the rendering and drawing of the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0099] In addition, as a carrier for resource storage, the memory 22 may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0100] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 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. It may be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of implementing the CAD model faceting processing method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of completing other specific tasks. The data 223 may include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.
[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 CAD model faceting processing method disclosed above is implemented. For the specific steps of this method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0102] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.
[0103] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application. The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, removable disks, CD-ROM (compact disc-read only memory), or any other form of storage medium known in the technical field.
[0104] Finally, it should also be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0105] The above has introduced the solution provided by the present invention in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for processing broken surfaces of a CAD model, characterized in that, Including: Import and repair the initial CAD model, establish a watertight mesh data structure including discrete surfaces and continuous surfaces to obtain a virtual surface; wherein, the grid points of the discrete surface correspond one-to-one with the continuous surface; Traverse and identify the current virtual surface that meets the preset broken surface determination condition as a broken surface to obtain a set of broken surfaces; wherein, the preset broken surface determination condition is that the minimum opposite side distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than the preset distance threshold; Re-group the set of broken surfaces according to the set division method of sharing the same boundary or vertex to obtain several groups of broken surfaces; Perform virtual edge merging, boundary topology relationship update, and discrete grid fusion processing on all broken surfaces in each group of broken surfaces to obtain the target virtual surface after broken surface merging; Perform two-dimensional mapping processing on the discrete grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on the two-dimensional plane, and use a quadtree search structure and fit the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution; The discrete grid fusion processing of the target virtual surface includes: Based on the preprocessed watertight mesh data structure, stitch the discrete grids of adjacent target virtual surfaces according to the discrete grid point correspondence relationship to generate the target discrete grid of the target virtual surface; The two-dimensional mapping processing of the discrete grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on the two-dimensional plane includes: Use the conformal mapping algorithm 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 the two-dimensional plane.
2. The CAD model faceting processing method according to claim 1, wherein, The traversing and identifying the current virtual surface that meets the preset broken surface determination condition as a broken surface to obtain a set of broken surfaces includes: Use the non-adjacent boundaries in each virtual surface to construct corresponding boundary pairs, and use the minimum opposite side distance of the boundary pairs in each virtual surface as the to-be-compared opposite side distance of the corresponding current virtual surface; Compare the size relationship between each to-be-compared opposite side distance and the preset distance threshold to obtain the corresponding comparison result; Set the current virtual surface corresponding to the to-be-compared opposite side distance whose comparison result is less than the preset distance threshold as a broken surface to obtain a set of broken surfaces.
3. The CAD model faceting processing method according to claim 2, wherein The using the non-adjacent boundaries in each virtual surface to construct corresponding boundary pairs, and using the minimum opposite side distance of the boundary pairs in each virtual surface as the to-be-compared opposite side distance of the corresponding current virtual surface includes: Take any boundary in the current virtual surface as the current boundary, and construct a corresponding boundary pair according to the current boundary and the target boundary that is not adjacent to the current boundary, and calculate the opposite side distance between the boundary pairs; Take any other boundary except the current boundary as the new current boundary, and jump to execute the step of constructing a corresponding boundary pair according to the current boundary and the target boundary that is not adjacent to the current boundary until the opposite side distances of all boundary pairs of the current virtual surface are obtained; Take the minimum opposite side distance among the opposite side distances as the to-be-compared opposite side distance of the current virtual surface.
4. The CAD model faceting processing method according to claim 1, wherein The performing virtual edge merging and boundary topology relationship update on all broken surfaces in each group of broken surfaces includes: Identify the common edges between the broken surfaces in the group of broken surfaces; Obtain the virtual edge associated with the start endpoint of the common edge as the first virtual edge to be merged, and perform a merging process on the first virtual edge to be merged to obtain a first target virtual edge; Obtain the virtual edge associated with the end endpoint of the common edge as the second virtual edge to be merged, and perform a merging process on 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, merge and update each fragmented surface to obtain several target virtual surfaces after the fragmented surfaces are merged; Update the topological relationship between each of the target virtual surfaces to obtain a target boundary topological relationship.
5. The CAD model faceting processing method according to claim 1, wherein The using of the quadtree search structure and the fitting of the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution includes: Use 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 an interpolation or approximation algorithm to obtain a local parametric surface; Through the hierarchical relationship of the quadtree search structure, seamlessly splice each of the local parametric surfaces to obtain a virtual continuous surface.
6. A CAD model faceted surface processing device, characterized in that, Include: A structure establishment module, configured to import and repair an initial CAD model, establish a watertight grid data structure including a discrete surface and a continuous surface to obtain a virtual surface; wherein, the grid points of the discrete surface correspond one-to-one with the continuous surface; A fragmented surface recognition module, configured to traverse and recognize the current virtual surface that meets the preset fragmented surface determination condition as a fragmented surface to obtain a fragmented surface set; wherein, the preset fragmented surface determination condition is that the minimum opposite side distance of the boundary pair constructed by the non-adjacent boundaries of the virtual surface is less than a preset distance threshold; A group division module, configured to re-group the fragmented surface set according to the set division method of sharing the same boundary or vertex to obtain several fragmented surface groups; A fragmented surface merging module, configured to perform virtual edge merging, boundary topological relationship updating, and discrete grid fusion processing on all the fragmented surfaces in each of the fragmented surface groups to obtain a target virtual surface after the fragmented surfaces are merged; A surface fitting module, configured to perform two-dimensional mapping processing on the discrete grid of the target virtual surface to obtain a two-dimensional discrete grid distribution on the two-dimensional plane, and use the quadtree search structure and fit the corresponding virtual continuous surface based on the two-dimensional discrete grid distribution; The fragmented surface merging module is specifically configured to stitch the discrete grids of adjacent target virtual surfaces according to the discrete grid point correspondence relationship based on the preprocessed watertight grid data structure to generate the target discrete grid of the target virtual surface; The surface fitting module is specifically configured to perform two-dimensional mapping processing on the target discrete grid of the target virtual surface by using a conformal mapping algorithm to obtain a two-dimensional discrete grid distribution on the two-dimensional plane.
7. An electronic device, characterized in that, Include: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the CAD model fragmented surface processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, For storing a computer program; wherein, when the computer program is executed by the processor, the steps of the CAD model fragmented surface processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method for optimizing broken surface of three-dimensional model of vane pump
CN119129128A
Cited By
Method, device and equipment for automatically identifying overlapping structure grid grouping information in helicopter simulation and medium
CN120429964A