CAD model curved surface interpenetration problem processing method and device, equipment and medium
By establishing a bounding box tree in the CAD model and performing intersecting line correction processing, the problems of low accuracy and low automation in complex surface intersection are solved, and efficient and automated surface interspersion processing is achieved to generate a high-fidelity watertight mesh.
Patent Information
- Application Number
- CN202510581481.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-05-07
AI Technical Summary
The existing surface intersecting algorithms have low accuracy, low computational efficiency when processing complex surfaces, and require manual intervention and low degree of automation, resulting in surface interspersion, resulting in grid fractures or gaps, and the inability to generate continuous watertight mesh.
By importing and repairing the initial CAD model, a watertight mesh data structure is established, and a bounding box tree is established using the discrete mesh of the composite surface, the intersection composite surface is determined, the intersection triangle is filtered, the intersection point information is calculated, the complete intersection line is constructed, and the continuous surface is projected for correction. Finally, the parameter domain mapping and smooth processing is carried out to generate the processed watertight mesh.
It realizes fully automated processing of surface interleaving problems of complex CAD models, reduces manual intervention and improves efficiency, solves common point problems and intersection line fracture problems caused by floating point error in traditional methods, and generates a high-fidelity and watertight mesh model.
Smart Images

Figure CN120105511A_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 the problem of interpenetration of curved surfaces in a CAD model. Background Art
[0002] Surface / Surface Intersection (SSI) algorithm is an important research topic in Computer Aided Geometric Design (CAGD). It is widely used in many fields, such as surface modeling, solid modeling, engineering machinery, etc. In the field of aerospace, surface intersection algorithm also has important application value. When designing the shape of an aircraft, we often encounter various complex surface intersection problems. For example, the connection between the wing and the fuselage, the connection between the engine nacelle and the wing, etc., all require accurate calculation of the intersection of the surfaces to ensure the rationality of the design and the optimization of aerodynamic performance. Through the surface intersection algorithm, the shape and size of these parts can be accurately determined, and at the same time, the accuracy and quality of the parts during the manufacturing and assembly process can be ensured, reducing the probability of failure.
[0003] Existing surface intersection algorithms (such as mesh methods and geometric methods) have low accuracy and low computational efficiency when processing complex surfaces. In addition, the use process relies on CAD (Computer Aided Design) repair software and requires manual intervention, with a low degree of automation. Surface interlacing causes mesh breaks or gaps, making it impossible to generate a continuous watertight mesh. When calculating intersections, common point errors are prone to occur, resulting in narrow triangles or topological errors.
[0004] In summary, how to achieve full automation and solve the problem of surface interpenetration in CAD models without human intervention is a technical problem to be solved in this field. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for processing the problem of surface interpenetration in a CAD model, which can achieve full automation and solve the problem of surface interpenetration in a CAD model without human intervention. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a method for processing the problem of interpenetration of CAD model surfaces, comprising:
[0007] Importing and repairing the initial CAD model, establishing a watertight grid data structure to obtain a composite surface including a continuous surface and a discrete surface, and establishing a bounding box tree using the discrete grid of the composite surface; wherein the root node of the bounding box tree is a parent bounding box including all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface;
[0008] Determine the target composite surface intersecting with each composite surface through the bounding box tree to obtain a composite surface pair having an intersecting relationship, and screen the intersecting triangles of the composite surface and calculate the intersection point information of the intersecting triangles;
[0009] Determine the intersection line segments according to the intersection point information and the triangle adjacency topological relationship, so as to construct a complete intersection line based on all the intersection line segments;
[0010] The complete intersection line is projected onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and the corrected complete intersection line and the current discrete grid are used to perform parameter domain mapping and smoothing to obtain a processed watertight grid.
[0011] Optionally, determining the target composite surface intersecting with each composite surface through the bounding box tree includes:
[0012] Determine a composite surface as the current composite surface according to the traversal order of the composite surfaces in the traversal order table, and search for a target bounding box that intersects with the bounding box where the current composite surface is located through the bounding box tree;
[0013] Recursively detecting the composite surface in the target bounding box and the current composite surface to screen and obtain a number of target composite surfaces intersecting with the current composite surface to construct an intersecting composite surface set;
[0014] Determine the next composite surface as the current composite surface according to the traversal order, and jump to execute the step of searching the target bounding box that intersects with the bounding box where the current composite surface is located through the bounding box tree until the intersecting composite surface set of all composite surfaces is obtained.
[0015] Optionally, screening the intersecting triangles on the composite surface and calculating the intersection information of the intersecting triangles includes:
[0016] For each of the composite surfaces, a corresponding OBB bounding box tree is established; wherein the tree node of the OBB bounding box tree is a parent bounding box containing all discrete grids on the composite surface, and the leaf node is a child bounding box of each discrete triangle;
[0017] The OBB bounding box tree is used to select discrete triangles that have an intersection relationship in each of the composite surfaces as intersection triangles;
[0018] The corresponding intersection points are calculated and generated by a single intersection strategy of the common edges of discrete triangles located inside the same composite surface facing the composite surface and the intersecting triangles in another composite surface facing the current composite surface, and all intersection points of all intersecting triangles are counted to obtain corresponding intersection point information.
[0019] Optionally, determining the intersection line segment according to the intersection point information and the triangle adjacency topological relationship includes:
[0020] According to the intersection information, an intersection is randomly selected as the starting point, and the next intersection is obtained as the target intersection according to the discrete triangle adjacency topological relationship where the starting point is located, and a corresponding intersection line segment is formed between the starting point and the target intersection, with the target intersection as the new starting point, and jumping to the step of obtaining the next intersection as the target intersection according to the discrete triangle adjacency topological relationship where the starting point is located, until all intersection line segments are obtained.
[0021] Optionally, constructing a complete intersection line based on all intersection line segments includes:
[0022] According to the number of times the intersection points at both ends of each intersection line segment are used, the intersection point used once is determined as the starting point of the intersection line, and other intersection line segments are connected starting from the intersection line segment where the starting point is located to obtain an intersection line group;
[0023] The intersection lines of the intersection line group are connected and grouped according to the association relationship of the intersection points to obtain a complete intersection line.
[0024] Optionally, projecting the complete intersection line onto a continuous surface of the current composite surface to obtain a corrected complete intersection line includes:
[0025] Projecting the complete intersection line onto the continuous surface of the current composite surface to obtain a projected intersection line;
[0026] The intersection points of the projected intersection lines are corrected using the entity geometric data of the continuous curved surface, and curve fitting is performed on the corrected intersection points to obtain the corrected complete intersection lines.
[0027] Optionally, the using the corrected complete intersection line and the current discrete grid to perform parameter domain mapping and smoothing processing to obtain a processed watertight grid includes:
[0028] Inserting each curve point of the corrected complete intersection line into the current discrete grid to obtain a target discrete grid after marking the intersection position of the corrected complete intersection line;
[0029] Mapping the target discrete grid to a preset two-dimensional parameter domain to obtain a two-dimensional discrete grid including the intersection position after mapping;
[0030] Reconstructing the two-dimensional boundary line using the mapped intersection line position in the two-dimensional discrete grid to obtain a two-dimensional discrete grid after restoring the boundary;
[0031] The two-dimensional discrete grid after restoring the boundary is inversely mapped to a three-dimensional space to obtain a processed watertight grid.
[0032] In a second aspect, the present application discloses a device for processing the interpenetration problem of a CAD model surface, comprising:
[0033] A bounding box tree construction module is used to import and repair the initial CAD model, establish a watertight grid data structure to obtain a composite surface including a continuous surface and a discrete surface, and establish a bounding box tree using the discrete grid of the composite surface; wherein the root node of the bounding box tree is a parent bounding box including all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface;
[0034] An intersecting surface screening module, used for determining a target composite surface intersecting with each of the composite surfaces through the bounding box tree, so as to obtain a pair of composite surfaces having an intersecting relationship;
[0035] An intersection information calculation module, used for screening the intersecting triangles of the composite surface and calculating the intersection information of the intersecting triangles;
[0036] An intersection line construction module, used to determine the intersection line segments according to the intersection point information and the triangle adjacency topological relationship, so as to construct a complete intersection line based on all the intersection line segments;
[0037] The inverse mapping module is used to project the complete intersection line onto the continuous surface of the current composite surface to obtain the corrected complete intersection line, and use the corrected complete intersection line and the current discrete grid to perform parameter domain mapping and smoothing to obtain the processed watertight grid.
[0038] In a third aspect, the present application discloses an electronic device, comprising:
[0039] Memory, used to store computer programs;
[0040] The processor is used to execute the computer program to implement the steps of the method for processing the surface interpenetration problem of the CAD model disclosed above.
[0041] 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 method for processing the surface interpenetration problem of a CAD model disclosed above are implemented.
[0042] It can be seen that the present application discloses a method for processing the problem of surface interlacing of a CAD model, including: importing and repairing the initial CAD model, establishing a watertight grid data structure to obtain a composite surface including a continuous surface and a discrete surface, and using the discrete grid of the composite surface to establish a bounding box tree; wherein the root node of the bounding box tree is a parent bounding box containing all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface; determining a target composite surface intersecting with each composite surface through the bounding box tree to obtain a composite surface pair having an intersecting relationship, and screening the intersecting triangles of the composite surface and calculating the intersection information of the intersecting triangles; determining the intersection line segment according to the intersection information and the triangle adjacency topological relationship to construct a complete intersection line based on all the intersection line segments; projecting the complete intersection line onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and using the corrected complete intersection line and the current discrete grid to perform parameter domain mapping and smoothing processing to obtain a processed watertight grid. It can be seen that by establishing a bounding box tree to reduce the amount of calculation for intersection detection and avoid global traversal of all composite surfaces, it is possible to achieve fully automatic processing of complex CAD model surface interlacing problems, reduce manual intervention, and improve efficiency. The intersection points are further projected onto continuous surfaces for correction, and smooth intersection lines are generated using a curve fitting algorithm to ensure the geometric accuracy and continuity of the intersection lines. This can solve the common point problem and intersection line break problem caused by floating point errors in traditional methods, generate a high-fidelity, watertight mesh model, and finally ensure the topological consistency of the intersection lines and discrete meshes through parameter domain mapping and constraints. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] 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.
[0044] Figure 1 A flow chart of a method for processing the problem of interpenetration of CAD model surfaces disclosed in this application;
[0045] Figure 2 A triangle schematic diagram for finding intersection points of a CAD model disclosed in this application;
[0046] Figure 3 A schematic diagram of an intersection line segment of a CAD model disclosed in this application;
[0047] Figure 4 A schematic diagram of the intersection of a CAD model disclosed in this application;
[0048] Figure 5It is a schematic diagram of the intersection line fitting of a CAD model disclosed in this application;
[0049] Figure 6 A schematic diagram of the structure of a device for processing the interpenetration problem of a CAD model surface disclosed in this application;
[0050] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0051] 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.
[0052] In CAD models, there is often a problem of different surfaces interlacing with each other. The existence of this problem will have a certain impact on the accuracy and usability of the model, and will cause the generated mesh model to produce a non-watertight mesh at the intersection of the surfaces. At present, this problem is mostly dealt with by special CAD repair software, and the repair process often requires a lot of manual intervention. The repair methods of these CAD repair software are mostly solved by surface intersection algorithms. At present, each surface intersection method has its scope of application and advantages and disadvantages, and none of them solves the problems of accuracy and speed. Further research is needed on the efficiency, stability and function of the algorithm.
[0053] Surface intersection algorithm is an important research topic in computer-aided geometric design. Its theory and application technology have made great progress in the past decade or so, and have been widely used in many fields, such as surface modeling, solid modeling, engineering machinery, etc. In the field of aerospace, surface intersection algorithm also has important application value. When designing the shape of an aircraft, we often encounter various complex surface intersection problems. For example, the connection between the wing and the fuselage, the connection between the engine nacelle and the wing, etc., all require accurate calculation of the intersection of the surfaces to ensure the rationality of the design and the optimization of aerodynamic performance. Through the surface intersection algorithm, the shape and size of these parts can be accurately determined, and at the same time, the accuracy and quality of the parts during the manufacturing and assembly process can be ensured, reducing the probability of failure.
[0054] So far, specific SSI algorithms can be divided into: geometric segmentation method, algebraic iteration method, tracking method, grid method, analytical method and triangulation method. The advantage of the geometric method is that the algorithm is based on geometric principles and properties for intersection calculation, has clear geometric meaning, is easy to understand and implement, and the disadvantage is that the algorithm will fail for complex surfaces. The advantage of the iterative method is that it has a wide range of applicability and can handle various types of surfaces, including complex surfaces, but the disadvantage is that the iterative process of the algorithm is affected by factors such as initial values and iteration steps, which may lead to slow convergence or iteration failure. The algorithm is relatively complex to implement and has low computational efficiency. The advantage of the tracking intersection method is that it can effectively obtain intersection lines for surface intersection problems with certain rules, and has high computational efficiency for simple surface shapes and relatively regular intersections, but the disadvantage is that the tracking process may become difficult for complex surfaces, multiple intersection points or complex intersection line topology structures. The advantage of the grid method is that it has a certain adaptability to surfaces of various complex shapes and can handle the discontinuity and irregularity of the surface. The disadvantage is that the grid accuracy will lead to reduced intersection accuracy, and when the grid volume is large, the calculation cost will increase sharply.
[0055] To this end, the present invention provides a solution for solving the problem of surface interpenetration in a CAD model, which can achieve full automation and solve the problem of surface interpenetration in the CAD model without human intervention.
[0056] Reference Figure 1 As shown, an embodiment of the present invention discloses a method for processing the problem of interpenetration of CAD model surfaces, comprising:
[0057] Step S11: Import and repair the initial CAD model, establish a watertight grid data structure to obtain a composite surface including continuous surfaces and discrete surfaces, and use the discrete grid of the composite surface to establish a bounding box tree; wherein the root node of the bounding box tree is a parent bounding box containing all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface.
[0058] In this embodiment, in the CAD model, there is often a problem of different surfaces interlacing with each other. Therefore, according to the model surface interlacing processing requirements, the initial CAD model with gaps generated by the part data import is repaired to obtain a target 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 model surface interlacing processing requirements is a conventional generation method, such as reverse engineering based on measurement data, forward design based on design parameters, and a hybrid design method combining the two, and no specific limitation is made to this. The model surface interlacing processing requirements can specifically be part surface interlacing processing requirements, where the parts can be mechanical parts in different fields, such as automobile body parts, aircraft shells, and other parts with complex surfaces, and no specific limitation is made to this. For example, when the model surface interlacing processing requirement is the surface interlacing processing requirement of the aircraft wing-fuselage connection, all wing parameters (airfoil data, plane shape, wing-fuselage connection method), fuselage parameters (cross-sectional shape, connection area matching requirements), and connection feature parameters of the aircraft wing-fuselage connection are imported to generate the corresponding initial CAD model. The initial CAD model of the aircraft wing-fuselage connection is repaired to obtain the target CAD model of the aircraft wing-fuselage connection without surface gaps.
[0059] Further, the target CAD model is meshed and generated to obtain a composite surface including discrete surfaces and continuous surfaces. It is understandable that after the initial CAD model is gap-patched by the gap-patching method, the target CAD model is obtained, and the watertight grid data structure of the target 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 target CAD model data structure. In the target CAD model processing, 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 target 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 target CAD model is established by the watertight grid generation framework, each composite surface obtained includes 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. The continuous surface is the surface part that maintains the original continuous characteristics, which reflects the overall shape and geometric characteristics of the surface. Discrete surfaces and continuous surfaces cooperate with each other. Discrete surfaces provide a quantifiable basis for specific operations, and continuous surfaces ensure the overall geometric properties of the surface, together forming a composite surface. For example: for the target CAD model of the aircraft wing-fuselage connection, its composite surface includes discrete surfaces and continuous surfaces, among which the continuous surface is: the theoretical shape of the wing (airfoil curve, torsion surface), and the transition surface of the fuselage docking section. Discrete surfaces are the discretization of continuous surfaces (such as the surface mesh required for CFD / structural analysis) and the supplementary mesh of the repaired gap area (such as the filling mesh at the wing-fuselage connection).
[0060] In this embodiment, a hierarchical bounding box tree is constructed using discrete grids on the composite surface in the target CAD model, wherein the root node of the bounding box tree is a large bounding box containing all composite surface objects. Starting from the root node, the large bounding box is continuously divided using a plane perpendicular to the coordinate axis until each small space contains only one sub-bounding box of the composite surface, i.e., a leaf node is obtained. In this way, a hierarchical bounding box tree is established based on discrete grids, and the intersection detection of composite surfaces is accelerated through space division.
[0061] Step S12: determining the target composite surface intersecting with each composite surface through the bounding box tree to obtain composite surfaces with which there is an intersection relationship, screening the intersecting triangles of the composite surfaces and calculating the intersection information of the intersecting triangles.
[0062] In this embodiment, a composite surface is determined as the current composite surface according to the traversal order of each composite surface in the traversal order table, and a target bounding box intersecting with the bounding box where the current composite surface is located is searched through the bounding box tree; the composite surface in the target bounding box and the current composite surface are recursively detected to screen and obtain a number of target composite surfaces intersecting with the current composite surface, so as to construct an intersecting composite surface set; the next composite surface is determined as the current composite surface according to the traversal order, and the step of searching for a target bounding box intersecting with the bounding box where the current composite surface is located through the bounding box tree is jumped to execute, until the intersecting composite surface set of all composite surfaces is obtained. It can be understood that each composite surface in the current target CAD model is traversed, and a set of virtual surfaces intersecting with each composite surface is searched in the bounding box tree. Specifically, for composite surfaces having For the composite surface model, we will get Set of intersecting composite surfaces ,in It is with The current composite surface All target composite surfaces that intersect. In this way, the bounding box tree is used to initially search for target bounding boxes that have an intersecting relationship with each composite surface, and the range of target bounding boxes that may conflict with the current composite surface can be determined in the form of bounding boxes. Then, recursive detection of target composite surfaces is further performed within the range to screen out target composite surfaces that have an intersecting relationship with the current composite surface, and obtain a set of intersecting composite surfaces, which further screens the range of composite surfaces that may have surface interpenetration problems. By repeatedly narrowing the range of composite surfaces that may have surface interpenetration problems, each subsequent step in the processing of surface interpenetration problems is facilitated.
[0063] In this embodiment, a corresponding composite surface pair is constructed based on the current composite surface and each target composite surface in the intersecting composite surface set, so that a plurality of composite surface pairs are formed.
[0064] In this embodiment, a corresponding OBB (Oriented Bounding Box) bounding box tree is established for each of the composite surfaces; wherein the tree nodes of the OBB bounding box tree are parent bounding boxes containing all discrete meshes on the composite surface, and the leaf nodes are child bounding boxes of each discrete triangle; the discrete triangles that have an intersecting relationship in each of the composite surfaces are screened through the OBB bounding box tree as intersecting triangles; the corresponding intersection points are calculated and generated through a single intersection strategy of the common edges of the discrete triangles located inside the same composite surface in the composite surface and the intersecting triangles in another composite surface of the current composite surface, and all the intersection points of all the intersecting triangles are counted to obtain the corresponding intersection point information. It can be understood that based on the current composite surface The obb bounding box tree on the current composite surface is established. Specifically, assuming that the current composite surface There exists a discrete grid on discrete triangles, the generated obb bounding box tree contains The obb bounding box tree is further filtered according to the aforementioned bounding box tree filtering process to obtain the set of intersecting triangles between two composite surfaces in the composite surface, and then the intersection points between the intersecting triangles are calculated.
[0065] Specifically, due to the existence of computer floating point problems, the problem of common intersections will inevitably occur in the process of calculating triangle intersections. In order to avoid this problem, only the common edges of a discrete triangle will be used to calculate the intersection with another triangle (another intersecting triangle in a composite surface), ensuring that each edge only calculates the intersection with the same triangle once, thereby avoiding the situation of common intersections. Specifically, Figure 2 As shown, triangle efd and triangle gfd share edge fd, and triangle efd and triangle gfd are located on the same composite surface. If the intersection is calculated using triangle efd and triangle abc, and the intersection is calculated using triangle gfd and triangle abc, then the two intersections are co-points. At this time, if the method is changed to calculate the intersection of the edge and the triangle, and the intersection is obtained by using edge fd and triangle abc, then the intersection is unique and shared by triangle efd and triangle gfd.
[0066] In this embodiment, an intersection is randomly selected as the starting point based on the intersection information, the next intersection is obtained as the target intersection based on the discrete triangle adjacency topological relationship where the starting point is located, and a corresponding intersection line segment is formed between the starting point and the target intersection, the target intersection is used as the new starting point, and the process jumps to the step of obtaining the next intersection as the target intersection based on the discrete triangle adjacency topological relationship where the starting point is located, until all intersection line segments are obtained. It can be understood that since the virtual face patches in the CAD model are all open surfaces, the intersection line formed between the two surfaces must be a non-closed intersection line. The specific operations for tracing the intersection line are as follows: arbitrarily select an intersection point As the starting point, get the next adjacent intersection point through the adjacency topological relationship of the current triangle , forming an intersection line segment between two points . Then from First, obtain the next adjacent intersection point through the adjacency topological relationship of the current triangle and construct an intersection line segment. Repeat this step until all intersection line segments are obtained. , and then record the number of times each intersection point is used.
[0067] Step S13: determining the intersection line segments according to the intersection point information and the triangle adjacency topological relationship, so as to construct a complete intersection line based on all the intersection line segments.
[0068] In this embodiment, according to the number of times the intersection points at both ends of each intersection line segment are used, the intersection point used once is determined as the starting point of the intersection line, and other intersection line segments are connected starting from the intersection line segment where the starting point is located to obtain an intersection line group; according to the correlation relationship of the intersection points, the intersection lines of the intersection line group are connected and grouped to obtain a complete intersection line. It can be understood that the intersection point used once is selected as the starting point, and all the intersection line segments are connected to form a group of intersection lines. .like Figure 3 As shown, the intersection line segment Form an intersection line , intersection line segment Form an intersection line Since a set of intersection lines can be obtained between each pair of surfaces (composite surfaces) through the above process, after traversing all the composite surfaces, for a current composite surface , you can get all the intersection lines on it Then, these intersection lines are further connected and grouped according to the association relationship of the points to obtain the connected intersection lines. Figure 4 As shown, the dotted lines are another set of intersection lines, and the solid lines are a set of intersection lines. After connecting the endpoints, the final intersection lines are Intersection .
[0069] Step S14: projecting the complete intersection line onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and performing parameter domain mapping and smoothing processing using the corrected complete intersection line and the current discrete grid to obtain a processed watertight grid.
[0070] In this embodiment, the complete intersection line is projected onto the continuous surface of the current composite surface to obtain the projected intersection line; each intersection point of the projected intersection line is corrected using the solid geometry data of the continuous surface, and each corrected intersection point is curve fitted to obtain the corrected complete intersection line. It can be understood that since the complete intersection line after the intersection is composed of a series of segmented line segments, there will be Figure 4 The intersection line is not smooth as shown. Therefore, a curve fitting algorithm is used to perform a second fitting on the intersection line to obtain a smoother intersection line. Figure 5As shown, the specific operation is to first project each intersection point on the complete intersection line onto a continuous surface with the current composite surface, and use the associated actual digital surface (continuous surface) to perform precision correction on the intersection points. Then, using the corrected intersection points, a curve fitting algorithm is used to fit a high-order continuous curve, such as the least squares fitting method, spline interpolation fitting, polynomial fitting, etc., without specific limitation.
[0071] In this embodiment, each curve point of the corrected complete intersection is inserted into the current discrete grid to obtain a target discrete grid after marking the intersection position of the corrected complete intersection; the target discrete grid is mapped to a preset two-dimensional parameter domain to obtain a two-dimensional discrete grid containing the mapped intersection position; the two-dimensional boundary line is reconstructed using the mapped intersection position in the two-dimensional discrete grid to obtain a two-dimensional discrete grid after the boundary is restored; the two-dimensional discrete grid after the boundary is restored is inversely mapped to a three-dimensional space to obtain a processed watertight grid. It can be understood that the smoothed curve points are inserted as feature points into the current discrete grid before the intersection of the current composite surface, and the feature line segments formed by the feature points are restored. The specific steps are: mapping the target discrete grid to a two-dimensional parameter domain, then performing two-dimensional boundary restoration in the two-dimensional parameter domain, and finally inversely mapping the restored two-dimensional discrete grid to a three-dimensional region to obtain a grid constrained by feature lines, and performing edge segmentation, edge collapse, edge exchange, and point movement operations on the grid constrained by feature lines, so as to achieve a local smoothing effect on the initial grid and obtain a processed watertight grid. In this way, the preset surface clipping algorithm is used to clip the surface constructed by the current processed watertight grid according to the feature lines. The feature lines used for clipping are the intersection lines on the current surface. After the surface clipping operation, the topological relationship between the divided composite surfaces is also updated, and the part where the two composite surfaces intersect must be watertight.
[0072] It can be seen that the present application discloses a method for processing the problem of surface interlacing of a CAD model, including: importing and repairing the initial CAD model, establishing a watertight grid data structure to obtain a composite surface including a continuous surface and a discrete surface, and using the discrete grid of the composite surface to establish a bounding box tree; wherein the root node of the bounding box tree is a parent bounding box containing all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface; determining a target composite surface intersecting with each composite surface through the bounding box tree to obtain a composite surface pair having an intersecting relationship, and screening the intersecting triangles of the composite surface and calculating the intersection information of the intersecting triangles; determining the intersection line segment according to the intersection information and the triangle adjacency topological relationship to construct a complete intersection line based on all the intersection line segments; projecting the complete intersection line onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and using the corrected complete intersection line and the current discrete grid to perform parameter domain mapping and smoothing processing to obtain a processed watertight grid. It can be seen that by establishing a bounding box tree to reduce the amount of calculation for intersection detection and avoid global traversal of all composite surfaces, it is possible to achieve fully automatic processing of complex CAD model surface interlacing problems, reduce manual intervention, and improve efficiency. The intersection points are further projected onto continuous surfaces for correction, and smooth intersection lines are generated using a curve fitting algorithm to ensure the geometric accuracy and continuity of the intersection lines. This can solve the common point problem and intersection line break problem caused by floating point errors in traditional methods, generate a high-fidelity, watertight mesh model, and finally ensure the topological consistency of the intersection lines and discrete meshes through parameter domain mapping and constraints.
[0073] Reference Figure 6 As shown, the present invention also discloses a processing device for the problem of interlacing of CAD model surfaces, comprising:
[0074] The bounding box tree construction module 11 is used to import and repair the initial CAD model, establish a watertight grid data structure to obtain a composite surface including a continuous surface and a discrete surface, and establish a bounding box tree using the discrete grid of the composite surface; wherein the root node of the bounding box tree is a parent bounding box including all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface;
[0075] An intersecting surface screening module 12 is used to determine a target composite surface intersecting with each of the composite surfaces through the bounding box tree to obtain a pair of composite surfaces having an intersecting relationship;
[0076] An intersection information calculation module 13, used for screening the intersecting triangles of the composite surface and calculating the intersection information of the intersecting triangles;
[0077] An intersection line construction module 14 is used to determine the intersection line segments according to the intersection point information and the triangle adjacency topological relationship, so as to construct a complete intersection line based on all the intersection line segments;
[0078] The inverse mapping module 15 is used to project the complete intersection line onto the continuous surface of the current composite surface to obtain the corrected complete intersection line, and use the corrected complete intersection line and the current discrete grid to perform parameter domain mapping and smoothing to obtain a processed watertight grid.
[0079] 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 composite surface including a continuous surface and a discrete surface, and using the discrete grid of the composite surface to establish a bounding box tree; wherein the root node of the bounding box tree is a parent bounding box containing all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface; the target composite surface intersecting with each composite surface is determined through the bounding box tree to obtain a composite surface pair having an intersection relationship, and the intersecting triangles of the composite surface are screened and the intersection information of the intersecting triangles is calculated; the intersection line segment is determined according to the intersection information and the triangle adjacency topological relationship to construct a complete intersection line based on all the intersection line segments; the complete intersection line is projected onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and the corrected complete intersection line and the current discrete grid are used to perform parameter domain mapping and smoothing to obtain a processed watertight grid. It can be seen that by establishing a bounding box tree to reduce the amount of calculation for intersection detection and avoid global traversal of all composite surfaces, it is possible to achieve fully automatic processing of complex CAD model surface interlacing problems, reduce manual intervention, and improve efficiency. The intersection points are further projected onto continuous surfaces for correction, and smooth intersection lines are generated using a curve fitting algorithm to ensure the geometric accuracy and continuity of the intersection lines. This can solve the common point problem and intersection line break problem caused by floating point errors in traditional methods, generate a high-fidelity, watertight mesh model, and finally ensure the topological consistency of the intersection lines and discrete meshes through parameter domain mapping and constraints.
[0080] Furthermore, the present application also discloses an electronic device. Figure 7 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.
[0081] Figure 7 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 method for processing the CAD model surface interlacing problem disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0082] 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.
[0083] 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.
[0084] 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.
[0085] Among them, 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, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the processing method of the CAD model surface interlacing problem performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can also 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, etc.
[0086] 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 aforementioned method for processing the surface interpenetration problem of a CAD model is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiment, and will not be repeated here.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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 the problem of interpenetration of CAD model surfaces, characterized in that: include: Importing and repairing the initial CAD model, establishing a watertight grid data structure to obtain a composite surface including a continuous surface and a discrete surface, and establishing a bounding box tree using the discrete grid of the composite surface; wherein the root node of the bounding box tree is a parent bounding box including all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface; Determine the target composite surface intersecting with each composite surface through the bounding box tree to obtain a composite surface pair having an intersecting relationship, and screen the intersecting triangles of the composite surface and calculate the intersection point information of the intersecting triangles; Determine the intersection line segments according to the intersection point information and the triangle adjacency topological relationship, so as to construct a complete intersection line based on all the intersection line segments; The complete intersection line is projected onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and the corrected complete intersection line and the current discrete grid are used to perform parameter domain mapping and smoothing to obtain a processed watertight grid.
2. The method for processing the CAD model surface interlacing problem according to claim 1, characterized in that: The step of determining a target composite surface intersecting with each composite surface through the bounding box tree includes: Determine a composite surface as the current composite surface according to the traversal order of the composite surfaces in the traversal order table, and search for a target bounding box that intersects with the bounding box where the current composite surface is located through the bounding box tree; Recursively detecting the composite surface in the target bounding box and the current composite surface to screen and obtain a number of target composite surfaces intersecting with the current composite surface to construct an intersecting composite surface set; Determine the next composite surface as the current composite surface according to the traversal order, and jump to execute the step of searching the target bounding box that intersects with the bounding box where the current composite surface is located through the bounding box tree until the intersecting composite surface set of all composite surfaces is obtained.
3. The method for processing the surface interpenetration problem of a CAD model according to claim 1, characterized in that: The step of screening the intersecting triangles on the composite surface and calculating the intersection information of the intersecting triangles includes: For each of the composite surfaces, a corresponding OBB bounding box tree is established; wherein the tree node of the OBB bounding box tree is a parent bounding box containing all discrete grids on the composite surface, and the leaf node is a child bounding box of each discrete triangle; The discrete triangles having an intersecting relationship among the composite surfaces are selected as intersecting triangles through the OBB bounding box tree; The corresponding intersection points are calculated and generated by a single intersection strategy of the common edges of discrete triangles located inside the same composite surface facing the composite surface and the intersecting triangles in another composite surface facing the current composite surface, and all intersection points of all intersecting triangles are counted to obtain corresponding intersection point information.
4. The method for processing the CAD model surface interlacing problem according to claim 3 is characterized in that: The determining of the intersection line segment according to the intersection point information and the triangle adjacency topological relationship includes: According to the intersection information, an intersection is randomly selected as the starting point, and the next intersection is obtained as the target intersection according to the discrete triangle adjacency topological relationship where the starting point is located, and a corresponding intersection line segment is formed between the starting point and the target intersection, with the target intersection as the new starting point, and jumping to the step of obtaining the next intersection as the target intersection according to the discrete triangle adjacency topological relationship where the starting point is located, until all intersection line segments are obtained.
5. The method for processing the interpenetration problem of CAD model surfaces according to claim 3, characterized in that: The step of constructing a complete intersection line based on all the intersection line segments includes: According to the number of times the intersection points at both ends of each intersection line segment are used, the intersection point used once is determined as the starting point of the intersection line, and other intersection line segments are connected starting from the intersection line segment where the starting point is located to obtain an intersection line group; The intersection lines of the intersection line group are connected and grouped according to the association relationship of the intersection points to obtain a complete intersection line.
6. The method for processing the interpenetration problem of CAD model surfaces according to claim 1, characterized in that: The projecting the complete intersection line onto the continuous surface of the current composite surface to obtain a corrected complete intersection line includes: Projecting the complete intersection line onto the continuous surface of the current composite surface to obtain a projected intersection line; The intersection points of the projected intersection lines are corrected using the entity geometric data of the continuous curved surface, and curve fitting is performed on the corrected intersection points to obtain the corrected complete intersection lines.
7. The method for processing the interpenetration problem of CAD model surfaces according to claim 1, characterized in that: The method of using the corrected complete intersection line and the current discrete grid to perform parameter domain mapping and smoothing processing to obtain a processed watertight grid includes: Inserting each curve point of the corrected complete intersection line into the current discrete grid to obtain a target discrete grid after marking the intersection position of the corrected complete intersection line; Mapping the target discrete grid to a preset two-dimensional parameter domain to obtain a two-dimensional discrete grid including the intersection position after mapping; Reconstructing the two-dimensional boundary line using the mapped intersection line position in the two-dimensional discrete grid to obtain a two-dimensional discrete grid after restoring the boundary; The two-dimensional discrete grid after restoring the boundary is inversely mapped to a three-dimensional space to obtain a processed watertight grid.
8. A device for processing the interpenetration problem of CAD model surfaces, characterized in that: include: A bounding box tree construction module is used to import and repair the initial CAD model, establish a watertight grid data structure to obtain a composite surface including a continuous surface and a discrete surface, and establish a bounding box tree using the discrete grid of the composite surface; wherein the root node of the bounding box tree is a parent bounding box including all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface; An intersecting surface screening module, used for determining a target composite surface intersecting with each of the composite surfaces through the bounding box tree, so as to obtain a pair of composite surfaces having an intersecting relationship; An intersection information calculation module, used for screening the intersecting triangles of the composite surface and calculating the intersection information of the intersecting triangles; An intersection line construction module, used to determine the intersection line segments according to the intersection point information and the triangle adjacency topological relationship, so as to construct a complete intersection line based on all the intersection line segments; The inverse mapping module is used to project the complete intersection line onto the continuous surface of the current composite surface to obtain the corrected complete intersection line, and use the corrected complete intersection line and the current discrete grid to perform parameter domain mapping and smoothing to obtain the processed watertight grid.
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 method for processing the surface interpenetration problem of a CAD model 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 method for processing the surface interpenetration problem of a CAD model as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Curved surface triangular mesh generation method
CN116778112A
Free-form surface slicing method and device based on implicit model
CN117002010A
Automobile modeling design method and device
CN117010093A
Grid reconstruction method and device, electronic equipment and storage medium
CN119494936A
Fabrication of moiré on curved surfaces
US20220355609A1
Cited By
Mesh model and entity model fusion method, computer equipment and storage medium
CN120562158A