CAD model construction method based on fast nurbs surface intersection algorithm
By using Nurbs -based surface -based methods in the CAD system to quickly find algorithms, the problem of lack of efficiency and topological accuracy of the Nurbs curved surface algorithm in the existing technology, the efficient and accurate line calculation is achieved, and the CAD model has been enhanced. Construction stability.
Patent Information
- Application Number
- PCT/CN2024/106921
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-24
- Filing Date
- 2024-07-23
- Publication Date
- 2025-01-30
AI Technical Summary
The existing CAD system lacks an efficient NURBS surface interleaving algorithm that can ensure topological accuracy, resulting in low system reliability.
Provide a CAD model construction method based on the Nurbs curved surface quickly seeking algorithm. By constructing the direction of the enclosure box for collision detection, the decomposition surface is the Bezier curved surface, and the parameter curved surface rapid implicitization, characteristic point calculation, curve tracking and interchange cutting. Make sure the topology is correct.
Improve the calculation efficiency and accuracy of Nurbs curved surface to sequential intercourse, ensure that the topology of the cross line is more stable, and make the CAD model construction more stable.
Smart Images

Figure CN2024106921_30012025_PF_FP_ABST
Abstract
Description
CAD model construction method based on fast NURBS surface intersection algorithm
[0001] Cross-references
[0002] The present disclosure claims priority to Chinese invention patent application number 202310911850.6 filed on July 24, 2023, entitled “CAD model construction method based on NURBS surface fast intersection algorithm”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the field of CAD / CAM and geometric modeling technology, and more particularly to a CAD model construction method based on a fast NURBS surface intersection algorithm. Background Art
[0004] NURBS surface intersection is a fundamental task in Computer Aided Design (CAD) and geometric modeling systems. Many CAD modeling operations, such as Boolean operations, mesh generation, and rendering, require efficient, robust, and topologically correct NURBS surface intersection algorithms. Currently, the industry generally agrees that the main reason for the low reliability of CAD systems is the lack of efficient, topologically correct NURBS surface intersection algorithms.
[0005] Methods for finding NURBS surface intersections fall into two main categories: algebraic and discrete. The surface intersection method disclosed in this paper is an algebraic method. Compared to discrete methods, it can ensure the topological correctness of the intersection line and avoid missing isolated points and small loops in the intersection line. Furthermore, this method improves computational efficiency compared to traditional algebraic methods.
[0006] Summary of the Invention
[0007] In view of this, the present disclosure provides a CAD model construction method based on a fast NURBS surface intersection algorithm, which ensures the topological correctness of the intersection line of two NURBS surfaces in CAD and can quickly calculate the intersection line, making the construction of surface models in CAD more robust.
[0008] In order to achieve the above objectives, the present disclosure provides the following technical solutions:
[0009] A CAD model construction method based on a fast NURBS surface intersection algorithm comprises the following steps:
[0010] S1. Construct an original CAD model including a set of NURBS surfaces, and perform collision detection on the directional bounding boxes formed by the control points of each two NURBS surfaces;
[0011] S2. If the bounding boxes intersect, the NURBS surface is divided into multiple Bezier surfaces;
[0012] S3, performing collision detection on the directional bounding box formed by the control points of the Bezier surface;
[0013] S4. For the surface pair (P1, Q1) where the bounding box collision is detected, select the surface P1 with a lower degree to perform fast implicit parametric surface conversion;
[0014] S5. Substitute the parameter representation of Q1 into the implicit equation of P1 to obtain the implicitly expressed two-dimensional intersection line, and use the resultant to calculate its characteristic points;
[0015] S6. Using the feature point as a starting point, curve tracing is performed on the two-dimensional implicit curve;
[0016] S7, lifting the tracked two-dimensional intersection line to a three-dimensional space to obtain a three-dimensional intersection line;
[0017] S8. Calculate the intersection point of the boundary line of P1 and the three-dimensional intersection line, and split the three-dimensional intersection line into multiple branches at the intersection point;
[0018] S9, calculate the parameter value on P1 corresponding to any point on the branch;
[0019] S10, judging whether the branch needs to be trimmed based on whether the parameter value falls within the parameter domain, and obtaining the final intersection line;
[0020] S11. Trim the NURBS surface according to the obtained intersection line to construct the final CAD model.
[0021] Optionally, in S2, the NURBS surface is split into multiple Bezier surfaces by inserting nodes.
[0022] Optionally, in S3, collision detection is performed on the directional bounding boxes formed by the control points of the Bezier surface, non-intersecting areas are quickly screened out, and intersecting Bezier surface pairs (P1, Q1) are retained, and they are converted into parametric surface representations.
[0023] Optionally, in S4, the implicitization of the parametric surface P1 is quickly calculated by the moving plane accompanying it.
[0024] Optionally, in S6, the feature point is used as the starting point to perform curve tracing on the two-dimensional implicit curve. By giving a step size and tracing direction, and taking the next feature point or parameter domain boundary as the termination condition, the Newton method is used to iteratively calculate the two-dimensional intersection point sequence.
[0025] Optionally, in S7 , the two-dimensional intersection point sequence obtained by tracing is brought into the parametric surface Q1 to obtain a three-dimensional intersection point sequence.
[0026] Optionally, discrete sampling is performed on the boundary line of P1 in S8 to find points in the three-dimensional intersection point sequence whose distance from the boundary line point sequence of P1 is less than a given error, and these points are recorded as the intersection points of the boundary line and the three-dimensional intersection line. At these intersection points, the intersection line is divided into multiple branches.
[0027] Optionally, in S9 , the kernel space of the Dixon matrix corresponding to any point on the branch is calculated to obtain the parameter value on P1 corresponding to the point.
[0028] Optionally, in S10 , the branches to be pruned are determined by determining whether the parameter value of any point in each branch falls within the parameter domain of P1 , retaining the branches within the parameter domain and discarding the branches outside the parameter domain. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0030] FIG1 is a flow chart of a method for constructing a CAD model based on a fast NURBS surface intersection algorithm provided by the present disclosure;
[0031] FIG2 is a specific flow chart of the fast implicitization process based on the moving plane theory in step S4 of the present disclosure.
[0032] FIG3 is a schematic diagram of the results of the feature point calculation process in step S5 of the present disclosure;
[0033] FIG4 is a schematic diagram showing the result of the intersection line lifting process in step S7 of the present disclosure;
[0034] FIG5 is a schematic diagram of the results of the three-dimensional intersection cutting process in steps S8-S10 of the present disclosure;
[0035] FIG6 is a schematic diagram of calculation for determining whether an intersection branch is retained in step S10 of the present disclosure;
[0036] FIG7 is a diagram showing a comparison of the intersection line topology and intersection time of the present disclosure and other existing methods in calculating the intersection line of NURBS surfaces;
[0037] FIG8 is a graph comparing the time taken by the method disclosed herein for calculating the intersection line between an ellipsoid and a torus and the intersection method of the industrial software ACIS;
[0038] FIG9 is a schematic diagram showing the results of calculating the intersection lines of NURBS surfaces with different intersection line topologies according to the present disclosure. DETAILED DESCRIPTION
[0039] The following will be combined with the accompanying drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present disclosure.
[0040] 1 , the present disclosure provides a CAD model construction method based on a fast NURBS surface intersection algorithm, comprising the following steps:
[0041] S1. Construct an original CAD model including a set of NURBS surfaces, perform collision detection on the directional bounding boxes formed by the control points of each two NURBS surfaces, and determine whether the directional bounding boxes of the two NURBS surfaces intersect;
[0042] S2. If the bounding boxes intersect, the NURBS surface is divided into multiple Bezier surfaces;
[0043] S3, performing collision detection on the directional bounding box formed by the control points of the Bezier surface;
[0044] S4. For the surface pair (P1, Q1) where the bounding box collision is detected, select the surface P1 with a lower degree to perform fast implicit parametric surface conversion;
[0045] S5. Substitute the parameter representation of Q1 into the implicit equation of P1 to obtain the implicitly expressed two-dimensional intersection line, and use the resultant to calculate its characteristic points;
[0046] S6. Using the feature point as a starting point, curve tracing is performed on the two-dimensional implicit curve;
[0047] S7, lifting the tracked two-dimensional intersection line to a three-dimensional space to obtain a three-dimensional intersection line;
[0048] S8. Calculate the intersection point of the boundary line of P1 and the three-dimensional intersection line, and split the three-dimensional intersection line into multiple branches at the intersection point;
[0049] S9, calculate the parameter value on P1 corresponding to any point on the branch;
[0050] S10, judging whether the branch needs to be trimmed based on whether the parameter value falls within the parameter domain, and obtaining the final intersection line;
[0051] S11. Trim the NURBS surface according to the obtained intersection line to construct the final CAD model.
[0052] Specifically, in step S1, collision detection is performed on the directional bounding boxes formed by the control points of the NURBS surfaces P and Q.
[0053] The input of the present disclosure is two NURBS surfaces P and Q of degree (k1, l1) and (k2, l2). The value ranges of k1, l1 and k2, l2 are all positive integers, representing the degree of NURBS surfaces P and Q respectively. Their control points The weights W1, W2 and node vectors U1, V1, U2, V2 are:
[0054] Among them, the control point The weights W1, W2 and the node vectors U1, V1, U2, V2 together define the NURBS surfaces P, Q, which are the parameter representations of the NURBS surfaces P, Q. i,j} represents the control points of the NURBS surface P. m1 is used to record the control points The number of control points in a parameter direction is a non-negative integer. n1 is used to record the control points. The number in the direction of another parameter is a non-negative integer. i,j} is the control point {p i,j} corresponding weight. is the node vector of the surface P in the direction of the first parameter, where each u 1,i ,i∈{0,1,...,m1+k1} are all real numbers and satisfy u 1,i ≤u 1,i+1 . is the node vector of the surface P in the direction of the second parameter, where each v 1,i ,i∈{0,1,…,n1+l1} are all real numbers and satisfy v 1,i ≤v 1,i+1 . {q i,j} represents the control points of the NURBS surface Q. m2 is used to record the control points The number of control points in a parameter direction is a non-negative integer. n2 is used to record the control points. The number in the direction of another parameter is a non-negative integer. i ' ,j} is the control point {q i,j} corresponding weight. is the node vector of the surface Q in the direction of the first parameter, where each u 2,i ,i∈{0,1,…,m2+l2} are all real numbers and satisfy u 2,i ≤u 2,i+1 . is the node vector of the surface Q in the direction of the second parameter, where each v 2,i ,i∈{0,1,…,n2+l2} are all real numbers and satisfy v 2,i ≤v 2,i+1 Calculate the control points of surface P based on the above parameters The direction of the bounding box Box1 and the control points of the surface Q The bounding box Box2 is in the direction of the intersection. If Box1 and Box2 do not intersect, it means that the two surfaces do not intersect, and the result is no intersection. If Box1 and Box2 do intersect, it means that the two surfaces may intersect.
[0055] Step S2: If the directional bounding boxes Box1 and Box2 of the two surfaces in S1 intersect, decompose the surface P and the surface Q into several (multiple, ie, two or more) Bezier surfaces by inserting nodes.
[0056] Converting a NURBS surface to a Bezier surface involves a process called knot insertion, which aims to make the knot vectors of the NURBS surface uniform so that each interval contains only one non-zero basis function. This makes each interval correspond to a separate Bezier surface.
[0057] Step S3: Calculate whether the bounding boxes of the control points on the Bezier surface collide, and obtain a series of Bezier surfaces with colliding bounding boxes: (P1, Q1), (P2, Q2), ..., (P r ,Q r ). Wherein, r is an integer greater than or equal to 1.
[0058] Step S4: For all Bezier surfaces obtained by S3 (P1, Q1), (P2, Q2), ..., (P r ,Q r ), similar operations are performed on the surface (P1, Q1). Write the Bezier surface P1, Q1 as homogeneous parametric representation P1(u, v), Q1(s, t):
[0059] P1(u,v)=(a1(u,v),b1(u,v),c1(u,v),d1(u,v)) (7)
[0060] Q1(s,t)=(a2(s,t),b2(s,t),c2(s,t),d2(s,t)) (8)
[0061] Here, u and v are two variables represented by the polynomial parameters corresponding to the Bezier surface P1, representing the parametric domain of the Bezier surface P1. s and t are two variables represented by the polynomial parameters corresponding to the Bezier surface Q1, representing the parametric domain of the Bezier surface Q1. a1(u,v), b1(u,v), c1(u,v), and d1(u,v) are bivariate polynomials, respectively. (a1(u,v) / d1(u,v), b1(u,v) / d1(u,v), c1(u,v) / d1(u,v)) represents the three-dimensional parametric representation of the Bezier surface P1. The degrees of P1(u,v) and Q1(s,t) are (k1,l1) and (k2,l2), respectively. We take the parametric surface with the lower implicit degree, let's set it as P1(u,v), and perform a quick implicitization. The implicit degree is the degree of the implicitized polynomial. Here, we take the parametric surface with the smaller degree and parameter. For example, here we assume that k1+l1 is less than k2+l2. Specifically, it includes the following:
[0062] Step S41: Calculate the three moving planes corresponding to the parametric surface P1:
[0063] f:=d1(u,v)x-a1(u,v)w (9)
[0064] g:=d1(u,v)y-b1(u,v)w (10)
[0065] h:=d1(u,v)z-c1(u,v)w (11)
[0066] Here, f, g, and h represent three polynomials, which are also the moving planes with respect to u and v. x, y, z, and w are four newly introduced variables used to define the moving plane.
[0067] Step S42: Calculate the corresponding Dixon matrix based on the three moving planes:
[0068] Given three polynomials f(u,v), g(u,v), h(u,v) of degree (k1,l1), these three polynomials are the three moving planes mentioned above. The corresponding 2k1l1×2k1l1 Dixon matrix D(f,g,h) is defined as α and β are intermediate unknown quantities introduced and finally eliminated.
[0069] Step S43: Find the largest linearly independent minor of the Dixon matrix.
[0070] The implicit equation of the Bezier surface P1(u,v) is the greatest common divisor of the largest linearly independent determinant of D(f,g,h). Since it is difficult to directly calculate the rank of D(f,g,h), a practical strategy is given here. Randomly generate a set of parameters Xi =(x i ,y i ,z i ,w i ), i=1,2,…,k and bring it into the Dixon matrix to calculate r i =rank(D(X i )). Most of r i The value of is the same as the rank of the Dixon matrix, these r i The linearly independent rows of the corresponding numerical matrix are the maximum linearly independent rows of the original Dixon matrix. Through this strategy, the maximum linearly independent minor of the polynomial matrix, which was originally difficult to calculate, is converted into the linearly independent rows of the numerical matrix, which is easy to calculate, greatly improving the calculation efficiency. i ,y i ,z i ,w i is any real number assigned to variables x, y, z, and w. k is the parameter X i The value range is a positive integer, and the value in the experiment is 10.
[0071] Step S44: Obtain the determinant of the minor equation to obtain the implicit form of the parametric surface. Obtain the determinant of a series of maximal linearly independent minor equations obtained in step S43, and then take the greatest common formula to obtain the implicit equation F(x, y, z, w) = 0 of the parametric surface P1(u, v).
[0072] Step S4 is a process of performing implicitization by constructing a Dixon matrix through three moving planes. Compared with the implicitization based on the Grobner basis in the related art, it has higher computational efficiency.
[0073] Step S5: Substitute the parameter representation Q1(s, t) of Q1 into the implicit equation F(x, y, z, w) = 0 of P1:
[0074] g(s,t):=F(a2(s,t),b2(s,t),c2(s,t),d2(s,t)) (12)
[0075] Obtain the implicitly expressed two-dimensional intersection line s0, s1 and t0, t1 are all real numbers, representing the range of the parametric surface Q1. is the projection of the intersection line of the implicit surface corresponding to the parametric surface Q1 and the parametric surface P1 on the parameter domain (s, t). Find g(s, t) and About the result of t Calculate the real roots of R(s)=0 in the parameter domain s∈[s0,s1] and obtain α1,α2,…,α n, and their corresponding real root isolation intervals [l1,r1], [l2,r2],…, [l n ,r n ]. Where l i ,r i , i∈{1,2,…,n} is a rational number, n is a positive integer greater than or equal to 1. Then each l i ,r i Substitute into g(s,t) and solve g(l i ,t)=0 and g(r i ,t)=0 in the parameter domain t∈[t0,t1]. Finally, several characteristic points are obtained. The characteristic points of the implicit curve are calculated through the resultant, thus ensuring the topological correctness of the intersection line. The implicit representation of the intersection line in the two-dimensional parameter domain is called the implicit intersection line or implicit curve.
[0076] Step S6: Using the feature point calculated in step S5 as the starting point, perform curve tracing on the two-dimensional implicit curve (two-dimensional implicit intersection line, i.e., the implicitly expressed two-dimensional intersection line). The tracing method is divided into two parts. Take any feature point p1 as an example:
[0077] (1) Initial estimate: denoted by p l =(s,t), and the curve The equation that is satisfied is F(s,t)=0. The F here is the same as the F(x,y,z,w) mentioned above. Then the initial estimate of the next tracking point by the tracking method is (s+Δs (0) ,t+Δt (0) ),satisfy:
[0078] where Δs (0) Is a small real number, indicating the distance s increases, and is taken as 0.001 in the experiment. (0) F is a small real number, indicating the distance t increases, and is taken as 0.001 in the experiment. t (s,t) is the partial derivative of the polynomial F with respect to t. F s (s, t) is the partial derivative of the polynomial F with respect to s. h is a given marching step length or a given step size, which is a small positive real number. In this experiment, 0.05 is given.
[0079] (2) Newton iteration: Assume that (Δs (j) ,Δt (j) ),but
[0080] The j in formulas (15) and (16) is a local variable used for counting, and its value range is a positive integer. It has a different meaning from the j in the above formulas (1)-(5). The iteration step continues until (Δs (j) ,Δt (j) ) and (Δs (j+1) ,Δt (j+1) ) is less than the given value ∈. The l2 distance can be the Euclidean distance between two points, but the present disclosure is not limited thereto. The given value ∈ is a very small positive number, which is given as 1e-6 in the experiment. At this time, the next step point of p1 is p l+1 =(s+Δs (j) ,t+Δt (j) ). l+1 Repeat the above two steps for the starting point to trace on the curve until the step point encounters the next feature point or the parameter domain boundary.
[0081] The parameter domain of a NURBS surface is usually a rectangular region whose boundaries are formed by four edges. These boundaries determine the range of values of the surface parameters u and v. For example, suppose the parameter domain of surface P1 is [u0,u1]×[v0,v1], and its four boundaries are:
[0082] Step S7: The tracked two-dimensional intersection point sequence is promoted to three-dimensional space. For each two-dimensional point (s, t), its corresponding three-dimensional point is:
[0083]
[0084] Then we get the intersection point sequence in three-dimensional space
[0085] Step S8: First, sample u and v on the four boundary lines of P1 with a step size of 1 / N, where N is a positive integer and is 100 in the experiment. Then a series of boundary points are obtained. Here, α is a local count, indicating the number of boundary points obtained, which is different from the α in the aforementioned Dixon matrix D(f,g,h). Specifically, determine whether there is a point in the three-dimensional intersection point sequence that is close enough to the boundary point T. If there is such an intersection point p, the intersection line is broken at point p, and the intersection line branch is finally obtained.
[0086] Step S9: Calculate the parameter value on P1 corresponding to any point on the branch. i=1,2,…,γ, any point q i , if q iThe parameter value (u,v)∈[u0,u1]×[v0,v1] calculated by the Dixon matrix, then this branch is retained; otherwise, if q i The parameter value (u, v) calculated by the Dixon matrix is outside the parameter domain [u0,u1]×[v0,v1], then is discarded. γ is a positive integer representing the number of intersection branches obtained. u0, u1 and v0, v1 are all real numbers, representing the range of values of the parametric surface P1. For any point X on P1: = (x, y, z, 1) that satisfies the implicit equation F (x, y, z, 1) = 0 corresponding to the parametric surface P1, its parameter value can be represented by the kernel space of the numerical matrix of the Dixon matrix at this point. Specifically, the parameter value (u * ,v * ) satisfies D(X)U(u * ,v * )=0. Solve D(X)U=0 for the roots of (u,v). If there exists a solution (u,v)∈[u0,u1]×[v0,v1], then point X is within the parameter range of the parametric surface P1. If all real roots (u,v) are outside the parameter domain [u0,u1]×[v0,v1], then point X is not on the parametric surface P1.
[0087] Step S10: Calculate the parameter value of any point on each branch according to S9, and determine the branch that needs to be cut by whether it falls within the parameter domain to obtain the final intersection line.
[0088] It can be seen from the above technical solutions that, compared with related technologies, the present disclosure provides a CAD model construction method based on a fast NURBS surface intersection algorithm, which has the following beneficial effects:
[0089] (1) Improve computational efficiency. In this method, collision detection of the bounding box of the NURBS surface can quickly filter out non-intersection areas, and the surface fast implicitization process of this method greatly shortens the computation time compared with traditional implicitization methods.
[0090] (2) Enhanced computational accuracy. Symbolic computation can produce analytical equations or expressions, thereby reducing rounding errors in numerical calculations. This helps improve computational accuracy and stability.
[0091] (3) Ensure the topological correctness of the intersection line. This method calculates the feature points of each branch of the intersection line and performs curve tracing, and then cuts the intersection line to ensure the topological correctness of the intersection line. The intersection line is quickly calculated, making the construction of the surface model in CAD more robust.
[0092] As shown in FIG2 , step S4 is divided into step S41 : calculating the three moving planes corresponding to the parametric surface P1 :
[0093] f:=d1(u,v)x-a1(u,v)w
[0094] d:=d1(u,v)y-b1(u,v)w
[0095] h:=d1(u,v)z-c1(u,v)w
[0096] Step S42: Calculate the corresponding Dixon matrix based on the three moving planes:
[0097] Given three polynomials f(u,v), g(u,v), h(u,v) of degree (k1,l1), the corresponding 2k1l1×2k1l1 Dixon matrix D(f,g,h) is defined as The determined result.
[0098] Step S43: Find the largest linearly independent minor of the Dixon matrix.
[0099] The implicit equation of the Bezier surface P1(u,v) is the greatest common divisor of the largest linearly independent determinant of D(f,g,h). Since it is difficult to directly calculate the rank of D(f,g,h), a practical strategy is given here. Randomly generate a set of parameters X i =(x i ,y i ,z i ,w i ), i=1,2,…,k and bring it into the Dixon matrix to calculate r i =rank(D(X i )). Most of r i The value of is the same as the rank of the Dixon matrix, these r i The linearly independent rows of the corresponding numerical matrix are the largest linearly independent rows of the original Dixon matrix.
[0100] Step S44: Obtain the determinant of the minor equation to obtain the implicit form of the parametric surface. Obtain the determinant of a series of maximal linearly independent minor equations obtained in step S43, and then take the greatest common formula to obtain the implicit equation F(x, y, z, w) = 0 of the parametric surface P1(u, v).
[0101] FIG3 shows an example of the process of calculating feature points in step S5 of the present disclosure. l and P rare the left and right auxiliary points corresponding to the feature points. The curve in the figure is the image of the curve g(s,t)=0 in the parameter domain [s,t]∈[-1,1]×[0,2]. In the figure above, α1, α2, α3 are the s coordinates of the critical points, and the vertical dotted line gives the α i , i=1,2,3 isolation intervals. The curve g(s,t)=0 intersects the left values of all isolation intervals with left helping points. Indicates that the right helping points are obtained by intersecting all the right values of the isolation interval. In the example in Figure 3, there is a singular point, and the auxiliary points near it can also be found smoothly.
[0102] Figure 4 illustrates the process of lifting a 2D intersection line to 3D in step S7 of the present disclosure. The top figure shows the 2D intersection line, where different numbers represent different sub-branches. The bottom figure shows the lifted 3D curve and its views from different perspectives. Each sub-branch in the 3D curve corresponds one-to-one with a sub-branch in the 2D curve.
[0103] As shown in Figure 5, the three-dimensional intersection line clipping process of steps S8-S10 of the present disclosure is shown. Figure (a) is a schematic diagram of the curve and surface before clipping. The different numbers in Figure (b) represent different sub-branches of the intersection line on the parameter domain (s, t). Figure (c) shows the discrete point sampling of the boundary of the surface P1 in step S8, and the dotted points are the boundary points. Figure (d) shows the intersection of the boundary and the curve calculated in step S8, indicated by asterisks. Figure (e) shows the intersection line sub-branches after screening in steps S9-S10. Figure (f) shows the intersection line of the surface and the final calculation.
[0104] Figure 6 illustrates the analysis process for determining whether to retain an intersection branch in step S10. The first column records the different intersection sub-branches before clipping. The second column records whether these branches intersect the boundary. The third column records the intersection values for branches that intersect the boundary. The fourth column records the branches after splitting at the intersection. The fifth column calculates whether each split branch should be retained, as determined in step S9.
[0105] As shown in Figure 7, this is a comparison result graph of the intersection line topology and intersection time of the present disclosure and the intersection algorithm based on affine arithmetic and GPU acceleration (AA-GPU), the grid-based intersection algorithm (Mesh Booleans), the intersection algorithm in the open source software OCCT, SISL, and the intersection algorithm in the commercial software ACIS in calculating the intersection line topology of the NURBS surface intersection line. It can be found from the figure that the algorithm provided by the embodiment of the present disclosure can ensure the intersection line topology when the surfaces are tangent or intersect at an isolated point, while other methods have more or less lost some intersection lines, or have problems with intersection line calculation errors. In terms of efficiency, the algorithm provided by the embodiment of the present disclosure maintains the same order of magnitude as the other algorithms. Wherein NULL indicates that the method does not return an intersection result in this example. N / A indicates that the method reports an error when running in this example. A tangent line indicates that the topology of the intersection is a tangent line; a tangential curve indicates that the topology of the intersection is a tangent curve; a loop and two curves indicates that the topology of the intersection is a closed loop and two open intersections; two loops indicates that the topology of the intersection is two closed loops; a loop and a point indicates that the topology of the intersection is a closed loop and an isolated intersection point.
[0106] Figure 8 compares the time taken by our method and the ACIS method for calculating the intersection of an ellipsoid and a torus. The results show that both our method and the ACIS method can obtain the correct topology of the intersection line. In the case of forks (indicated by bold points), our method is more efficient than the ACIS method.
[0107] Figure 9 compares the intersection results of our algorithm with those of the open-source software OCC and the commercial software ACIS when computing intersections of NURBS surfaces with different intersection topologies. From the figure, we can conclude that our intersection algorithm is robust to various intersection topologies, including (a) forks, (b) isolated tangents, (c) and (d) boundary intersections, (e) intersections of different branches, (f) high-order tangents, and (g) multiple isolated intersections. The intersections of our algorithm are shown in the last row, while the results of ACIS and OCCT are shown in the third and second rows, respectively. "NULL" indicates a null curve. Examples with dashed bounding boxes indicate incorrect topology under our method. Our method provides correct intersection topology in all cases, while ACIS and OCCT sometimes make errors.
[0108] The disclosed technical solution proposes a CAD model construction method based on a fast intersection algorithm for NURBS surfaces. In this method, symbolic calculation is used for the fast implicitization and solution of feature points, and numerical calculation is used for the curve tracing and curve clipping parts, which effectively combines the accuracy of symbolic calculation and the efficiency of numerical calculation. In the process of implicitization of the moving plane, the idea of symbolic calculation is used to obtain the implicitization of the parametric surface, that is, the Dixon matrix is constructed by the moving plane, and the idea of symbolic calculation is used in the process of implicitization of the surface. The parameters of the NURBS surfaces targeted by this method are all floating-point numbers, and the use of numerical methods in the specific calculation process makes the algorithm more efficient. The topological structure of the intersection of NURBS surfaces is often complex and changeable. It may contain forks, isolated intersections, boundary intersections, different intersection branches, high-order tangents and singular points. When two NURBS surfaces are in a special relative position, such as tangent or intersecting in a small ring, the existing methods are often unable to correctly calculate all the intersections. For example, when searching for intersections, the subdivision method iteratively and discretely subdivides the parameter domain of the surface, which may result in the omission of tangents or small loops. In contrast, our algorithm can find all intersection branches and ensure the correctness of the intersection topology. When screening the intersection area, our algorithm uses collision detection of the bounding box of the NURBS control point direction to quickly filter out non-intersection areas. In the algebraic method, the moving plane method is used to quickly implicitly transform the surface, which improves the computational efficiency compared to the classical implicitization method. In the process of intersection clipping, the Dixon matrix is fully utilized to solve the parameters of the intersection point, quickly filtering out unnecessary intersection branches.
[0109] The above experimental results and the method for calculating the intersection of two NURBS surfaces can be used in many aspects such as Boolean operations, mesh generation and rendering, hidden surface removal and manufacturing, and have high practical application value.
[0110] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0111] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present disclosure. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments shown herein, but is intended to be construed in the widest manner consistent with the principles and novel features disclosed herein.
Claims
1. A CAD model construction method based on a fast NURBS surface intersection algorithm, comprising the following steps: S1. construct an original CAD model including a set of NURBS surfaces, and perform collision detection on the directional bounding boxes formed by the control points of each two NURBS surfaces; S2. If the bounding boxes intersect, the NURBS surface is divided into multiple Bezier surfaces; S3, performing collision detection on the directional bounding box formed by the control points of the Bezier surface; S4. For the Bezier surface pair (P1, Q1) where the bounding box collision is detected, select the parametric surface with a lower degree in P1 and Q1, perform fast implicitization on the parametric surface, and obtain the implicit equation of P1; S5, substituting the parameter representation of Q1 into the implicit equation of P1 to obtain the implicitly expressed two-dimensional intersection line, and using the resultant to calculate its characteristic points; S6, taking the feature point as the starting point, performing curve tracing on the two-dimensional implicit curve; S7, lifting the traced two-dimensional intersection line to a three-dimensional space to obtain a three-dimensional intersection line; S8, calculating the intersection point of the boundary line of P1 and the three-dimensional intersection line, and splitting the three-dimensional intersection line into multiple branches at the intersection point; S9, calculate the parameter value on P1 corresponding to any point on the branch; S10, judging whether the branch needs to be cut according to whether the parameter value falls within the parameter domain, and obtaining the final intersection line; S11. The NURBS surface is trimmed according to the final intersection line obtained to construct a final CAD model.
2. A CAD model construction method based on a fast NURBS surface intersection algorithm according to claim 1, wherein: In S2, the NURBS surface is split into multiple Bezier surfaces by inserting nodes.
3. A CAD model construction method based on a fast NURBS surface intersection algorithm according to claim 1, wherein: In S3, collision detection is performed on the directional bounding box formed by the control points of the Bezier surface, non-intersecting areas are quickly screened out, and the intersecting Bezier surface pairs (P1, Q1) are retained and converted into parametric surface representations.
4. A CAD model construction method based on a fast NURBS surface intersection algorithm according to claim 1, wherein: In S4, the implicitization of the parametric surface P1 is quickly calculated by the moving plane accompanying it.
5. The CAD model construction method based on the NURBS surface fast intersection algorithm according to claim 1, wherein: In S6, the characteristic point is used as the starting point to trace the two-dimensional implicit curve. By giving a given step size and taking the next characteristic point or the parameter domain boundary as the termination condition, the Newton method is used to iteratively calculate the two-dimensional intersection point sequence.
6. A CAD model construction method based on a fast NURBS surface intersection algorithm according to claim 5, wherein: In S7, the two-dimensional intersection point sequence obtained by tracking is brought into the parametric surface Q1 to obtain a three-dimensional intersection point sequence.
7. A CAD model construction method based on a fast NURBS surface intersection algorithm according to claim 6, wherein: In S8, discrete sampling is performed on the boundary line of P1 to obtain the P1 boundary line point sequence, and points in the three-dimensional intersection line point sequence whose distance to the P1 boundary line point sequence is less than a given error are found, and these points are recorded as the intersection points of the boundary line of P1 and the three-dimensional intersection line. At these intersection points, the intersection line is divided into multiple branches.
8. The CAD model construction method based on the NURBS surface fast intersection algorithm according to claim 1, wherein: In S9, the kernel space of the Dixon matrix corresponding to any point on the branch is calculated to obtain the parameter value on P1 corresponding to the point.
9. The CAD model construction method based on the NURBS surface fast intersection algorithm according to claim 1, wherein: In S10, the parameter value of any point in each branch is determined by whether it falls within the parameter domain of P1. Branches that fall within the parameter domain are retained, and branches that fall outside the parameter domain are discarded.
10. The CAD model construction method based on the NURBS surface fast intersection algorithm according to claim 1, wherein: Step S7 specifically includes: lifting the tracked two-dimensional intersection point sequence to three-dimensional space. For each two-dimensional point (s, t), its corresponding three-dimensional point is: Then we get the intersection point sequence in three-dimensional space
Citation Information
Patent Citations
AST spline surface rapid reconstruction algorithm based on local refinement solution
CN111914450A
Method for calculating intersection of rational parameter curved surface based on moving plane and matrix
CN114880854A
Optical system high-precision ray tracing method and device based on NURBS surface
CN115453753A
Method for calculating intersection point of ray tracing and NURBS curved surface based on curvature subdivision
CN116310048A
CAD model construction method based on NURBS curved surface rapid intersection algorithm
CN116910834A
Cited By
Industrial mold curved surface filling method and device
CN120764218A
Flexible cable path layout geometric model construction method and device
CN121960350A