Method for intersection of curves in a computer aided design system and related device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ACAD OF MATHEMATICS & SYSTEMS SCIENCE - CHINESE ACAD OF SCI
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-26
Smart Images

Figure CN122289376A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer-aided design technology, and in particular to a method and related equipment for finding intersections of surfaces in a computer-aided design system. Background Technology
[0002] NURBS surface intersection is a core technology in computer-aided design (CAD) systems, and its efficiency and the correctness of the intersection topology directly determine the modeling quality of the CAD system. However, when dealing with intersections with complex topologies, related algorithms struggle to balance efficiency and topological correctness.
[0003] Public content
[0004] This disclosure provides a method and related equipment for finding intersections of surfaces in a computer-aided design system, thereby improving the efficiency of finding intersections of surfaces while ensuring the correctness of the intersection topology.
[0005] According to one aspect of this disclosure, a method for finding intersections of surfaces in a computer-aided design system is provided, comprising: obtaining a first parameter domain of a first surface and a second parameter domain of a second surface; generating an initial mesh on the first parameter domain, the initial mesh containing multiple vertices; constructing a directed distance function from points on the first surface to the second surface based on the first and second parameter domains; determining the unit gradient vector of the directed distance function at each vertex of the initial mesh; identifying a first type of edge in the initial mesh based on the directional change between the unit gradient vectors of two vertices of each edge on the initial mesh, and recursively subdividing the initial mesh containing the first type of edge until a preset condition is met to obtain a target mesh and the first and second types of edges it contains; obtaining the critical point of the gradient field of the directed distance function based on the first type of edge and the number of wraps of the target mesh composed of the second type of edge; and performing intersection line tracing on the first and second surfaces based on the critical point to determine the intersection line of the first and second surfaces.
[0006] In some exemplary embodiments of this disclosure, determining the intersection line of the first surface and the second surface by performing intersection line tracing on the first surface and the second surface based on a critical point includes: determining a first starting point on the intersection line based on the critical point; and determining the intersection line by performing intersection line tracing on the first surface and the second surface based on the first starting point.
[0007] In some exemplary embodiments of this disclosure, determining a first starting point on the intersection line based on a critical point includes: if the values of the first parameter domain and the second parameter domain are equal at the critical point, then the critical point is taken as the first starting point; if the values of the first parameter domain and the second parameter domain are not equal at the critical point, then the isoparametric line corresponding to the first parameter domain at the critical point is determined, the first intersection point of the isoparametric line and the second surface is determined, and the first intersection point is taken as the first starting point.
[0008] In some exemplary embodiments of this disclosure, after determining a first starting point on the intersection line based on a critical point, the method further includes: determining a second starting point on the intersection line based on a first parameter domain and a second parameter domain; wherein, obtaining the intersection line based on the first starting point includes: performing intersection line tracing on the first starting point and the second starting point to obtain the intersection line.
[0009] In some exemplary embodiments of this disclosure, determining a second starting point on the intersection line based on a first parameter domain and a second parameter domain includes: determining the boundary curve of a first surface based on the first parameter domain, determining the boundary curve of a second surface based on the second parameter domain; determining the second intersection point of the boundary curve of the first surface and the second surface, determining the third intersection point of the boundary curve of the second surface and the first surface; and using the second intersection point and the third intersection point as the second starting point.
[0010] In some exemplary embodiments of this disclosure, recursively subdividing an initial mesh containing a first type of edge includes: subdividing the initial mesh containing a first type of edge according to a subdivision strategy; determining whether the target mesh contains a first type of edge based on the unit gradient vector of the vertices of the subdivided target mesh; if the target mesh contains a first type of edge, continuing to subdivide according to the subdivision strategy until a preset condition is triggered to end the subdivision, wherein the preset condition is that there is no first type of edge in the target mesh or the subdivision reaches the maximum number of layers.
[0011] In some exemplary embodiments of this disclosure, the subdivision strategy includes: if there are adjacent first-type edges within a grid, then subdividing the grid into four grids at the midpoint of the grid; if there are no adjacent first-type edges within a grid, then subdividing the grid into two grids at the midpoint of the first-type edges.
[0012] In some exemplary embodiments of this disclosure, the critical point of the gradient field of the directed distance function is obtained based on the first type of edges and the number of wraps of the target mesh composed of the second type of edges. This includes: when the preset condition is that there are no first type of edges in the target mesh, the number of wraps of the target mesh that does not contain the first type of edges is determined, and the target mesh with a non-zero number of wraps is recorded; taking the center point of the target mesh with a non-zero number of wraps as the starting point, the critical point where the gradient of the directed distance function is zero is determined iteratively.
[0013] In some exemplary embodiments of this disclosure, the critical point of the gradient field of the directed distance function is obtained based on the first type of edges and the number of wraps of the target mesh composed of the second type of edges, including: when the preset condition is that the subdivision reaches the maximum number of layers, all first type of edges are recorded, the number of wraps of the target mesh that does not contain the first type of edges is determined, and the target mesh with a non-zero number of wraps is recorded; taking the midpoint of the first type of edges and the center point of the target mesh with a non-zero number of wraps as the starting point, the critical point where the gradient of the directed distance function is zero is determined by iteration.
[0014] In some exemplary embodiments of this disclosure, determining the number of wraps of a target mesh that does not contain first-type edges includes: determining the quadrant to which the unit gradient vector corresponding to each vertex of the target mesh that does not contain first-type edges belongs; and determining the number of wraps of the target mesh based on the quadrant to which the unit gradient vector corresponding to each vertex of the target mesh that does not contain first-type edges belongs.
[0015] In the embodiments of this disclosure, a directed distance function between a first surface and a second surface is constructed and its gradient field is calculated. The gradient direction change of the edges of the initial mesh in the first parameter domain of the first surface is analyzed to identify the first edge. The critical point of the gradient field is located using recursive subdivision, and intersection line tracing is initiated based on the critical point. The critical point is determined by the gradient change of the directed distance function between the two surfaces, thereby ensuring the integrity of the intersection line topology. Initiating intersection line tracing based on the critical point avoids blind searching and improves the efficiency of surface intersection finding.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0018] Figure 1 A schematic diagram of a computer-aided design system according to an embodiment of the present disclosure is shown.
[0019] Figure 2 A flowchart illustrating a surface intersection method for a computer-aided design system according to an embodiment of this disclosure is shown.
[0020] Figure 3 A flowchart illustrating a method for determining the starting point of an intersection line according to an embodiment of this disclosure is shown.
[0021] Figure 4 A flowchart of a mesh recursive subdivision method according to an embodiment of this disclosure is shown.
[0022] Figure 5 A flowchart is shown for another surface intersection method in a computer-aided design system according to an embodiment of this disclosure.
[0023] Figure 6 A schematic diagram of a vector field and the number of closed curve wraps is shown in an embodiment of this disclosure.
[0024] Figure 7 A schematic diagram of a unit gradient vector in a different quadrant is shown in an embodiment of this disclosure.
[0025] Figure 8a A schematic diagram of a mesh subdivision according to an embodiment of the present disclosure is shown.
[0026] Figure 8b A schematic diagram of another grid subdivision in an embodiment of this disclosure is shown.
[0027] Figure 9 A schematic diagram of a recursive subdivision in an embodiment of this disclosure is shown.
[0028] Figure 10 A schematic diagram of a mesh wrapping number is shown in an embodiment of this disclosure.
[0029] Figure 11 This diagram illustrates a relationship between a critical point and a starting point in an embodiment of this disclosure.
[0030] Figure 12 This diagram illustrates a surface intersection result according to an embodiment of the present disclosure.
[0031] Figure 13 A schematic diagram illustrating the result of the intersection topology correctness in an embodiment of this disclosure.
[0032] Figure 14 This diagram illustrates a surface intersection device for a computer-aided design system according to an embodiment of the present disclosure.
[0033] Figure 15 A schematic diagram of an electronic device provided in an embodiment of this disclosure is shown. Detailed Implementation
[0034] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0035] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0036] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0037] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0038] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0039] It should be noted that, unless otherwise specified, the embodiments of this disclosure and the technical features thereof can be combined with each other.
[0040] To facilitate understanding, the following is an explanation of several terms used in this disclosure: NURBS Surface Intersection (NURBS Surface Intersection) refers to the numerical process in computer-aided geometric design of calculating the set of intersecting curves between two non-uniform rational B-spline surfaces. It aims to accurately obtain the geometric parameters and topological connections of the intersection lines and is a core foundational algorithm for solid Boolean operations, surface trimming, and complex model construction.
[0041] AA-GPU (Adaptive Approximation on GPU): A method that utilizes the massively parallel computing capabilities of graphics processing units.
[0042] TOPO (Topology-oriented Approach): A class of intersection strategies that prioritize ensuring the correctness of the topological structure of the computation results.
[0043] SISL (SINTEF SISL Library, SINTEF Geometry Modeling Library): An open-source C++ geometry modeling software library developed by the SINTEF Digital Mathematics Department in Norway.
[0044] OCCT (Open CASCADE Technology): A powerful open-source CAD / CAE software development kit.
[0045] ACIS (Alan Charles Ian's System, ACIS Geometric Modeling Kernel): A commercial 3D geometric modeling kernel developed by Spatial (now Dassault Systèmes).
[0046] CAD (Computer-Aided Design): refers to the technical process of using computer software systems to perform geometric modeling, drawing, modification, and document generation of products, buildings, or projects. It replaces traditional manual drawing and can create accurate two-dimensional drawings and complex three-dimensional solid models. It is the starting point of modern industrial design and manufacturing processes.
[0047] CAE (Computer-Aided Engineering) refers to the technical field of using computer software to simulate, analyze, verify, and optimize engineering designs. It is usually based on geometric models generated by CAD and uses methods such as finite element analysis, computational fluid dynamics, or multibody dynamics to simulate the physical behavior of products under real working conditions (such as stress, heat conduction, and fluid flow) so as to discover potential defects and improve the design before manufacturing the physical object.
[0048] Figure 1 The diagram illustrates a computer-aided design system according to an embodiment of this disclosure. The system includes a data acquisition device 101 and a server 102. A first surface and a second surface are two surface objects whose surfaces need to contact each other. The data acquisition device 101 can be various sensors used to acquire parameters of the first and second surfaces.
[0049] The acquisition device 101 may be equipped with an application program to perform the following: acquire the first parameter domain of the first surface and the second parameter domain of the second surface.
[0050] Server 102 may be equipped with an application to perform the following: generating an initial mesh on a first parameter domain, the initial mesh containing multiple vertices; constructing a directed distance function from points on a first surface to a second surface based on the first and second parameter domains; determining the unit gradient vector of the directed distance function at each vertex of the initial mesh; identifying first-class edges in the initial mesh based on the directional change between the unit gradient vectors of two vertices of each edge on the initial mesh, and recursively subdividing the initial mesh containing first-class edges until a preset condition is met to obtain the target mesh and the first and second-class edges it contains; obtaining the critical point of the gradient field of the directed distance function based on the first-class edges and the number of wraps of the target mesh composed of second-class edges; and performing intersection line tracing on the first and second surfaces based on the critical point to determine the intersection line of the first and second surfaces.
[0051] Figure 2 This diagram illustrates a flowchart of a surface intersection method for a computer-aided design system according to an embodiment of the present disclosure. The method is as follows: Figure 2 As shown, it includes the following steps: S201, obtain the first parameter domain of the first surface and the second parameter domain of the second surface.
[0052] As an example, the first parameter domain is the region of definition of the first surface in the parameter space, and the first parameter domain includes the range of parametric coordinates of the first surface.
[0053] As an example, the second parameter domain is the region of definition of the second surface in the parameter space, and the second parameter domain includes the range of parametric coordinates of the second surface.
[0054] S202, Generate an initial mesh on the first parameter domain, the initial mesh containing multiple vertices.
[0055] As an example, the initial mesh is a discretized mesh structure generated on the first parameter domain. There are multiple initial meshes, each of which includes multiple vertices and edges connecting the vertices.
[0056] S203, based on the first parameter domain and the second parameter domain, construct a directed distance function from a point on the first surface to the second surface.
[0057] An exemplary directed distance function is a mathematical function used to measure the signed distance from a point on a first surface to a second surface. The directed distance function includes information about the point's position in space and the distance value.
[0058] S204 determines the unit gradient vector of the directed distance function at each vertex of the initial mesh.
[0059] As an example, the unit gradient vector is the direction vector of the rate of change of the directed distance function at a specific point and has a magnitude of 1. The unit gradient vector includes direction information and normalized length information.
[0060] S205: Based on the directional change between the unit gradient vectors of the two vertices of each edge on the initial mesh, identify the first type of edge in the initial mesh, and recursively subdivide the initial mesh containing the first type of edge until the preset conditions are met, to obtain the target mesh and the first and second types of edges it contains.
[0061] As an example, the target mesh is obtained by recursively subdividing the initial mesh containing first-class edges.
[0062] In some exemplary embodiments of this disclosure, identifying a first type of edge in the initial grid based on the directional change between the unit gradient vectors of the two vertices of each edge includes: determining the quadrant to which the unit gradient vector of each vertex belongs; if the unit gradient vectors of the two vertices of each edge in the initial grid are not in the same quadrant or adjacent quadrants, and the unit gradient vectors of the two vertices of the edge are not zero vectors, then the edge is determined to be a first type of edge.
[0063] In this embodiment, in an initial mesh, the unit gradient vectors of the two vertices connected by each edge are examined. If their unit gradient vectors do not belong to the same quadrant or to adjacent quadrants, and both unit gradient vectors are non-zero, then the edge is determined to be a first-class edge. This allows for efficient screening of mesh edges whose gradient directions are drastically reversed or significantly deflected.
[0064] Furthermore, the method for identifying the second type of edge is exactly the opposite of the method for identifying the first type of edge; in other words, if an edge is not a first type edge, then it is a second type edge.
[0065] S206, based on the first type of edges and the number of wraps of the target mesh composed of the second type of edges, obtain the critical point of the gradient field of the directed distance function.
[0066] As an example, the wrap number is the number of topological wraps of a target mesh consisting only of second-class edges.
[0067] As an example, the critical point is the point where the gradient of the directed distance function is zero in the gradient field.
[0068] S207, based on the critical point, perform intersection line tracing on the first surface and the second surface to determine the intersection line of the first surface and the second surface.
[0069] As an example, the intersection line is the curve where the first and second surfaces intersect in three-dimensional space.
[0070] As an example, intersection tracing is a process of progressively calculating and connecting discrete points along intersecting paths on a first and second surface based on critical points to form a continuous curve.
[0071] In this embodiment, a directed distance function between the first and second surfaces is constructed and its gradient field is calculated. The gradient direction change of the edges of the initial mesh in the first parameter domain of the first surface is analyzed to identify the first edge. Recursive subdivision is used to locate the critical point of the gradient field, and intersection line tracing is initiated based on the critical point. Through the above technical means, the problem of not being able to balance efficiency and intersection line topological correctness in related surface intersection techniques is solved, thereby improving the efficiency of surface intersection while ensuring the topological correctness of the intersection line.
[0072] In some exemplary embodiments of this disclosure, determining the intersection line of the first surface and the second surface by performing intersection line tracing on the first surface and the second surface based on a critical point includes: determining a first starting point on the intersection line based on the critical point; and determining the intersection line by performing intersection line tracing on the first surface and the second surface based on the first starting point.
[0073] In some exemplary embodiments of this disclosure, determining a first starting point on the intersection line based on a critical point includes: if the values of the first parameter domain and the second parameter domain are equal at the critical point, then the critical point is taken as the first starting point; if the values of the first parameter domain and the second parameter domain are not equal at the critical point, then the isoparametric line corresponding to the first parameter domain at the critical point is determined, the first intersection point of the isoparametric line and the second surface is determined, and the first intersection point is taken as the first starting point.
[0074] As an example, the first starting point is the initial position point on the intersection line determined during the intersection line tracing process. The first starting point includes spatial coordinate information and the parameter domain information of the surface to which it belongs.
[0075] In this embodiment, a first starting point on the intersection line is first located using a predetermined critical point. Then, using this first starting point as a reference, an intersection line tracing process is performed on the first and second curved surfaces, thereby ultimately determining the complete intersection line of the first and second curved surfaces. Through the above technical means, the intersection line tracing process is ensured to have an accurate initialization starting point, thereby improving the continuity and completeness of the intersection line generation.
[0076] As an example, the first starting point is the initial position point located on the intersection line, determined during the intersection line tracing process.
[0077] An exemplary isoparametric line is a curve formed by keeping one parameter value constant while allowing another parameter value to vary in the parameter domain of a surface. In three-dimensional space, it corresponds to a specific trajectory line on the surface.
[0078] As an example, the first intersection point refers to the point in three-dimensional space where the defined isoparametric line and the second surface actually intersect, and this point lies on both the isoparametric line and the second surface.
[0079] In this embodiment, it is first determined whether the parameter values of the first parameter domain and the second parameter domain are equal at the critical point. If they are equal, the critical point is directly determined as the first starting point on the intersection line. If they are not equal, the isoparametric line corresponding to the first parameter domain at the critical point is first determined, and then the first intersection point of the isoparametric line and the second surface is calculated, and this first intersection point is taken as the first starting point on the intersection line. Subsequently, based on this first starting point, the intersection line tracing process is performed on the first surface and the second surface, thereby finally determining the complete intersection line of the first surface and the second surface. Through the above technical means, an accurate starting point can be adaptively selected or directly calculated according to the matching of parameter domain values, thereby solving the problem of starting point positioning deviation caused by inconsistent parameter domains and ensuring the accuracy of subsequent intersection line tracing.
[0080] In one application scenario, the first curved surface represents the blade of an aero-engine, and the second curved surface represents the engine casing. The blade is located inside the casing, and the gap between the two is extremely small (typically only millimeters or even sub-millimeters), with both surfaces exhibiting highly complex shapes. During design, it is crucial to ensure that the blade tip does not scrape against the inner wall of the casing when the blade rotates at high speed, expands due to heat, or vibrates, while simultaneously preventing excessive gaps that could lead to leakage and reduced efficiency. The aforementioned technical solution can be used to determine the intersection line between the blade and the casing (gap analysis), thereby ensuring an extremely small gap and preventing the blade tip from scraping against the inner wall of the casing during engine operation.
[0081] It should be noted that this disclosure can be applied to any analysis and design that requires the assembly of curved surfaces, such as gap analysis at the joints of complex curved surfaces like car doors and hoods.
[0082] In some exemplary embodiments of this disclosure, after determining a first starting point on the intersection line based on a critical point, the method further includes: determining a second starting point on the intersection line based on a first parameter domain and a second parameter domain; wherein, obtaining the intersection line based on the first starting point includes: performing intersection line tracing on the first starting point and the second starting point to obtain the intersection line.
[0083] As an example, the second starting point refers to another initial position point located on the intersection line and different from the first starting point.
[0084] In this embodiment, a second starting point, distinct from the first starting point, is determined on the intersection line using a first parameter domain and a second parameter domain. Then, intersection line tracing is performed simultaneously based on both the first and second starting points. A complete intersection line is ultimately generated through a bidirectional or multi-path tracing strategy. By utilizing multiple starting points collaboratively for intersection line tracing, the completeness and reliability of the generated intersection line are improved.
[0085] Figure 3 This invention discloses a flowchart illustrating a method for determining the starting point of an intersection line according to an embodiment of the present disclosure. The method is as follows: Figure 3 As shown, it includes the following steps: S301, determine the boundary curve of the first surface based on the first parameter domain, and determine the boundary curve of the second surface based on the second parameter domain; S302, determine the boundary curve of the first surface and the second intersection point of the second surface, and determine the third intersection point of the boundary curve of the second surface and the first surface; S303, take the second intersection point and the third intersection point as the second starting point.
[0086] As an example, the boundary curve refers to the three-dimensional spatial curve corresponding to the edge of the first surface at the parameter domain, representing the limiting profile of the surface's geometric range.
[0087] As an example, the second intersection point refers to the point where the boundary curve of the first surface intersects with the second surface in three-dimensional space.
[0088] As an example, the third intersection point refers to the point where the boundary curve of the second surface intersects with the first surface in three-dimensional space.
[0089] In this embodiment, the boundary curves of the first surface and the second surface are extracted from the first parameter domain and the second parameter domain, respectively. Then, the second intersection point between the boundary curve of the first surface and the second surface is calculated, and the third intersection point between the boundary curve of the second surface and the first surface is calculated. Finally, these two intersection points are jointly determined as the second starting point on the intersection line. By using the above technical means, the intersection position of the surface boundary with another surface is used as an additional tracking starting point to prepare for intersection line tracking assisted by the first starting point.
[0090] Figure 4 This diagram illustrates a flowchart of a mesh recursive subdivision method according to an embodiment of the present disclosure. The method is as follows: Figure 4 As shown, it includes the following steps: S401, For the initial mesh containing first-type edges, subdivide it according to the subdivision strategy; S402, based on the unit gradient vector of the vertices of the target mesh formed by subdivision, determine whether the target mesh has a first-class edge; S403, if the target mesh has a first-type edge, continue to subdivide according to the subdivision strategy until the preset condition is triggered to end the subdivision. The preset condition is that there is no first-type edge in the target mesh or the subdivision reaches the maximum number of layers.
[0091] The exemplary subdivision strategy is a predefined grid segmentation rule.
[0092] As an example, the maximum number of levels refers to the maximum number of iterations allowed during a recursive subdivision process.
[0093] In this embodiment, the initial mesh containing the first type of edges is first subdivided according to a subdivision strategy. Then, the unit gradient vector of the newly generated vertices is used to re-evaluate whether the first type of edges still exist in the target mesh. If the first type of edges are still detected, the above steps are repeated to continue subdivision. The method of this embodiment is a recursive loop process: the loop continues until a preset condition is met to exit the loop. Through the above technical means, sufficient mesh resolution is ensured in key areas to accurately capture geometric details.
[0094] In some exemplary embodiments of this disclosure, the subdivision strategy includes: if there are adjacent first-type edges within a grid, then subdividing the grid into four grids at the midpoint of the grid; if there are no adjacent first-type edges within a grid, then subdividing the grid into two grids at the midpoint of the first-type edges.
[0095] In this embodiment, the above-mentioned technical means are used to quickly improve the resolution and capture details in adjacent edge regions with complex features by using the quartering method, while in isolated edge regions with simple features, the bisection method is used to avoid over-subdivision, thereby optimizing the computational efficiency while ensuring the accuracy of geometric reconstruction.
[0096] In some exemplary embodiments of this disclosure, the critical point of the gradient field of the directed distance function is obtained based on the first type of edges and the number of wraps of the target mesh composed of the second type of edges. This includes: when the preset condition is that there are no first type of edges in the target mesh, the number of wraps of the target mesh that does not contain the first type of edges is determined, and the target mesh with a non-zero number of wraps is recorded; taking the center point of the target mesh with a non-zero number of wraps as the starting point, the critical point where the gradient of the directed distance function is zero is determined iteratively.
[0097] In this embodiment, if the termination condition of the above recursive subdivision loop is that there are no first-type edges in the target mesh, then target meshes with non-zero wrapping numbers are selected. The center points of these target meshes with non-zero wrapping numbers are set as initial search points. Numerical iterative algorithms (such as Newton's method) are used to search for positions where the gradient is zero in the local region, thereby accurately locating the critical point of the directed distance function gradient field. Through the above technical means, the mesh region containing the critical point is located using the wrapping number, and the subdivided target mesh center is used as the initial value for iterative solution, improving the accuracy and robustness of critical point extraction.
[0098] In some exemplary embodiments of this disclosure, the critical point of the gradient field of the directed distance function is obtained based on the first type of edges and the number of wraps of the target mesh composed of the second type of edges, including: when the preset condition is that the subdivision reaches the maximum number of layers, all first type of edges are recorded, the number of wraps of the target mesh that does not contain the first type of edges is determined, and the target mesh with a non-zero number of wraps is recorded; taking the midpoint of the first type of edges and the center point of the target mesh with a non-zero number of wraps as the starting point, the critical point where the gradient of the directed distance function is zero is determined by iteration.
[0099] In this embodiment, if the termination condition of the above recursive subdivision loop is that the subdivision reaches the maximum number of layers, then the number of wraps of the target mesh consisting only of second-type edges is calculated, and mesh cells with non-zero wraps are selected. The midpoints of all remaining first-type edges in the target mesh, along with the center points of the target meshes with non-zero wraps, are used as initial search points. A numerical iterative algorithm is then used to search for points with zero gradients near these locations, thereby determining the critical points of the directed distance function gradient field. Through the above techniques, when the subdivision is limited by the maximum number of layers and cannot completely eliminate first-type edges, the search coverage of critical points is expanded by simultaneously using the midpoints of the remaining first-type edges and the centers of topologically anomalous regions (mesh cells with non-zero wraps) as initial search points, thus avoiding missed detection of critical points.
[0100] In some exemplary embodiments of this disclosure, determining the number of wraps of a target mesh that does not contain first-type edges includes: determining the quadrant to which the unit gradient vector corresponding to each vertex of the target mesh that does not contain first-type edges belongs; and determining the number of wraps of the target mesh based on the quadrant to which the unit gradient vector corresponding to each vertex of the target mesh that does not contain first-type edges belongs.
[0101] In this embodiment, the quadrant to which the unit gradient vector belongs is determined based on its orientation in the planar coordinate system. Then, according to the sequence change pattern of the quadrant to which the unit gradient vector at the vertex belongs (e.g., clockwise or counterclockwise jumps in quadrant numbers), the total angle of rotation of the unit gradient vector around the origin is accumulated to derive the wrapping number of the target mesh. By discretizing continuous gradient directions into quadrant assignments, the computational complexity of the wrapping number is simplified.
[0102] In an exemplary embodiment, if the quadrant numbers of the unit gradient vectors at the four vertices of a target mesh, arranged counterclockwise, are equivalent to one of the permutations {(1,2,3,4),(2,3,4,1),(3,4,1,2),(4,1,2,3)}, then the wrap number is +1. If the quadrant numbers are arranged counterclockwise, they are equivalent to one of the permutations {(1,4,3,2),(4,3,2,1),(3,2,1,4),(2,1,4,3)}, then the wrap number is -1. If none of the above permutations are satisfied, the wrap number of the mesh is recorded as 0.
[0103] In some exemplary embodiments of this disclosure, generating an initial mesh on a first parameter domain includes: uniformly discretizing the first parameter domain according to a preset step size to obtain an initial mesh.
[0104] As an example, the preset step size is a pre-defined fixed interval distance.
[0105] In this embodiment, grid nodes are divided at equal intervals in each dimension of the parameter domain according to a fixed preset step size, thereby generating initial grid cells with regular shapes (such as squares or rectangles) and uniform sizes, thus providing a reference grid with a simple structure and uniform distribution.
[0106] In an exemplary embodiment, intersection line tracing includes: first, calculating the tangential direction of the intersection line at the current intersection point; second, advancing one step distance along the tangential direction according to a preset step size to obtain the starting point of the next iteration point; then, using the starting point as the initial value for Newton's iteration, performing iterative solutions until the point converges to the intersection line, thereby obtaining a new intersection line point. The preset termination condition for intersection line tracing includes at least one of the following: the tracing result reaches the vicinity of another starting point; the tracing result returns to the vicinity of the current starting point, forming a closed intersection line branch; or the tracing result reaches the boundary of the intersection line.
[0107] Figure 5 This invention discloses a flowchart of another surface intersection method in a computer-aided design system, as shown in the embodiments of the present disclosure. Figure 5 As shown, it includes the following steps: S501, given two NURBS surfaces and its corresponding parameter domain For NURBS surfaces parameter domain Uniform discretization is performed to obtain the parameter domain. The grid on; S502, provides the surface To the curved surface Directed distance function And calculate the parameter domain Directed distance function at the vertices of the middle grid The unit gradient vector; S503: Filter edges in the mesh where the gradient direction changes significantly, design a subdivision strategy to subdivide them, and calculate the unit gradient vector of the vertices of the new mesh. S504: When there are no edges with significant changes in orientation in the mesh, or when the subdivision reaches the maximum number of layers, record all possible first edges; S505, calculate the number of wraps for the mesh that does not include the first edge, and record the meshes with a non-zero number of wraps; S506, take the midpoint of the first side and the center point of the non-zero winding number grid as the starting point, and calculate the critical point of the gradient field of the directed distance function through iteration; S507, calculate the starting point on each branch of the intersection line based on the critical point, including the starting point on the tangent and the closed loop; S508, Calculate NURBS surfaces Boundary and NURBS surface The intersection point is used to obtain the starting point on the branch of the intersection line; S509, based on the calculated starting point, trace the intersection branch to obtain the complete intersection line.
[0108] In step S501, the NURBS surface is... parameter domain Uniform discretization is performed to obtain the parameter domain. The grid on top. Assume the preset step size is... Then in the parameter domain Get it Uniform grid.
[0109] In step S502, for the curved surface and curved surfaces Assuming its parameters are expressed as For the parameter domain Parameters on Assuming it is on a curved surface The nearest point in is Denote the function for: ; (1) in, Representative surface At point The unit normal vector on the plane. Geometrically speaking, Representative point To the curved surface The directed distance.
[0110] For parameter domain Parameters on It is about The gradient direction is: (2) in, and yes Regarding the first-order partial derivatives in both directions, for mesh vertices... ,like If the vector is not zero, then its unit gradient vector is... .
[0111] In step S503, the direction of the gradient vector at each vertex of the mesh is divided into five categories according to quadrants, including four quadrants and the zero vector. Next, the second edge in the mesh is defined to satisfy one of the following conditions: (1) The gradient vector of one of the two vertices of the edge is the zero vector; (2) The gradient vectors corresponding to the two vertices of the edge are located in the same or adjacent quadrants.
[0112] The first edge in the mesh does not satisfy the above conditions. After classifying the mesh edges according to the above conditions, the mesh containing four second edges is retained, while the mesh containing the first edge is further subdivided. The specific subdivision rules are as follows: (1) If there are adjacent first edges within the grid, then subdivide the grid into four subgrids at the midpoint; (2) If there is no adjacent first edge in the grid, subdivide it into two subgrids at the midpoint of the first edge.
[0113] According to the above subdivision rules, the mesh can be continuously subdivided near non-isolated critical curves to accurately locate the critical region. This subdivision process continues until all edges become second edges or the maximum subdivision level is reached, thus obtaining the final hierarchical mesh representation of the vector field.
[0114] In step S504, according to the subdivision rules in step S503, when the grid does not have a first edge, or when the subdivision reaches the maximum number of layers, all possible first edges are recorded.
[0115] In step S505, in the final subdivided mesh, the number of wraps of a mesh with four second edges can be determined by the arrangement of gradient vectors at the four vertices of the mesh. First, a second edge that satisfies the second edge definition condition (1) has a critical point at its endpoint and can be directly recorded. Otherwise, consider the quadrants where the gradient vectors corresponding to the four vertices of the mesh are located. If the number of quadrants they are located in is arranged in a counterclockwise order as one of the arrangements {(1,2,3,4),(2,3,4,1),(3,4,1,2),(4,1,2,3)}, then the number of wraps of the mesh is +1. If the number of quadrants they are located in is arranged in a counterclockwise order as one of the arrangements {(1,4,3,2),(4,3,2,1),(3,2,1,4),(2,1,4,3)}, then the number of wraps of the mesh is -1. If none of the above arrangements are satisfied, then the number of wraps of the mesh is recorded as 0. According to the wrap number theorem, when the wrap number of a closed curve is not zero, there must be a critical point inside the region enclosed by the closed curve.
[0116] In step S506, given the starting point, the equation satisfied by the critical point is: (3) (4) (5) (6) in, and Represents the unit gradient vector and the surface vertical, and This indicates that the normal vectors of the two surfaces are parallel, which means... yes The critical point. By applying Newton's iteration to the above equation, the exact solution for the critical point can be obtained.
[0117] In step S507, if If the critical point is located on the intersection line of the two surfaces, and the normal vectors of the surfaces are parallel at that point, then the critical point is also the tangent point of the two surfaces, which may be an isolated tangent point or a point on the tangent line.
[0118] like Then, based on the critical point, it is necessary to further calculate the starting point on the intersection line. Consider the curved surface. In parameters The two isoparametric lines are respectively as well as Calculate the relationship between these two isoparametric lines and the surface. The intersection point is used as the starting point on the intersection line.
[0119] In step S508, it is assumed that the NURBS surface... parameter domain NURBS surface parameter domain The endpoints of the branching lines of the intersection fall at the boundaries of the surface, i.e., their parameters. One of the following conditions must be met: To find the starting points on all open branches of the intersection line, a surface is constructed. The four boundary curves: , , , Calculate boundary curves and surfaces The intersection points; similarly, construct the surface. The four boundary curves: , , , Calculate boundary curves and surfaces The intersection points are calculated once for each curve and another surface to find all the intersection points.
[0120] In step S509, the starting points calculated in the previous steps are divided into two categories: ordinary starting points, where the normals of the two surfaces at that point are not parallel; and singular points in the intersection line, where the normals of the two surfaces at that point are parallel. For ordinary starting points, the tangent of the intersection line at that point can be obtained by the cross product of the normals of the two surfaces at that point. A given step size is then taken along this direction to obtain the initial value of a point below the intersection line, and the accurate intersection point is calculated using Newton's iteration. For singular points in the intersection line, the specific type of the point needs to be determined first. If the point is an isolated tangent point, the two surfaces do not intersect in a small neighborhood near that point, so subsequent intersection line tracing is not required. If the point is a cross point, the intersection line is no longer a single smooth branch in the neighborhood of that point, but rather two local branches intersecting at that point to form an "8" shape or a cross shape. Therefore, for subsequent intersection line tracing, it is necessary to calculate the two tangent directions at the cross point. The two tangent directions at the bifurcation point refer to the tangent directions of the two local intersection branches in the neighborhood of that point. If the point is on a tangent line, the direction of the tangent at that point needs to be calculated by combining the curvature information of the two surfaces, and then traced to obtain the topologically correct intersection branch.
[0121] Figure 6 This diagram illustrates a vector field and the number of wraps around a closed curve according to an embodiment of the present disclosure, such as... Figure 6 As shown, it includes: For parameter domain A schematic diagram of uniform discretization and calculation of the unit gradient vector at the vertices of the mesh.
[0122] The left side shows two vector fields containing isolated critical points, with different directions. In both vector fields, the unit gradient vector at each grid vertex is represented by an arrow, and the point at the center of the vector field represents the critical point of that planar vector field. The circle outside the critical point represents a closed curve containing the critical point.
[0123] The right side shows two ways to give the number of wraps of a closed curve using a Gaussian mapping. The first method is Ind( The value of `ind(p)` is +1, indicating that the quadrant number of the unit gradient vector at each mesh vertex is arranged in a counter-clockwise order, which is equivalent to arranging one of the following: {(1,2,3,4),(2,3,4,1),(3,4,1,2),(4,1,2,3)}. Therefore, the mesh wrapping number is +1. The second type, `Ind(`... ,p)=-1, indicating that the quadrant number of the unit gradient vector of the grid vertex is arranged in a counterclockwise order, which is equivalent to one of the arrangements {(1,4,3,2),( 4,3,2,1),(3,2,1,4),(2,1,4,3)}, and the number of grid wraps is -1.
[0124] Figure 7 A schematic diagram illustrating a unit gradient vector in a different quadrant according to an embodiment of this disclosure is shown, such as... Figure 7 As shown, it includes: χ(u, v) = 0, χ(u, v) = 1, χ(u, v) = 2, χ(u, v) = 3, χ(u, v) = 4 represent the zero vector, the unit vector in the first quadrant, the second quadrant, the third quadrant, and the fourth quadrant, respectively.
[0125] Figure 8a This diagram illustrates a mesh subdivision scheme according to an embodiment of the present disclosure, such as... Figure 8a As shown, the subdivision rule is as follows: if a grid has an adjacent edge that is the first edge, then the grid is divided into four grids.
[0126] Figure 8b A schematic diagram of another mesh subdivision in an embodiment of this disclosure is shown, such as... Figure 8b As shown, the subdivision rule is as follows: if a grid contains a first edge, but the first edges are not adjacent, then the grid is divided into two grids.
[0127] Figure 9 This illustration shows a schematic diagram of a recursive subdivision in an embodiment of the present disclosure, such as... Figure 9 As shown, it includes: initial mesh, initial illegal edges, mesh subdivision, calculation of gradient vectors of new grid points, final illegal edges, and final calculated intersection points.
[0128] According to the subdivision rules, the mesh containing the first edge is subdivided, and the unit gradient vector at each vertex of the new mesh is calculated. Once subdivision is complete, the first edge is recorded, and its midpoint is taken as the starting point of the iteration. The critical point on the critical curve represents the final iteration result of this process.
[0129] Figure 10 This diagram illustrates a grid wrapping number according to an embodiment of the present disclosure, such as... Figure 10 As shown, it includes: The left side shows the functions The contour map ranges from -1 to 70. The arrows on the grid indicate... unit gradient vector .
[0130] The right side shows the vector field. The three isolated critical points are represented by black dots. These three isolated critical points correspond to three closed curves, represented by circles. The three closed curves, from smallest to largest, have encirclement numbers of +1, -1, and 0, respectively.
[0131] Figure 11 This diagram illustrates a relationship between a critical point and a starting point in an embodiment of this disclosure, as shown below. Figure 11 As shown, it includes: Two points on the boundary are two boundary points, and two points inside the boundary are two critical points. Dashed lines represent parametric lines. (This refers to the process of traversing a surface.) Isoparametric lines and surfaces Finding the intersection point allows us to obtain the intersection point on the intersection line.
[0132] Figure 12 This diagram illustrates a surface intersection result according to an embodiment of the present disclosure, such as... Figure 12 As shown, it includes: This figure compares the method of this disclosure with other existing methods in terms of calculating the intersection topology and intersection time of NURBS surface intersection lines. The method is compared with GPU-accelerated intersection algorithms (AA-GPU), intersection algorithms that guarantee intersection topology (TOPO), the intersection algorithms in open-source software OCCT, SISL, and existing software ACIS.
[0133] As shown in the figure, this comparative experiment covers eight different geometric intersection scenarios, from top to bottom: intersection on the self-intersection curve; a line plus two small loops; intersection with four branch points; a tiny loop plus a big loop; a tangent line plus two boundary curves; nine tiny loops; a tangent line plus a regular curve; and a tangent at a cusp curve. The evaluation metrics are uniformly set as "running time" and "topology correctness" (T for correct, F for incorrect). Traditional algorithms (AA-GPU, TOPO, SISL, OCCT, ACIS) only output total runtime and correctness status, while the method disclosed in this paper (Ours) is further subdivided into four metrics: salient point calculation, starting point selection, curve tracing, and total runtime. Specific data performance is as follows: In Case 1 (intersection on the self-intersection curve), AA-GPU took 0.039s(T), TOPO took 0.812s(T), SISL took 0.043s(T), OCCT took 0.006s(T), and ACIS took 0.009s(T), while Ours method took 0.0021s for the significant point, 0.0095s for the starting point, and 0.0020s for the tracking point, for a total of 0.014s(T). In Case 2 (a straight line plus two small loops), AA-GPU took 0.102s (F), TOPO took 1.243s (T), SISL took 0.093s (F), OCCT took 0.005s (F), ACIS took 0.015s (T), and the Ours method took 0.0025s for the salient point, 0.0067s for the starting point, and 0.0054s for the tracking point, for a total of 0.015s (T). In Case 3 (which includes the intersection of four branch points), AA-GPU took 0.057s (F), TOPO took 5.283s (T), SISL had no results (F), OCCT took 0.001s (F), ACIS took 0.014s (T), and Ours method took 0.0007s for salient points, 0.0042s for starting points, and 0.0057s for tracking points, for a total of 0.011s (T). In Case 4 (a small ring plus a large ring), AA-GPU took 0.034s (F), TOPO took 4.962s (T), SISL took 0.052s (F), OCCT took 0.002s (T), ACIS took 0.022s (T), and the Ours method took 0.0008s for salient point, 0.0045s for starting point, and 0.0012s for tracking, for a total of 0.007s (T). In Case 5 (one tangent line plus two boundary curves), AA-GPU took 0.658s (F), TOPO took 2.510s (T), SISL took 0.086s (T), OCCT took 0.004s (T), ACIS took 0.005s (T), and the Ours method took 0.0028s for salient point, 0.0188s for starting point, and 0.0471s for tracking, for a total of 0.068s (T). In Case 6 (nine tiny rings), AA-GPU took 0.091s (F), TOPO took 16.397s (T), SISL took 0.173s (F), OCCT took 0.043s (T), ACIS took 0.017s (T), and Ours method took 0.0010s for salient point, 0.0293s for starting point, and 0.0013s for tracking, for a total of 0.032s (T). In Case 7 (one tangent line plus one normal curve), AA-GPU took 0.208s (F), TOPO took 1.219s (T), SISL had no results (F), OCCT took 0.005s (T), ACIS took 0.051s (T), and the Ours method took 0.0019s for the significant point, 0.0135s for the starting point, and 0.0484s for the tracking point, for a total of 0.064s (T). In Case 8 (tangent at the cusp), AA-GPU took 0.061s (F), TOPO took 0.748s (T), SISL took 0.124s (F), OCCT took 0.001s (T), ACIS took 0.006s (T), and Ours method took 0.0050s for salient point, 0.0181s for starting point, and 0.0112s for tracking, for a total of 0.034s (T).
[0134] The results show that TOPO and the method of this disclosure consistently provide correct topological results for the intersection lines, while the other four algorithms either crash or produce incorrect intersection line results in some examples. However, TOPO's computation time is relatively long because it requires converting the NURBS surface into an algebraic representation and solving algebraic equations or systems of equations within a specific parameter domain. In contrast, the method of this disclosure demonstrates higher computational efficiency among the algorithms that successfully provide accurate intersection line topology, achieving minimal computation time in most examples.
[0135] Figure 13 A schematic diagram illustrating the result of intersection topology correctness in an embodiment of this disclosure is shown, such as... Figure 13 As shown, it includes: The figure shows a comparison of the time taken and the correctness of the intersection topology between the method of this disclosure and the intersection method of OCCT under different numbers of sampling points.
[0136] In the eight examples shown in the figure, experimental results demonstrate that, while ensuring the correctness of the intersection topology, the method disclosed herein outperforms OCCT in these challenging examples. As the number of sampling points increases, the intersection results obtained by OCCT can be categorized into two types: one type of intersection can be correctly calculated when the number of sampling points is sufficiently large, as shown in Examples 1 to 4 and Example 6; the other type of intersection is unaffected by the number of sampling points and always contains missed intersection branches, as shown in Examples 5, 7, and 8. The first type of intersection contains small loops or forks, which can be detected and traced as the number of sampling points increases; the second type of intersection contains tangents, boundary intersections, or cusps, which can be identified but the entire intersection branch cannot be correctly traced.
[0137] Based on the same disclosed concept, this disclosure also provides a surface intersection finding device for a computer-aided design system, as shown in the following embodiments. Since the principle of the surface intersection finding device for a computer-aided design system in solving the problem is similar to that of the above method embodiments, the implementation of the surface intersection finding device for a computer-aided design system can refer to the implementation of the above method embodiments, and repeated details will not be elaborated further.
[0138] Figure 14 This diagram illustrates a surface intersection device in a computer-aided design system according to an embodiment of the present disclosure, such as... Figure 14 As shown, the extension device may include: The acquisition unit 1401 is configured to acquire the first parameter domain of the first surface and the second parameter domain of the second surface; The generation unit 1402 is configured to generate an initial mesh on a first parameter domain, the initial mesh containing multiple vertices; The construction unit 1403 is configured to construct a directed distance function from a point on the first surface to the second surface based on the first parameter domain and the second parameter domain. The first determining unit 1404 is configured to determine the unit gradient vector of the directed distance function at each vertex of the initial mesh; Subdivision unit 1405 is configured to identify the first type of edge in the initial mesh based on the directional change between the unit gradient vectors of the two vertices of each edge on the initial mesh, and recursively subdivide the initial mesh containing the first type of edge until a preset condition is met, thereby obtaining the target mesh and the first and second types of edges it contains. The second determining unit 1406 is configured to obtain the critical point of the gradient field of the directed distance function based on the first type of edges and the number of wraps of the target mesh composed of the second type of edges. The tracking unit 1407 is configured to perform intersection line tracking on the first surface and the second surface based on critical points to determine the intersection line of the first surface and the second surface.
[0139] In some embodiments, the tracking unit 1407 is further configured to determine a first starting point on the intersection line based on a critical point; and to perform intersection line tracking on a first surface and a second surface based on the first starting point to determine the intersection line.
[0140] In some embodiments, the tracking unit 1407 is further configured to, if the values of the first parameter domain and the second parameter domain are equal at the critical point, take the critical point as the first starting point; if the values of the first parameter domain and the second parameter domain are not equal at the critical point, determine the isoparametric line corresponding to the first parameter domain at the critical point, determine the first intersection point of the isoparametric line and the second surface, and take the first intersection point as the first starting point.
[0141] In some embodiments, the tracking unit 1407 is further configured to determine a second starting point on the intersection line based on a first parameter domain and a second parameter domain; wherein, obtaining the intersection line based on the first starting point includes: performing intersection line tracking on the first starting point and the second starting point to obtain the intersection line.
[0142] In some embodiments, the tracking unit 1407 is further configured to determine the boundary curve of the first surface based on the first parameter domain, and the boundary curve of the second surface based on the second parameter domain; determine the second intersection point of the boundary curve of the first surface and the second surface, and determine the third intersection point of the boundary curve of the second surface and the first surface; and use the second intersection point and the third intersection point as the second starting point.
[0143] In some embodiments, the subdivision unit 1405 is further configured to subdivide the initial mesh containing first-type edges according to a subdivision strategy; determine whether the target mesh contains first-type edges based on the unit gradient vector of the vertices of the subdivided target mesh; if the target mesh contains first-type edges, continue to subdivide according to the subdivision strategy until a preset condition is triggered to end the subdivision, wherein the preset condition is that there are no first-type edges in the target mesh or the subdivision reaches the maximum number of layers.
[0144] In some exemplary embodiments of this disclosure, the subdivision strategy includes: if there are adjacent first-type edges within a grid, then subdividing the grid into four grids at the midpoint of the grid; if there are no adjacent first-type edges within a grid, then subdividing the grid into two grids at the midpoint of the first-type edges.
[0145] In some embodiments, the second determining unit 1406 is further configured to determine the number of wraps of the target mesh that does not contain the first type of edge when the preset condition is that there is no first type of edge in the target mesh, and record the target mesh with a non-zero number of wraps; and determine the critical point where the gradient of the directed distance function is zero by iteratively using the center point of the target mesh with a non-zero number of wraps as the starting point.
[0146] In some embodiments, the second determining unit 1406 is further configured to, when the preset condition is that the subdivision reaches the maximum number of layers, record all first-type edges, determine the number of wraps of the target mesh that does not contain first-type edges, and record the target mesh with a non-zero number of wraps; and use the midpoint of the first-type edge and the center point of the target mesh with a non-zero number of wraps as the starting point to iteratively determine the critical point where the gradient of the directed distance function is zero.
[0147] In some embodiments, the second determining unit 1406 is further configured to determine the quadrant to which the unit gradient vector at each vertex of the target mesh that does not contain the first type of edge belongs; and to determine the number of wraps of the target mesh based on the quadrant to which the unit gradient vector at each vertex of the target mesh that does not contain the first type of edge belongs.
[0148] In some embodiments, the generation unit 1402 is further configured to uniformly discretize the first parameter domain according to a preset step size to obtain an initial mesh.
[0149] In some embodiments, the subdivision unit 1405 is further configured to determine the quadrant to which the unit gradient vector of each vertex belongs; if the unit gradient vectors of the two vertices of each edge on the initial mesh are not in the same quadrant or adjacent quadrants, and the unit gradient vectors of the two vertices of the edge are not zero vectors, then the edge is determined to be a first type edge.
[0150] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0151] The following reference Figure 15 To describe an electronic device 1500 according to such an embodiment of the present disclosure. Figure 15 The electronic device 1500 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0152] like Figure 15 As shown, the electronic device 1500 is presented in the form of a general-purpose computing device. The components of the electronic device 1500 may include, but are not limited to: at least one processor 1510, at least one memory 1520, and a bus 1530 connecting different system components (including memory 1520 and processor 1510).
[0153] The memory stores program code that can be executed by the processor 1510, causing the processor 1510 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processor 1510 can perform the following steps of the above method embodiments: obtaining a first parameter domain of a first surface and a second parameter domain of a second surface; generating an initial mesh on the first parameter domain, the initial mesh containing multiple vertices; constructing a directed distance function from a point on the first surface to the second surface based on the first and second parameter domains; determining the unit gradient vector of the directed distance function at each vertex of the initial mesh; identifying a first type of edge in the initial mesh based on the directional change between the unit gradient vectors of two vertices of each edge on the initial mesh, and recursively subdividing the initial mesh containing the first type of edge until a preset condition is met to obtain a target mesh and the first and second types of edges it contains; obtaining the critical point of the gradient field of the directed distance function based on the first type of edge and the number of wraps of the target mesh composed of the second type of edge; and performing intersection line tracing on the first and second surfaces based on the critical point to determine the intersection line of the first and second surfaces.
[0154] The memory 1520 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 15201 and / or cache memory 15202, and may further include read-only memory (ROM) 15203.
[0155] The memory 1520 may also include a program / utility 15204 having a set (at least one) of program modules 15205, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0156] Bus 1530 can represent one or more of several types of bus structures, including a memory bus or memory controller, peripheral bus, graphics acceleration port, processor, or a local bus using any of the various bus structures.
[0157] Electronic device 1500 can also communicate with one or more external devices 1540 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more networks that enable users to interact with electronic device 1500, and / or with any device that enables electronic device 1500 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1550. Furthermore, electronic device 1500 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1560. As shown, network adapter 1560 communicates with other modules of electronic device 1500 via bus 1530. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1500, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0158] In the disclosed exemplary embodiments, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium.
[0159] In some possible implementations, various aspects of this disclosure may also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to perform the steps described in the foregoing “Detailed Description” section of this specification according to various exemplary embodiments of this disclosure.
[0160] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0161] In this disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device.
[0162] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0163] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on a terminal device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0164] This disclosure provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a surface intersection method for a computer-aided design system provided in various alternative embodiments of this disclosure.
[0165] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0166] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0167] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0168] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope of this disclosure is indicated by the appended claims.
Claims
1. A method for finding intersections of surfaces in a computer-aided design system, characterized in that, include: Obtain the first parameter domain of the first surface and the second parameter domain of the second surface; An initial mesh is generated on the first parameter domain, the initial mesh containing multiple vertices; Based on the first parameter domain and the second parameter domain, construct a directed distance function from a point on the first surface to the second surface; Determine the unit gradient vector of the directed distance function at each vertex of the initial mesh; Based on the directional change between the unit gradient vectors of the two vertices of each edge on the initial grid, the first type of edge in the initial grid is identified, and the initial grid containing the first type of edge is recursively subdivided until the preset conditions are met, so as to obtain the target grid and the first and second types of edges it contains. Based on the first type of edges and the number of wraps of the target mesh composed of the second type of edges, the critical point of the gradient field of the directed distance function is obtained; Based on the critical point, the intersection line is traced on the first surface and the second surface to determine the intersection line between the first surface and the second surface.
2. The method according to claim 1, characterized in that, The step of tracing the intersection line on the first surface and the second surface based on the critical point to determine the intersection line of the first surface and the second surface includes: Based on the critical point, determine the first starting point on the intersection line; Based on the first starting point, the intersection line is traced on the first surface and the second surface to determine the intersection line.
3. The method according to claim 2, characterized in that, Determining the first starting point on the intersection line based on the critical point includes: If the values of the first parameter field and the second parameter field are equal at the critical point, then the critical point is taken as the first starting point; If the values of the first parameter domain and the second parameter domain at the critical point are not equal, then the isoparametric line corresponding to the first parameter domain at the critical point is determined, the first intersection point of the isoparametric line and the second surface is determined, and the first intersection point is taken as the first starting point.
4. The method according to claim 2, characterized in that, After determining the first starting point on the intersection line based on the critical point, the method further includes: Based on the first parameter domain and the second parameter domain, determine the second starting point on the intersection line; The intersection line is obtained based on the first starting point, including: The intersection line is obtained by tracing the intersection line between the first starting point and the second starting point.
5. The method according to claim 4, characterized in that, Determining the second starting point on the intersection line based on the first parameter domain and the second parameter domain includes: The boundary curve of the first surface is determined based on the first parameter domain, and the boundary curve of the second surface is determined based on the second parameter domain; Determine the second intersection point between the boundary curve of the first surface and the second surface, and determine the third intersection point between the boundary curve of the second surface and the first surface; The second intersection point and the third intersection point are taken as the second starting point.
6. The method according to claim 1, characterized in that, The recursive subdivision of the initial mesh containing the first type of edges includes: For the initial mesh containing first-type edges, subdivide it according to the subdivision strategy; Based on the unit gradient vector of the vertices of the target mesh formed by subdivision, determine whether the target mesh has a first type of edge; If the target mesh has a first type of edge, then continue to subdivide according to the subdivision strategy until a preset condition is triggered to end the subdivision, wherein the preset condition is that there is no first type of edge in the target mesh or the subdivision reaches the maximum number of layers.
7. The method according to claim 6, characterized in that, The segmentation strategy includes: If a grid contains adjacent first-class edges, then the grid is subdivided into four grids at its midpoint; If a grid has no adjacent first-class edges, then the grid is subdivided into two grids at the midpoint of a first-class edge.
8. The method according to claim 6, characterized in that, The step of obtaining the critical point of the gradient field of the directed distance function based on the first type of edges and the number of wraparounds of the target mesh composed of the second type of edges includes: When the preset condition is that there are no first-type edges in the target mesh, the number of wrappings of the target mesh that does not contain first-type edges is determined, and the target mesh with a non-zero number of wrappings is recorded. Starting from the center point of the target mesh with a non-zero wrapping number, the critical point where the gradient of the directed distance function is zero is determined iteratively.
9. The method according to claim 6, characterized in that, The step of obtaining the critical point of the gradient field of the directed distance function based on the first type of edges and the number of wraparounds of the target mesh composed of the second type of edges includes: When the preset condition is triggered, the subdivision reaches the maximum number of layers, then all first-type edges are recorded, the number of wraps of the target mesh that does not contain first-type edges is determined, and the target mesh with a non-zero number of wraps is recorded. Starting from the midpoint of the first type of edge and the center point of the target mesh with a non-zero wrapping number, the critical point where the gradient of the directed distance function is zero is determined iteratively.
10. The method according to claim 8 or 9, characterized in that, Determining the number of wraps of the target mesh that does not contain first-type edges includes: Determine the quadrant to which the unit gradient vector at each vertex of the target mesh that does not contain first-type edges belongs; The number of wraps around the target mesh is determined based on the quadrant to which the unit gradient vector at each vertex of the target mesh that does not contain first-type edges belongs.