A method, device, equipment and medium for handling the problem of surface intersection in a CAD model
By establishing a bounding box tree to filter the intersection triangle and calculate the intersection point information, constructing a complete intersection line and performing smooth processing, the problems of low accuracy and low efficiency of complex surface intersection algorithms in the existing technology are solved, and fully automated watertight mesh generation is achieved.
Patent Information
- Application Number
- CN202510581481.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-05-07
AI Technical Summary
The existing surface intersection algorithms have low accuracy, low calculation efficiency and require manual intervention when processing complex surfaces, resulting in grid fractures or gaps, making it impossible to generate continuous watertight mesh, and common point errors are likely to occur when calculating intersection points.
By creating a bounding box tree, filtering the intersection triangles and calculating the intersection point information, building a complete intersection line, and projecting the intersection line onto a continuous surface for smooth processing, a watertight mesh is generated.
It realizes fully automatic processing of surface interleaving problems of complex CAD models, reduces manual intervention, improves efficiency, and generates a high-fidelity and water-tight mesh model, solving the common point problems and intersecting line fracture problems caused by floating point error in traditional methods, ensuring the geometric accuracy and continuity of intersecting lines.
Smart Images

Figure CN120105511B_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 the surface intersection problem of a CAD model. Background Art
[0002] The surface / surface intersection (SSI) algorithm is an important research topic in computer-aided geometric design (CAGD), and has been widely applied in multiple fields, such as surface modeling, solid modeling, engineering machinery and other fields. In the aerospace field, the surface intersection algorithm also has important application value. When designing the shape of an aircraft, various complex surface intersection problems are often encountered. For example, at the connection between the wing and the fuselage, the joint between the engine nacelle and the wing, etc., it is necessary to accurately calculate the surface intersection to ensure the rationality of the design and the optimization of the 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 processes can be ensured, reducing the probability of failures.
[0003] Existing surface intersection algorithms (such as the mesh method and the geometric method) have low accuracy and low computational efficiency when dealing with complex surfaces, and the use process depends on CAD (Computer Aided Design) repair software and requires manual intervention, with low automation. Surface intersections cause mesh breaks or gaps, and continuous watertight meshes cannot be generated. When calculating intersection points, copoint errors are prone to occur, resulting in narrow triangles or topological errors.
[0004] In summary, how to achieve full automation and solve the surface intersection problem existing in the CAD model 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 surface intersection problem of a CAD model, which can achieve full automation and solve the surface intersection problem existing in the CAD model without human intervention. The specific solutions are as follows:
[0006] In the first aspect, the present application discloses a method for processing the surface intersection problem of a CAD model, including:
[0007] Import and repair the initial CAD model, establish a watertight mesh data structure to obtain a composite surface containing continuous and discrete surfaces, and build an axis-aligned bounding box tree using the discrete mesh of the composite surface; wherein, the root node of the axis-aligned bounding box tree is the parent bounding box containing all composite surfaces, and the leaf nodes are the child bounding boxes of each composite surface;
[0008] Determine the target composite surfaces intersecting with each composite surface through the axis-aligned bounding box tree to obtain pairs of composite surfaces with an intersection relationship, and screen the intersecting triangles of the pairs of composite surfaces and calculate the intersection point information of the intersecting triangles;
[0009] Determine the intersection line segments based on the intersection point information and the triangle adjacency topological relationship, and construct a complete intersection line based on all the intersection line segments;
[0010] Project the complete intersection line onto the continuous surface of the current composite surface to obtain the corrected complete intersection line, and perform parameter domain mapping and smoothing processing using the corrected complete intersection line and the current discrete mesh to obtain the processed watertight mesh.
[0011] Optionally, the determining the target composite surfaces intersecting with each composite surface through the axis-aligned bounding box tree includes:
[0012] Determine a composite surface as the current composite surface according to the traversal order of each composite surface in the traversal order list, and search for the target bounding box having an intersection relationship with the bounding box where the current composite surface is located through the axis-aligned bounding box tree;
[0013] Recursively detect the composite surfaces in the target bounding box and the current composite surface to screen and obtain several target composite surfaces intersecting with the current composite surface, and construct a set of intersecting composite surfaces;
[0014] Determine the next composite surface as the current composite surface according to the traversal order, and jump to execute the step of searching for the target bounding box having an intersection relationship with the bounding box where the current composite surface is located through the axis-aligned bounding box tree until the set of intersecting composite surfaces of all composite surfaces is obtained.
[0015] Optionally, the screening the intersecting triangles of the pairs of composite surfaces and calculating the intersection point information of the intersecting triangles includes:
[0016] Establish a corresponding oriented bounding box (OBB) tree for each pair of composite surfaces; wherein, the tree nodes of the OBB tree are the parent bounding boxes containing all the discrete meshes on the composite surface, and the leaf nodes are the child bounding boxes of each discrete triangle;
[0017] Screen the discrete triangles having an intersection relationship in each pair of composite surfaces through the OBB tree as the intersecting triangles;
[0018] Calculate and generate corresponding intersection points through the single intersection strategy of the common edge of discrete triangles within the same composite surface in the composite surface pair and the intersecting triangles in the other composite surface of the current composite surface pair, and count all the intersection points of all intersecting triangles to obtain the corresponding intersection point information.
[0019] Optionally, the determining the intersection line segment according to the intersection point information and the triangle adjacency topology relationship includes:
[0020] Randomly select an intersection point as the starting point according to the intersection point information, obtain the next intersection point as the target intersection point according to the discrete triangle adjacency topology relationship where the starting point is located, and form a corresponding intersection line segment between the starting point and the target intersection point. Take the target intersection point as the new starting point, and jump to the step of obtaining the next intersection point as the target intersection point according to the discrete triangle adjacency topology relationship where the starting point is located until all intersection line segments are obtained.
[0021] Optionally, the constructing the complete intersection line based on all intersection line segments includes:
[0022] Determine the intersection points with a usage count of one as the starting points of the intersection line according to the usage counts of the two end intersection points of each intersection line segment, and start connecting other intersection line segments from the intersection line segment where the starting point is located to obtain a set of intersection lines;
[0023] Connect and group the intersection lines in the set of intersection lines according to the association relationship of the intersection points to obtain the complete intersection line.
[0024] Optionally, the projecting the complete intersection line onto the continuous surface of the current composite surface to obtain the corrected complete intersection line includes:
[0025] Project the complete intersection line onto the continuous surface of the current composite surface to obtain the projected intersection line;
[0026] Perform correction processing on each intersection point of the projected intersection line through the solid geometry data of the continuous surface, and perform curve fitting on each corrected intersection point to obtain the corrected complete intersection line.
[0027] Optionally, the using the corrected complete intersection line and the current discrete grid for parameter domain mapping and smoothing processing to obtain the processed watertight grid includes:
[0028] Insert the curve points of the corrected complete intersection line into the current discrete grid to obtain the target discrete grid marked with the intersection line position of the corrected complete intersection line;
[0029] Map the target discrete grid to a preset two-dimensional parameter domain to obtain a two-dimensional discrete grid including the mapped intersection line position;
[0030] Reconstruct a two-dimensional boundary line using the position of the mapped intersection line in the two-dimensional discrete grid to obtain a two-dimensional discrete grid with the boundary restored;
[0031] Inverse-map the two-dimensional discrete grid with the boundary restored to the three-dimensional space to obtain a processed watertight grid.
[0032] In a second aspect, the present application discloses a device for handling the problem of surface intersections in a CAD model, including:
[0033] An bounding box tree construction module, configured to import and repair an initial CAD model, establish a watertight grid data structure to obtain a composite surface including continuous surfaces and discrete surfaces, 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 containing all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface;
[0034] An intersecting surface screening module, configured to determine target composite surfaces intersecting with each of the composite surfaces through the bounding box tree to obtain pairs of composite surfaces with an intersecting relationship;
[0035] An intersection point information calculation module, configured to screen the intersecting triangles of the pairs of composite surfaces and calculate the intersection point information of the intersecting triangles;
[0036] An intersection line construction module, configured to determine intersection line segments according to the intersection point information and the triangle adjacency topological relationship, and construct a complete intersection line based on all the intersection line segments;
[0037] An inverse mapping module, configured to project the complete intersection line onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and perform parametric domain mapping and smoothing processing using the corrected complete intersection line and the current discrete grid to obtain a processed watertight grid.
[0038] In a third aspect, the present application discloses an electronic device, including:
[0039] A memory, configured to store a computer program;
[0040] A processor, configured to execute the computer program to implement the steps of the method for handling the problem of surface intersections in a CAD model disclosed above.
[0041] 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 method for handling the problem of surface intersections in a CAD model disclosed above are implemented.
[0042] It can be seen that the present application discloses a method for handling the problem of surface intersection in a CAD model, including: importing and repairing an initial CAD model, establishing a watertight mesh data structure to obtain a composite surface including continuous surfaces and discrete surfaces, and establishing an bounding box tree using the discrete mesh of the composite surface; 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 target composite surfaces intersecting with each composite surface through the bounding box tree to obtain pairs of composite surfaces with an intersection relationship, screening the intersecting triangles of the pairs of composite surfaces and calculating the intersection point information of the intersecting triangles; determining intersection line segments based on the intersection point information and the triangle adjacency topological relationship to construct a complete intersection line based on all 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 performing parameter domain mapping and smoothing processing using the corrected complete intersection line and the current discrete mesh to obtain a processed watertight mesh. Thus, by establishing a bounding box tree, the computational amount of intersection detection is reduced, global traversal of all composite surfaces is avoided, and automatic processing of the surface intersection problem of complex CAD models can be realized, reducing manual intervention and improving efficiency. Further, by projecting the intersection points onto the continuous surface for correction and using a curve fitting algorithm to generate a smooth intersection line, the geometric accuracy and continuity of the intersection line are ensured, and the problems of co-points and intersection line breakage caused by floating-point errors in traditional methods can be solved, generating a high-fidelity and watertight mesh model. Finally, through parameter domain mapping and constraints, the topological consistency between the intersection line and the discrete mesh is ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order 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 for use 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 also be obtained based on the provided drawings.
[0044] Figure 1 It is a flowchart of a method for handling the problem of surface intersection in a CAD model disclosed in the present application;
[0045] Figure 2 It is a schematic diagram of a triangle for finding intersection points in a CAD model disclosed in the present application;
[0046] Figure 3 It is a schematic diagram of an intersection line segment in a CAD model disclosed in the present application;
[0047] Figure 4 It is a schematic diagram of an intersection line in a CAD model disclosed in the present application;
[0048] Figure 5Schematic diagram after intersection line fitting of a CAD model disclosed in this application;
[0049] Figure 6 Schematic diagram of the structure of a processing device for the problem of surface intersection in a CAD model disclosed in this application;
[0050] Figure 7 Schematic diagram of the structure of an electronic device disclosed in this application. Detailed implementation manners
[0051] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying 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 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 shall fall within the protection scope of the present invention.
[0052] In a CAD model, there are often problems of intersection between different surfaces. The existence of such problems will have a certain impact on the accuracy and usability of the model, and will cause the generated mesh model to have non-watertight meshes at the surface intersections. Currently, most of the processing of such problems is carried out through specialized CAD repair software, and the repair process often requires a lot of manual intervention. Most of the repair methods of these CAD repair software are solved through surface intersection algorithms. At present, each surface intersection method has its applicable scope, advantages and disadvantages, and has not solved the problems of accuracy and speed well. Further research is needed on the efficiency, stability and functions of the algorithms.
[0053] The surface intersection algorithm is an important research topic in computer-aided geometric design. Its theory and application technologies have made great progress in the past ten years and are widely used in multiple fields, such as surface modeling, solid modeling, engineering machinery and other fields. In the aerospace field, the surface intersection algorithm also has important application value. When designing the shape of an aircraft, various complex surface intersection problems are often encountered. For example, at the connection between the wing and the fuselage, the joint between the engine nacelle and the wing, etc., it is necessary to accurately calculate the surface intersection situation to ensure the rationality of the design and the optimization of the 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 processes can be ensured, and the probability of failures can be reduced.
[0054] So far, specific SSI algorithms can be divided into: geometric segmentation method, algebraic iteration method, tracking method, meshing method, analytical method, and triangulation method. The advantage of the geometric method is that the algorithm performs intersection calculations based on geometric principles and properties, has a clear geometric meaning, and is easy to understand and implement. The disadvantage is that the algorithm will fail for complex surfaces. The advantage of the iteration method is its wide applicability, capable of handling various types of surfaces, including complex surfaces. However, the disadvantage is that the iteration process of the algorithm is affected by factors such as the initial value and iteration step size, which may lead to problems such as slow convergence speed or iteration failure. The algorithm implementation is relatively complex, and the computational efficiency is low. The advantage of the tracking intersection method is that for surface intersection problems with certain rules, it can effectively obtain the intersection curve. For simple surface shapes and relatively regular intersection situations, the computational efficiency is relatively high. However, the disadvantage is that for complex surfaces, situations with multiple intersection points or complex intersection curve topologies, the tracking process may become difficult. The advantage of the meshing method is that it has a certain adaptability to various complex-shaped surfaces and can handle surface discontinuities and irregularities. The disadvantage is that the mesh accuracy will lead to a reduction in the accuracy of the intersection curve, and when the amount of mesh is large, the computational cost will increase sharply.
[0055] Therefore, the present invention provides a solution for handling the problem of surface intersection in CAD models, which can achieve full automation and solve the problem of surface intersection in CAD models without human intervention.
[0056] Refer to Figure 1 As shown, an embodiment of the present invention discloses a method for handling the problem of surface intersection in CAD models, including:
[0057] Step S11: Import and repair the initial CAD model, establish a watertight mesh data structure to obtain a composite surface including continuous surfaces and discrete surfaces, and establish an axis-aligned bounding box tree using the discrete mesh of the composite surface; wherein, the root node of the axis-aligned bounding box tree is the parent axis-aligned bounding box containing all composite surfaces, and the leaf nodes are the child axis-aligned bounding boxes of each composite surface.
[0058] In this embodiment, in the CAD model, there are often problems of mutual intersection between different surfaces. Therefore, according to the requirements of model surface intersection processing, the initial CAD model with gaps generated by importing part data is subjected to surface gap repair processing to obtain the target 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 model surface intersection processing 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. Specific limitations are not imposed on this. The model surface intersection processing requirements can specifically be part surface intersection processing requirements, where the part can be mechanical parts in different fields, such as parts with complex surfaces like automobile body parts and aircraft hulls. Specific limitations are not imposed on this. For example: when the model surface intersection processing requirement is the surface intersection processing requirement at the wing-body connection of an aircraft, all the wing parameters (airfoil data, planar shape, wing-body connection method), fuselage parameters (cross-sectional shape, connection area matching requirements), and connection area characteristic parameters at the wing-body connection of the aircraft are imported to generate the corresponding initial CAD model. The initial CAD model at the wing-body connection of the aircraft is repaired for gaps to obtain the target CAD model at the wing-body connection of the aircraft without surface gaps.
[0059] Furthermore, the target CAD model is meshed and generated to obtain a composite surface that includes discrete surfaces and continuous surfaces. It can be understood that after the initial CAD model is repaired by the gap repair method to obtain the target CAD model, the watertight mesh data structure of the target CAD model is further generated by the watertight mesh generation method. Among them, the watertight mesh generation framework is a tool or method for constructing the data structure of the target CAD model. In the processing of the target CAD model, the mesh is a discrete representation of the model surface. Watertight mesh means that the connections between the meshes are tight and gapless, just like being sealed. This characteristic is crucial for subsequent precise calculations and analyses. Using this framework to establish the data structure can organize each part of the target CAD model in an orderly and standardized manner, facilitating various operations on the model in the future. Specifically, after the data structure of the target CAD model is established through the watertight mesh generation framework, each obtained composite 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. The continuous surface is the part of the surface that maintains the original continuous characteristics and reflects the overall shape and geometric features of the surface. The discrete surface and the continuous surface cooperate with each other. The discrete surface provides a quantifiable basis for specific operations, and the continuous surface ensures the overall geometric properties of the surface, jointly constituting the composite surface. For example: For the target CAD model at the wing-fuselage connection of an aircraft, its composite surface includes discrete surfaces and continuous surfaces. Among them, the continuous surfaces are: the theoretical external shape of the wing (airfoil curve, twist surface), and the transition surface of the fuselage docking section. The discrete surfaces are the discretization of the continuous surface (such as the surface mesh required for CFD / structural analysis) and the supplementary mesh for 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 the discrete meshes on the composite surface of the target CAD model. Among them, the root node of the bounding box tree is a large bounding box that contains all composite surface objects. Starting from the root node, the large bounding box is continuously divided using planes perpendicular to the coordinate axes until each small space only contains a sub-bounding box of a composite surface, that is, the leaf nodes are obtained. In this way, a hierarchical bounding box tree is established based on the discrete meshes, and the intersection detection of the composite surfaces is accelerated through space division.
[0061] Step S12: Determine the target composite surfaces that intersect with each of the composite surfaces through the bounding box tree to obtain pairs of composite surfaces with an intersection relationship, and screen the intersecting triangles of the pairs of composite surfaces and calculate the intersection point 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 list, 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 surfaces in the target bounding box are recursively detected with the current composite surface to screen and obtain several 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 through the bounding box tree for a target bounding box intersecting with the bounding box where the current composite surface is located is skipped and executed until the intersecting composite surface sets of all composite surfaces are 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 a model with composite surfaces, intersecting composite surface sets will be obtained, where is all the target composite surfaces intersecting with the th current composite surface . In this way, through the initial search of the target bounding boxes with intersecting relationships for each composite surface by the bounding box tree, the range of the target bounding boxes that may have a conflict relationship with the current composite surface can be determined in the form of a bounding box, and then the recursive detection of the target composite surfaces is further performed within this range to screen out the target composite surfaces intersecting with the current composite surface, obtaining the intersecting composite surface set, and further screening the range of composite surfaces that may have surface intersection problems. By shrinking the range of composite surfaces that may have surface intersection problems step by step, it facilitates the processing of each subsequent step regarding surface intersection problems.
[0063] In this embodiment, a corresponding composite surface pair is constructed according to the current composite surface and each target composite surface in the intersecting composite surface set, and in this way, several pairs 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 surface pairs; wherein, the tree nodes of the OBB bounding box tree are the parent bounding boxes containing all the discrete meshes on the composite surface, and the leaf nodes are the child bounding boxes of each discrete triangle; the discrete triangles with intersecting relationships in each of the composite surface pairs are screened through the OBB bounding box tree as intersecting triangles; the corresponding intersection points are calculated and generated by the single intersection strategy of the common edges of the discrete triangles within the same composite surface in the composite surface pair and the intersecting triangles in the other composite surface of the current composite surface pair, 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 On the discrete grid, an OBB bounding box tree of the current composite surface is established. Specifically, assume that the discrete grid on the current composite surface exists discrete triangles, then the generated OBB bounding box tree contains leaf nodes. The intersection triangle set between the two composite surfaces in the composite surface pair is further filtered through the OBB bounding box tree according to the aforementioned bounding box tree filtering process, and then the intersection points between the intersection triangles are calculated.
[0065] Specifically, due to the existence of computer floating-point number problems, the problem of intersection points being collinear will definitely occur during the calculation of triangle intersection points. To avoid this problem, only the common edge of one discrete triangle is used to perform the intersection point operation with another triangle (the intersection triangle in another composite surface), ensuring that each edge calculates the intersection point with the same triangle only once, thus avoiding the situation of intersection points being collinear. Specifically, as Figure 2 shown, triangle efd and triangle gfd share edge fd, and triangle efd and triangle gfd are on the same composite surface. If the intersection points are calculated using triangle efd and triangle abc respectively to obtain intersection points, and the intersection points are calculated using triangle gfd and triangle abc to obtain intersection points. At this time, the two intersection points are the collinear situation. At this time, if it is modified to calculate the intersection of the edge and the triangle, and the intersection point is obtained by intersecting edge fd with triangle abc. Then the intersection point is unique and shared by triangle efd and triangle gfd.
[0066] In this embodiment, a random intersection point is selected as the starting point according to the intersection point information, the next intersection point is obtained as the target intersection point according to the adjacent topological relationship of the discrete triangle where the starting point is located, and a corresponding intersection line segment is formed between the starting point and the target intersection point. Using the target intersection point as the new starting point, and jumping to the step of obtaining the next intersection point as the target intersection point according to the adjacent topological relationship of the discrete triangle where the starting point is located until all intersection line segments are obtained. It can be understood that since the virtual surface patches in the CAD model are all unclosed open surfaces, the intersection line formed between the two surfaces must be an unclosed intersection line. The specific operation of tracking the intersection line is as follows: Arbitrarily select an intersection point as the starting point, and obtain the next adjacent intersection point through the adjacent topological relationship of the current triangle, and form an intersection line segment between the two points. Then starting from , obtain the next adjacent intersection point through the adjacent 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: Determine the intersecting line segments based on the intersection point information and the triangular adjacency topology relationship, and construct a complete intersection line based on all the intersecting line segments.
[0068] In this embodiment, according to the usage times of the two end intersection points of each intersecting line segment, determine the intersection point with a usage time of one as the starting point of the intersection line, and start connecting other intersecting line segments from the intersecting line segment where the starting point is located to obtain a set of intersection lines; connect and group the intersection lines of the set of intersection lines according to the association relationship of the intersection points to obtain a complete intersection line. It can be understood that select the intersection point with a usage time of 1 as the starting point, and connect all the intersecting line segments to form a set of intersection lines . As Figure 3 shown, the intersecting line segments form an intersection line , and the intersecting line segments form an intersection line . Since a set of intersection lines can be obtained between every two curved surfaces (composite curved surface pairs) through the above process. After traversing all the composite curved surface pairs, for a certain current composite curved surface , all the intersection lines on it can be obtained . Then, further connect and group these intersection lines through the association relationship of the points to obtain the connected intersection lines. As Figure 4 shown, the dotted line is another set of intersection lines, the solid line is a set of intersection lines, and after connecting through the end points, the finally obtained intersection lines are and the intersection line .
[0069] Step S14: Project the complete intersection line onto the continuous curved surface of the current composite curved surface to obtain a corrected complete intersection line, and use the corrected complete intersection line and the current discrete grid for parameter domain mapping and fairing processing to obtain a processed watertight grid.
[0070] In this embodiment, project the complete intersection line onto the continuous curved surface of the current composite curved surface to obtain the projected intersection line; perform correction processing on each intersection point of the projected intersection line through the solid geometry data of the continuous curved surface, and perform curve fitting on each corrected intersection point to obtain a corrected complete intersection line. It can be understood that since the complete intersection line after intersection is composed of sections of line segments, there will be Figure 4 the non-smooth intersection line shown. Therefore, use the curve fitting algorithm to perform quadratic fitting on the intersection line to obtain a relatively smooth intersection line as Figure 5As shown in the figure, the specific operation is as follows: First, project each intersection point on the complete intersection line onto the continuous surface of the current composite surface, and correct the accuracy of the intersection points through the associated actual digital model surface (continuous surface). Then, use the corrected intersection points and use curve fitting related algorithms to fit to obtain a high-order continuous curve, such as the least squares fitting method, spline interpolation fitting, polynomial fitting, etc., and no specific limitation is made here.
[0071] In this embodiment, insert each curve point of the corrected complete intersection line into the current discrete grid to obtain a target discrete grid marked with the intersection line position of the corrected complete intersection line; map the target discrete grid to a preset two-dimensional parameter domain to obtain a two-dimensional discrete grid containing the mapped intersection line position; use the mapped intersection line position in the two-dimensional discrete grid to reconstruct a two-dimensional boundary line to obtain a two-dimensional discrete grid after boundary restoration; inverse map the two-dimensional discrete grid after boundary restoration to three-dimensional space to obtain a processed watertight grid. It can be understood that the smoothed curve points are used as feature points and inserted 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 as follows: Map the target discrete grid to the two-dimensional parameter domain, then perform two-dimensional boundary restoration in the two-dimensional parameter domain, and finally inverse map the restored two-dimensional discrete grid to the three-dimensional region to obtain a grid constrained by the feature line. Perform edge splitting, edge collapse, edge swapping, and point moving operations on the grid constrained by the feature line to achieve the local smoothing effect of the initial grid and obtain a processed watertight grid. In this way, use the preset surface clipping algorithm and clip the surface constructed by the current processed watertight grid according to the feature line. The feature line used for clipping is the intersection line 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 are joined again must be watertight.
[0072] It can be seen that the present application discloses a method for handling the problem of surface intersection in a CAD model, including: importing and repairing an initial CAD model, establishing a watertight mesh data structure to obtain a composite surface including a continuous surface and a discrete surface, and establishing a bounding box tree using the discrete mesh of the composite surface; wherein, the root node of the bounding box tree is a parent bounding box containing all the composite surfaces, and the leaf nodes are child bounding boxes of each composite surface; determining target composite surfaces intersecting with each of the composite surfaces through the bounding box tree to obtain pairs of composite surfaces with an intersection relationship, screening the intersecting triangles of the pairs of composite surfaces and calculating the intersection point information of the intersecting triangles; determining intersection line segments according to the intersection point information and the triangle adjacency topological relationship, and constructing 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 performing parameter domain mapping and smoothing processing using the corrected complete intersection line and the current discrete mesh to obtain a processed watertight mesh. Thus, by establishing a bounding box tree, the computational amount of intersection detection is reduced, global traversal of all composite surfaces is avoided, and automatic processing of the surface intersection problem of complex CAD models can be realized, reducing manual intervention and improving efficiency. Further, by projecting the intersection points onto the continuous surface for correction and using a curve fitting algorithm to generate a smooth intersection line, the geometric accuracy and continuity of the intersection line can be ensured, and the problems of co-points and intersection line breakage caused by floating-point errors in traditional methods can be solved, generating a high-fidelity and watertight mesh model. Finally, through parameter domain mapping and constraints, the topological consistency between the intersection line and the discrete mesh is ensured.
[0073] Referring Figure 6 as shown, the present invention also correspondingly discloses a device for handling the problem of surface intersection in a CAD model, including:
[0074] A bounding box tree construction module 11, configured to import and repair an initial CAD model, establish a watertight mesh data structure to obtain a composite surface including a continuous surface and a discrete surface, and establish a bounding box tree using the discrete mesh of the composite surface; wherein, the root node of the bounding box tree is a parent bounding box containing all the composite surfaces, and the leaf nodes are child bounding boxes of each composite surface;
[0075] An intersecting surface screening module 12, configured to determine target composite surfaces intersecting with each of the composite surfaces through the bounding box tree to obtain pairs of composite surfaces with an intersection relationship;
[0076] An intersection point information calculation module 13, configured to screen the intersecting triangles of the pairs of composite surfaces and calculate the intersection point information of the intersecting triangles;
[0077] An intersection line construction module 14, configured to determine intersection line segments according to the intersection point information and the triangle adjacency topological relationship, and construct a complete intersection line based on all the intersection line segments;
[0078] The inverse mapping module 15 is configured to project the complete intersection line onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and perform parameter domain mapping and smoothing processing on the corrected complete intersection line and the current discrete grid to obtain a processed watertight grid.
[0079] It can be seen that this application discloses importing and repairing an 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 containing all composite surfaces, and the leaf nodes are child bounding boxes of each composite surface; determining target composite surfaces intersecting with each of the composite surfaces through the bounding box tree to obtain pairs of composite surfaces with an intersection relationship, screening the intersecting triangles of the pairs of composite surfaces and calculating intersection point information of the intersecting triangles; determining intersection line segments based on the intersection point information and the triangle adjacency topological relationship to construct a complete intersection line based on all 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 performing parameter domain mapping and smoothing processing on the corrected complete intersection line and the current discrete grid to obtain a processed watertight grid. Thus, by establishing a bounding box tree, the computational amount of intersection detection is reduced, global traversal of all composite surfaces is avoided, automatic processing of the surface intersection problem of complex CAD models can be realized, manual intervention is reduced, and efficiency is improved. Further, by projecting the intersection points onto the continuous surface for correction and using a curve fitting algorithm to generate a smooth intersection line, the geometric accuracy and continuity of the intersection line are ensured, and the co-point problem and intersection line break problem caused by floating-point errors in the traditional method can be solved, a high-fidelity and watertight grid model can be generated, and finally, through parameter domain mapping and constraints, the topological consistency between the intersection line and the discrete grid is ensured.
[0080] Furthermore, an embodiment of this application also discloses an electronic device Figure 7 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment. The content in the figure should not be considered as any limitation to the scope of use of this application.
[0081] Figure 7 It is a schematic structural diagram of an electronic device 20 provided by an embodiment of this 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 method for processing the surface intersection problem of a CAD model disclosed in any of the foregoing embodiments. Additionally, 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 operating 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 can be any communication protocol applicable to the technical solution of this application, and no specific limitation is imposed on it 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 imposed 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), 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 also include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
[0084] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, a random access memory, a 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 can be short-term storage or permanent storage.
[0085] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the massive data 223 in the memory 22 by the processor 21. It can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the processing method of the CAD model surface intersection problem executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by the external device received by the electronic device, but also the data collected by its own input / 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, it implements the processing method of the CAD model surface intersection problem disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0087] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0088] Those skilled in the art may 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 as exceeding 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.
[0089] Finally, it should also be noted that in this document, 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 comprising 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 "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
[0090] The above has introduced the solution provided by the present invention in detail. Specific examples are used herein 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 handling the problem of surface intersection in a CAD model, characterized in that, Including: Import and repair the initial CAD model, establish a watertight mesh data structure to obtain a composite surface including continuous and discrete surfaces, and establish an bounding box tree using the discrete mesh of the composite surface; wherein, the root node of the bounding box tree is the parent bounding box containing all composite surfaces, and the leaf nodes are the child bounding boxes of each composite surface; Determine the target composite surfaces intersecting with each of the composite surfaces through the bounding box tree to obtain pairs of composite surfaces with an intersection relationship, and screen the intersecting triangles of the pairs of composite surfaces and calculate the intersection point information of the intersecting triangles; Determine the intersection line segments based on the intersection point information and the triangle adjacency topological relationship to construct a complete intersection line based on all the intersection line segments; Project the complete intersection line onto the continuous surface of the current composite surface to obtain a corrected complete intersection line, and perform parameter domain mapping and smoothing processing using the corrected complete intersection line and the current discrete mesh to obtain a processed watertight mesh; Wherein, the performing parameter domain mapping and smoothing processing using the corrected complete intersection line and the current discrete mesh to obtain a processed watertight mesh includes: Insert the curve points of the corrected complete intersection line into the current discrete mesh to obtain a target discrete mesh marked with the intersection line position of the corrected complete intersection line; map the target discrete mesh to a preset two-dimensional parameter domain to obtain a two-dimensional discrete mesh including the mapped intersection line position; reconstruct a two-dimensional boundary line using the mapped intersection line position in the two-dimensional discrete mesh to obtain a two-dimensional discrete mesh with the boundary restored; inverse map the two-dimensional discrete mesh with the boundary restored to the three-dimensional space to obtain a processed watertight mesh.
2. The method for handling the problem of surface intersection of a CAD model according to claim 1, characterized in that, The determining the target composite surfaces intersecting with each of the composite surfaces through the bounding box tree includes: Determine a composite surface as the current composite surface according to the traversal order of each composite surface in the traversal order list, and search for a target bounding box having an intersection relationship with the bounding box where the current composite surface is located through the bounding box tree; Recursively detect the composite surfaces 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 a set of intersecting composite surfaces; Determine the next composite surface as the current composite surface according to the traversal order, and jump to execute the step of searching for a target bounding box having an intersection relationship with the bounding box where the current composite surface is located through the bounding box tree until a set of intersecting composite surfaces of all composite surfaces is obtained.
3. The method for handling the surface intersection problem of the CAD model according to claim 1, characterized in that The screening the intersecting triangles of the pairs of composite surfaces and calculating the intersection point information of the intersecting triangles includes: Establish a corresponding OBB bounding box tree for each pair of composite surfaces; wherein, the tree nodes of the OBB bounding box tree are the parent bounding boxes containing all the discrete meshes on the composite surface, and the leaf nodes are the child bounding boxes of each discrete triangle; Screen the discrete triangles having an intersection relationship in each pair of composite surfaces through the OBB bounding box tree as intersecting triangles; Calculate and generate corresponding intersection points through the single intersection strategy of the common edge of discrete triangles within the same composite surface in the middle of the composite surface pair and the intersecting triangles in the other composite surface of the current composite surface pair, and count all the intersection points of all intersecting triangles to obtain the corresponding intersection point information.
4. The method for handling the surface intersection problem of the CAD model according to claim 3, wherein, The determining of the intersection line segment according to the intersection point information and the triangle adjacency topological relationship includes: Randomly select an intersection point as the starting point according to the intersection point information, obtain the next intersection point as the target intersection point according to the discrete triangle adjacency topological relationship where the starting point is located, and form a corresponding intersection line segment between the starting point and the target intersection point. Take the target intersection point as the new starting point, and jump to the step of obtaining the next intersection point as the target intersection point 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 handling the problem of surface intersection in a CAD model according to claim 3, characterized in that, The constructing of the complete intersection line based on all intersection line segments includes: Determine the intersection points with the usage count of one as the starting points of the intersection lines according to the usage counts of the two end intersection points of each intersection line segment, and start connecting other intersection line segments from the intersection line segment where the starting point is located to obtain a set of intersection lines; Connect and group the intersection lines in the set of intersection lines according to the association relationship of the intersection points to obtain the complete intersection line.
6. The method for processing the problem of surface intersection of a CAD model according to claim 1, characterized in that, The projecting of the complete intersection line onto the continuous surface of the current composite surface to obtain the corrected complete intersection line includes: Project the complete intersection line onto the continuous surface of the current composite surface to obtain the projected intersection line; Perform correction processing on each intersection point of the projected intersection line through the solid geometry data of the continuous surface, and perform curve fitting on each corrected intersection point to obtain the corrected complete intersection line.
7. A processing device for the problem of surface intersection in a CAD model, characterized in that, It includes: An bounding box tree construction module, which is used to import and repair the initial CAD model, establish a watertight mesh data structure to obtain a composite surface including a continuous surface and a discrete surface, and establish a bounding box tree using the discrete mesh of the composite surface; wherein, the root node of the bounding box tree is the parent bounding box containing all composite surfaces, and the leaf nodes are the child bounding boxes of each composite surface; An intersecting surface screening module, which is used to determine the target composite surfaces intersecting with each composite surface through the bounding box tree to obtain composite surface pairs with an intersecting relationship; An intersection point information calculation module, which is used to screen the intersecting triangles of the composite surface pair and calculate the intersection point information of the intersecting triangles; An intersection line construction module, which is used to determine the intersection line segments according to the intersection point information and the triangle adjacency topological relationship to construct a complete intersection line based on all intersection line segments; An inverse mapping module, which 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 perform parameter domain mapping and fairing processing using the corrected complete intersection line and the current discrete mesh to obtain the processed watertight mesh; The inverse mapping module is specifically configured to insert each curve point of the corrected complete intersection line into the current discrete grid to obtain a target discrete grid marked with the intersection line position of the corrected complete intersection line; map the target discrete grid to a preset two-dimensional parameter domain to obtain a two-dimensional discrete grid including the mapped intersection line position; reconstruct a two-dimensional boundary line using the mapped intersection line position in the two-dimensional discrete grid to obtain a two-dimensional discrete grid after boundary recovery; and inverse map the two-dimensional discrete grid after boundary recovery to three-dimensional space to obtain a processed watertight grid.
8. An electronic device, characterized in that, including: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the method for handling the CAD model surface intersection problem according to any one of claims 1 to 6.
9. 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 method for handling the CAD model surface intersection problem according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Curved surface triangular mesh generation method
CN116778112A
Automobile modeling design method and device
CN117010093A