Universal parametric curved surface intersection method

By combining the hierarchical bounding volume and tracking methods, the efficiency and accuracy problems of surface intersection calculation in CAD are solved, and an efficient and robust surface intersection method is realized, which is suitable for a variety of parametric surfaces, especially when dealing with complex intersection lines. This avoids double counting and improves accuracy.

CN118569004APending Publication Date: 2024-08-30ZHEJIANG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411055313.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

It is difficult to implement efficient, robust and high-precision surface intersection calculations in computer-aided design (CAD) with existing technology. Especially when dealing with complex surface intersection situations, it is easy to miss isolated tangent points or small loops, making it difficult to balance calculation efficiency. and accuracy.

Method used

A method based on a combination of bounding volume hierarchies (BVH) and tracking methods is used to construct and judge intersections, solve starting points, track and calculate intersections through BVH, and perform adaptive step size adjustment and topological tangent point determination during the tracking process to avoid Repeat calculations and improve accuracy.

Benefits of technology

It implements efficient, robust and high-precision surface intersection calculations, is suitable for different types of parametric surfaces, has high versatility, and can accurately handle closed ring intersections and cross intersections, avoiding repeated calculations of the same intersection. Improved computational efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569004A
    Figure CN118569004A
Patent Text Reader

Abstract

The invention discloses a universal parametric curved surface intersection solving method. A universal parametric curved surface intersection solving frame, namely an integral frame of BVH bounding volume construction, starting point and singular point calculation, intersection line tracking, repeated intersection line filtering and tracking termination, is provided. The method comprises the following steps: firstly, constructing BVH and judging intersection to obtain an intersection bounding box pair; calculating a starting point to start a tracking method to calculate an intersection line; screening an effective starting point to avoid repeated calculation; an adaptive intersection step length is adopted in the tracking intersection process, and stopping conditions of different intersection lines are considered; carrying out topology check on the obtained points in the solving of the starting point and the tracking calculation of the intersection line, and distinguishing and accurately calculating isolated tangent points, tangent points on tangent lines and cross singular points; in addition, the bounding box where each intersection point of the intersection lines obtained each time is located is marked to avoid repeated tracking. The method is suitable for various parameter curved surface situations, can obtain all intersecting line branches, effectively processes singular and annular intersecting line situations and the like, and has the advantages of high efficiency, high precision, robustness and high universality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of industrial software and relates to a method for finding the intersection of general parametric surfaces, which is mainly used as an underlying algorithm in industrial software in the field of computer-aided design. Background Art

[0002] The calculation of intersection lines between surfaces is one of the most basic and core key issues of Computer Aided Design (CAD) industrial software. It is the "root" technology of key modules of industrial software such as Boolean operations, complex structure / surface modeling, manufacturing process simulation and control, and one of the basic technologies that must be possessed in building CAD / CAM systems. In academia, robust and efficient surface intersection is still an unresolved technical problem; in industry, domestic CAD kernels still lack effective surface intersection solutions and related modules. At present, mainstream industrial software, such as Dassault CATIA, Siemens NX, etc., all use the classic Non-Uniform Rational B-Splines (NURBS) surface / curve representation. How to achieve accurate and efficient intersection calculation of NURBS surfaces is a difficult and important problem with practical industrial value.

[0003] The intersection of two surfaces is very complex, including closed loops, self-intersections, isolated points, point tangency, line tangency, and other ambiguous situations. Detecting and describing all these intersection situations and calculating them correctly and accurately are key indicators for measuring surface learning algorithms. At present, parametric surface intersection techniques can be generally divided into five categories:

[0004] Algebraic method: Advantages: accurate topology, no missed intersections; Disadvantages: requires a lot of algebraic techniques to reduce calculation time;

[0005] Grid method: Advantages: Reduces the surface intersection problem to the line-surface intersection problem; Disadvantages: It is easy to miss isolated tangent points or small rings, and it is difficult to balance accuracy and computational efficiency;

[0006] Subdivision method: Advantages: After cooperating with the bounding box acceleration strategy, the intersection line can be calculated accurately and efficiently; Disadvantages: For the case of tangent points and tangent lines, a deeper level of subdivision is required, and the calculation results need to be sorted to obtain the final result;

[0007] Tracking method: Advantages: fast calculation speed, the calculation results are naturally ordered, and the sorting process is omitted; Disadvantages: the starting point needs to be found in advance as the starting condition of the algorithm. It is easy to miss the intersection line, and the calculation process is easy to jump into the wrong branch.

[0008] Hybrid method: that is, using a combination of the previous four algorithms to solve the problem, such as algebraic method + tracking method or subdivision method + tracking method.

[0009] However, these methods are still difficult to meet the industrial standards of robustness, high precision and high efficiency. Based on this, the present invention proposes a universal parametric surface intersection method, which is not only efficient, high precision and robust, but also highly versatile. This method is applicable to mainstream NURBS surfaces in the industry, as well as common parametric surfaces in industrial software, such as planes, cylinders, cones, torus, quadratics, etc., as well as process surfaces generated from a reference curve or a reference surface, including spin, extend, offset, etc. Summary of the invention

[0010] In view of the shortcomings of the prior art, the present invention proposes a universal parametric surface intersection method, in which a universal parametric surface intersection structure framework based on a combination of bounding volume hierarchy (Bounding Volume Hierarchy, referred to as BVH) and tracing method is designed, which is intended to be applicable to the mutual intersection between different types of parametric surfaces and to balance the computational accuracy, efficiency and robustness of the algorithm.

[0011] The technical solution adopted by the present invention is:

[0012] A general parametric surface intersection method, comprising:

[0013] BVH construction and intersection judgment: construct BVH from bottom to top, then judge the intersection of BVH from top to bottom, judge the intersection, record the intersection result, that is, the maximum value of the bounding box corresponding to the leaf node in two directions on the parameter domain, forming the intersection area of ​​the two parametric surfaces on the parameter domain, and then use this area as the sampling interval, resample and construct BVH, and then judge the intersection to obtain the intersection bounding box pair;

[0014] Solve the starting point: Calculate the starting point from the intersecting bounding box pair to start the tracking method to calculate the intersection line; the calculated starting point needs to be filtered out to filter out valid starting points to avoid repeated calculation of the same intersection line during the tracking and intersection process;

[0015] Tracking and calculating intersection lines: Adaptive intersection step size is used in the process of tracking and calculating intersections, and corresponding stop conditions are considered for different intersection situations;

[0016] Topological tangent point determination: In the stage of solving the starting point and tracing the intersection line, the obtained points are topologically checked to distinguish and accurately calculate isolated tangent points, points on the tangent line, and cross singular points;

[0017] When the tracking method stops, an intersection line will be obtained; mark the bounding box of each intersection point of the intersection line obtained each time. Before calculating the starting point through the bounding box, first check whether the bounding box to be calculated has been marked. If it has been marked, skip the calculation of the starting point and the intersection calculation.

[0018] In the above technical solution, further, when constructing the BVH, the same bounding box can be used for all surfaces, or different bounding boxes can be used for different types of surfaces. The construction process is based on parameter domain division to form a complete quadtree structure; the complete quadtree structure is stored in an array form.

[0019] Furthermore, the Newton iteration method is used to solve the starting point. In this process, the calculated points need to be judged and unqualified starting points need to be screened out, including:

[0020] 1) Substitute the calculated intersection point back into the two surfaces to obtain two points on the two surfaces respectively, and verify whether the distance between the two points is less than the preset tolerance. If not, discard it;

[0021] 2) Verify whether the calculated intersection point falls within the parameter domain of the surface. If it exceeds the parameter domain of the surface, discard the starting point and calculate the starting point from a new pair of bounding boxes.

[0022] Furthermore, for the starting point obtained by screening, it is necessary to check whether it is a tangent point. If it is a tangent point, it is necessary to classify whether it is an isolated tangent point, a tangent point or a cross tangent point. If it is a tangent point, it is put into tracking calculation; if it is an isolated tangent point, it is judged as a duplicate and recorded as the intersection result, and the calculation continues from the next pair of bounding boxes; if it is a cross tangent point, it is judged as a duplicate and saved.

[0023] Furthermore, the obtained starting point needs to be checked for duplication to check whether the obtained starting point is already on the existing intersection line. The duplication detection adopts a bidirectional projection duplication detection algorithm, which is specifically:

[0024] 1) First compare all the points on all the existing intersection lines and find a point that is close to the current starting point The nearest point , the point is a point on a certain intersection line, construct a distance vector, calculate its distance, if the distance is less than the given tolerance, it is considered that the current starting point is on an existing intersection line, and a new bounding box is used to calculate a new starting point; if it is not less than the given tolerance, proceed to the next step;

[0025] 2) Try to Find the point before this point on this intersection line and the point after , and Construct distance vectors separately and , calculate the current starting point to and Distance and ;like and If one of them is smaller than the set tolerance, the intersection point is considered to be on an existing intersection line, and a new starting point is calculated from a new bounding box pair.

[0026] Furthermore, according to the sequence of the bounding box, since the starting points are included in the order of the bounding boxes during the intersection judgment process, the calculated starting points are included in an array. After each new starting point is calculated, it is compared with the starting point in the array. If the distance to a starting point P in the array is less than a given tolerance, it is considered that the starting point and point P belong to the same intersection line. At this time, point P is replaced by the current point, and an attempt is made to calculate the next starting point again. Otherwise, the starting point is considered to be a point on a new intersection line and is included in the array for tracking and intersection.

[0027] Furthermore, in the process of tracking and finding intersections, the iteration step size needs to be adjusted adaptively. The angle between the tangent vectors of the intersection line at the current point and the previous point is used to approximate the local curvature of the intersection line and adaptively adjust the tracking step size.

[0028] For the calculated new point, first check whether its accuracy meets the standard. If not, check whether the current step length is the initial step length. If it is larger than the initial step length, halve the current step length and recalculate. If the accuracy of the point meets the standard, compare the angle of the tangent vector of the intersection line at the current point and the previous point. If the angle is within a preset tolerance range, increase the step length to improve the tracking speed. Check whether the current step length is the upper limit step length. If it has not been reached, double the current step length and use the calculation of the next point. If the angle is not within the tolerance range, continue to calculate the new point with the current step length.

[0029] If the accuracy of the point calculated with the initial step size still does not meet the standard, Newton iteration is used to correct the point. In the specific calculation process, it should be analyzed whether the current intersection line is a normal intersection line or a tangent line, so as to use different iterative equations for correction.

[0030] Furthermore, for the cases where the intersection is a closed loop intersection, there is a cross intersection, or the intersection passes through a degenerate point on the surface, a protection sphere is constructed at the starting point. When the calculation result enters the protection sphere, the step size is reduced and no longer adjusted dynamically until a closed loop intersection is calculated, a cross intersection is reached, a degenerate point is reached, or the protection sphere is left. Only then is the step size allowed to continue to be adjusted.

[0031] Furthermore, there are three main stop conditions for the tracking intersection process: the stop condition at the closed ring intersection, the stop condition at the cross point, and the stop condition beyond the boundary.

[0032] Furthermore, if the calculation result on the intersection exceeds the surface parameter domain, the tracking is stopped; when the intersection is a closed ring intersection, avoid repeated calculations or even failure to stop the calculation; the cross tangent point should be accurately identified and calculated at the cross point of the intersection, and the calculation should be stopped at that point; for closed ring intersections, the cross product of the tangent vector at each newly obtained intersection and the tangent vector at the starting point is calculated, the number of changes in the vector direction is recorded, and the distance from the calculated intersection to the starting point is controlled to ensure the stopping of the closed ring intersection; for cross intersections, the angle between the normal vectors of the two surfaces where the intersection is located is recorded each time, and the tracking and calculation of the cross tangent point are stopped when it is less than a preset tolerance.

[0033] Specifically, the contributions of the present invention can be summarized as follows:

[0034] 1) A new intersection framework combining BVH with tracking algorithm is provided to effectively handle most surface intersection tasks expressed in parameters.

[0035] 2) The framework takes into account the problem that the tracking method is prone to missing branches, accurate calculation of singular points and avoiding line jumps, and adaptive step size problems, and proposes corresponding solutions.

[0036] 3) Using BVH to find the starting point of the tracking method can largely avoid the problem of missing intersections, but it is necessary to avoid repeated calculations of the same intersection. The present invention provides some solutions for avoiding repeated calculations of the same intersection.

[0037] 4) For the case where the curvature of the intersection line is small but the length is large, the present invention provides an adaptive step size solution that takes into account both accuracy and approximates the curvature of the intersection line based on the angle of the tangent vector.

[0038] 5) In order to solve the problem that the stopping condition of the tracking method is difficult to determine, the present invention provides a set of solutions for processing closed loop intersections within the surface, cross intersections beyond the boundary, and collinear surface normal vectors.

[0039] The beneficial effects of the present invention are:

[0040] 1) A framework is proposed to solve the surface intersection problem by constructing a BVH-solving starting point-tracing and calculating the intersection line. This framework is highly versatile and is applicable to the intersection of most surfaces represented by parameters.

[0041] 2) Since the result of the tracking method is a sequence of point data rather than a real intersection line, how to avoid repeated calculation of the same intersection line is crucial to the accuracy and efficiency of the calculation result. In order to solve this problem, the present invention proposes three strategies and combines them to solve the problem of repeated calculation.

[0042] 3) In the process of finding the intersection, in theory, it is hoped that the compensation required for the current tracking can be calculated by using the curvature of the intersection line at each point. Directly calculating the curvature of the intersection line at a local point requires calculating the high-order derivatives of the two surfaces at the local point, which will be very time-consuming in the implementation of the specific algorithm. In order to solve this problem, the present invention uses the angle of the tangent vector at each point of the intersection line to approximate the curvature, and flexibly adjusts the step size while considering the calculation accuracy to avoid repeated calculation of the closed ring intersection line. When the intersection line is about to exceed the boundary, the present invention adopts a strategy of continuously retracting the step size to prevent it from being too far away from the boundary and stepping out of the boundary in one step. In addition, the present invention also considers the marking of existing intersection lines on the pixel matrix in the case where the intersection line is longer due to adaptive step size adjustment.

[0043] 4) For closed loop intersections on periodic surfaces, they may not form closed loop intersections in the parameter domain. Therefore, the algorithm of the present invention makes judgments based on three-dimensional space, and it has been proven through actual measurements that it can accurately process closed loop intersections of various shapes and sizes. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a schematic diagram of the overall algorithm framework of the method of the present invention (including three steps of BVH construction, starting point determination, and tracking method);

[0045] Figure 2 Schematic diagram of BVH construction and intersection judgment;

[0046] Figure 3 Solve the schematic diagram for the starting point;

[0047] Figure 4 Schematic diagram of the bidirectional projection weight detection algorithm used to avoid repeated calculation of the same intersection line;

[0048] Figure 5 A schematic diagram of the stopping conditions for the closed loop intersection line among the stopping conditions for tracking the intersection line;

[0049] Figure 6 Schematic diagram of the balance between step size adjustment and accuracy in the adaptive step size strategy;

[0050] Figure 7 Schematic diagram of special case handling in the adaptive step size strategy. DETAILED DESCRIPTION

[0051] The present invention proposes a general parametric surface intersection calculation framework based on the BVH construction intersection judgment tracking method, which effectively handles the closed loop intersection calculation stop problem, the cross intersection singular point calculation problem, avoids repeated calculation of the same intersection, and proposes an adaptive step size strategy to improve the solution efficiency.

[0052] Based on the above contributions 1) to 5), the present invention combines BVH and tracking methods to provide a set of design solutions that can be used for general parametric surface intersection, including from BVH construction to obtaining the final intersection line result, such as Figure 1 It is a universal parametric surface intersection framework, that is, an overall framework of BVH bounding volume construction - starting point and singular point calculation - intersection line tracking - repeated intersection line filtering - tracking termination, which can universally handle various parametric surface situations such as NURBS, quadratic surfaces, and process surfaces; the method of the present invention is suitable for general parametric surfaces, can obtain all intersection line branches, effectively handle singular situations such as cross intersections, circular intersections, etc., avoid intersection lines from being repeatedly tracked, and has high efficiency, high precision, robustness and high versatility.

[0053] The technical solutions adopted by the present invention include the following:

[0054] First, construct the BVH from bottom to top according to a preset resolution, then perform intersection judgment on the BVH from top to bottom, and simultaneously record the intersection judgment results, that is, the maximum values ​​of the bounding boxes corresponding to the leaf nodes along the two directions in the parameter domain. These two pairs of maximum values ​​can constitute the intersection area of ​​the two parametric surfaces in the parameter domain, thereby locating the parameter domain where the intersection line is located. Then, use this shrunk parameter domain as the sampling interval, resample and construct the BVH, and then perform intersection judgment. Repeat the above steps, and when the parameter domain used to construct the BVH no longer shrinks, it is used as a sign to stop constructing the intersection judgment.

[0055] Furthermore, the starting point is calculated from the intersecting bounding box pairs to start the tracking method to calculate the intersection line. Since the BVH construction layer is deep, and it has been reconstructed many times by estimating the intersection parameter domain, and after high-quality exclusion filtering and classification, the intersecting bounding box pairs can accurately fit the intersection line, thereby ensuring that the starting point calculation does not miss the intersection line. In this step, the starting point of the calculation needs to be processed to check whether it is a tangent point. If it is a tangent point, it is necessary to classify whether it is an isolated tangent point, a tangent point, or a cross tangent point. If it is a tangent point, it will be put into the tracking calculation; if it is an isolated tangent point, it will be judged as a duplicate and recorded as the intersection result, and the operation will continue from the next pair of bounding box pairs; if it is a cross tangent point, it will be judged as a duplicate and saved.

[0056] After starting the tracking algorithm, you need to consider the intersection step size and stop conditions. There are three main stop conditions for the tracking intersection process: the stop condition of the closed loop intersection, the stop condition at the cross point, and the stop condition of the super boundary. If the calculation result on the intersection exceeds the surface parameter domain, stop tracking; if the intersection is a closed loop intersection, avoid looping and calculating it multiple times or even unable to stop the calculation; at the intersection cross point, the cross tangent point should be accurately identified and calculated, and the calculation should be stopped at that point. For closed loop intersections, by calculating the cross product of the tangent vector at each newly obtained intersection and the tangent vector at the starting point, the number of changes in the vector direction is recorded, and the distance from the intersection to the starting point is controlled to ensure the stop of the closed loop intersection; for cross intersections, the normal vector angle of the two surfaces where the intersection is located is recorded each time, and the tracking is stopped and the cross tangent point is calculated when it is less than a preset tolerance. Note: If the intersection is not a closed loop intersection, after stopping the tracking calculation, the tracking direction needs to be reversed to calculate the remaining half of the intersection until the tracking stops.

[0057] During the tracking process, the angle between the tangent vector of the new point and the previous point is used to approximate the local curvature of the intersection line. If the angle is small, the step size is gradually doubled. If the calculated new point is inaccurate, first check whether the current step size has been expanded. If so, retract the step size once and recalculate the point, and repeat the above until the intersection is completed. At the same time, in order to avoid errors in calculating the closed loop intersection under a large step size, a protection sphere is constructed at the starting point. When the calculation result enters the protection sphere, the step size is reduced and no longer dynamically adjusted until the calculated closed loop intersection stops or leaves the protection sphere. In order to avoid the step size being too large or too small, the initial step size and the step size upper limit are defined according to the surface size.

[0058] When the tracking method stops, an intersection line will be obtained. Mark the bounding box of each intersection point of each intersection line. Before calculating the starting point through the bounding box, first check whether the bounding box to be calculated has been marked. If it has been marked, skip the calculation of the starting point and the intersection calculation.

[0059] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings and specific examples.

[0060] 1BVH construction and judgment

[0061] BVH is a hierarchical structure for organizing objects in a scene. It groups objects and constructs a tree structure, so that we can perform calculations such as ray tracing and collision detection more efficiently. The core idea of ​​BVH is to organize objects through a hierarchical structure so that we can determine objects of interest more quickly. The advantage of this structure is that it can effectively reduce the number of objects that need to be detected or calculated, thereby improving computing efficiency. BVH has been widely used in computer graphics and game development, and it is a very effective acceleration data structure. The present invention also uses BVH as a pre-processing link for surface intersection.

[0062] BVH can use different types of bounding boxes. Common bounding boxes are:

[0063] 1) Axis-Aligned Bounding Box (AABB): Axis-aligned bounding box is the most common one. It consists of three pairs of parallel faces, each pair of faces is aligned with the coordinate axis, so that the bounding box boundary is parallel to the coordinate axis. AABB is often used to quickly estimate the boundaries of objects because they are easy to calculate and test intersections.

[0064] 2) Oriented Bounding Box (OBB): An oriented bounding box is a bounding box that can be rotated arbitrarily. Unlike an axis-aligned bounding box, its boundary and the direction of the object may not be parallel to the coordinate axis. OBB can enclose the object more tightly, but the corresponding calculation and testing may be more complicated.

[0065] 3) Bounding Sphere: Bounding Sphere is a method of enclosing an object with a sphere. It is usually used for objects with symmetry or rotation invariance, because the sphere can provide a more compact enclosure in some cases.

[0066] The present invention has no special requirements for the box used in BVH. All types of curved surfaces can be constructed using one box, or boxes of different shapes can be constructed for different types of curved surfaces.

[0067] In the surface intersection method provided by the present invention, the first step is to construct the BVH of the entire surface. Figure 2 , this construction process is based on the partitioning of the parameter domain to form a complete quadtree structure. For example, the second-level BVH divides the parameter domain into 2×2 grids, and in the third level, each grid is divided into 2×2 grids again to form a 4×4 grid. The complete quadtree structure is stored in the form of an array.

[0068] When constructing the box required for BVH, sampling can be performed at four points of the parameter domain grid to construct the corresponding bounding box. The sampling points on the parameter domain are calculated when constructing the bounding box by using the method of sampling while constructing, and the bounding box of the entire leaf node is calculated from this. However, this method has a disadvantage, which may lead to repeated calculation of sampling points. For example, for a 2×2 parameter domain grid, when constructing B after constructing A, the adjacent points of A and B will be calculated twice. To solve this problem, the sampling points are saved in an array, which only needs to be calculated 9 times, effectively reducing the BVH construction time.

[0069] The construction of the intermediate nodes no longer calculates the sampling points, but directly merges the bounding boxes of the next layer. The first layer of boxes only needs to merge ABCD.

[0070] In the bounding box intersection judgment stage, the corresponding intersection judgment method can be used according to the selected box form.

[0071] 2 Calculate the starting point

[0072] The problem of finding the intersection of parametric surfaces in mathematics belongs to the problem of solving a system of equations. However, due to the complex surface morphology, cumbersome expressions, and high order of equations, it is difficult to directly obtain the analytical expressions of all intersection lines. However, if you only want to calculate a point on the intersection line, the problem is resolved into a problem of finding the root value of a nonlinear system of equations, which greatly simplifies the difficulty of solving. In applied mathematics, this type of problem has long been well studied. To solve a nonlinear system of equations, there are mainly some classic algorithms:

[0073] 1) Newton's method. Newton's method is an iterative method for solving nonlinear equations. It gradually approaches the solution of the equations by continuously linearizing the original equations and solving the linear equations. Each iteration requires solving a linear equation, so the convergence speed of Newton's method at each step is usually fast. However, it should be noted that Newton's method may converge to a local minimum point and is sensitive to the choice of initial values.

[0074] 2) Quasi-Newton methods. Quasi-Newton methods are a class of optimization algorithms based on Newton's method that avoid solving a system of linear equations in each step by estimating the inverse of the Hessian matrix. These methods usually use historical iteration information to approximate the inverse of the Hessian matrix, thereby reducing the amount of calculations at each step. Quasi-Newton methods usually have good global performance and convergence.

[0075] 3) Gradient descent method. Gradient descent method is an optimization algorithm based on gradient information, which is used to minimize the objective function. For nonlinear equations, it can be transformed into a minimization problem and then solved using gradient descent method. Gradient descent method is usually simpler to implement, but may converge slowly, especially for highly non-convex problems.

[0076] Since in the previous step, the intersection judgment was constructed by BVH, and the intersecting bounding box pairs that may wrap the intersection line have been successfully obtained, it is easy to select any point from the bounding box pair as the iteration starting point, thereby starting the solution algorithm of the nonlinear equation group. In the BVH intersection judgment link, the intersection judgment quality directly affects the solution efficiency of this step. Generally speaking, the higher the intersection judgment quality, the closer the starting point is to the target root value point, the lower the number of iterations, and the better the effect.

[0077] It is preliminarily believed that the two surface patches wrapped by each pair of intersecting bounding boxes are intersecting, and an intersection point is tried to be obtained as the starting point for intersection, the constraint equation is constructed, and the Newton iteration strategy is used to calculate the starting point:

[0078] like Figure 3 As shown, for the surface and In terms of, construct the equation: And find a root as the starting point, and use the results of each step Substitute back into the two surfaces to get the corresponding two space points and , and the bi-norm of the vector between them is calculated as the iteration stop condition. Since the bounding box will fully wrap the intersection line, and the bounding box and the intersection line fit well, an upper limit of the number of iterations can be set as a forced exit condition to avoid infinite iterations.

[0079] Specifically, for a given underconstrained system of equations ,set up ,but . Construct Newton's iterative equations:

[0080]

[0081] in:

[0082]

[0083]

[0084] In the above formula Surface The first-order partial derivatives with respect to its own parameters u and v are: Representing surfaces The second-order partial derivatives with respect to its own parameters u and v, Similarly, the surface The first and second order partial derivatives of the parameters s and t. Let the point at step k be , is the increment calculated at this point, using To calculate the next point. Stop iteration when .

[0085] At the same time, it is necessary to judge the calculated points and filter out unqualified starting points. The specific strategy is as follows:

[0086] 1) Substitute the calculated intersection point back into the two surfaces to obtain two points on the two surfaces. A preset tolerance can be passed in according to the intersection accuracy requirements in the specific application scenario. The value is generally not greater than 1.0e-6. Verify whether the distance between the two points is less than the preset tolerance, that is, the obtained intersection point , investigate Is it smaller than the preset precision?

[0087] 2) Verify that the calculated intersection point falls within the parameter domain of the surface. If it does, discard the starting point and calculate the starting point from a new pair of bounding boxes.

[0088] The qualified starting points are collected into an array, and each newly calculated qualified starting point is compared with the starting point in the array to avoid repeated calculations.

[0089] 3 Calculate the tangent vector of the intersection line and solve the intersection line

[0090] The set of points on the intersection line is obtained by solving the following system of differential equations (ODE):

[0091]

[0092]

[0093] In the above formula are the first-order partial derivatives of surfaces p and q at corresponding points respectively; are the normal vectors of surfaces p and q at corresponding points, that is, ; is the tangent vector of the intersection line at the current point.

[0094] The intersection of two surfaces can be divided into two cases. When the surfaces intersect each other in a non-tangent manner, the tangent vector at any point on the intersection can be obtained by calculating the cross product of the normal vectors of the two surfaces at that point.

[0095]

[0096] When two surfaces are tangent to each other and form a tangent line, the above method becomes invalid because the normal vectors of the two surfaces at the tangent line are collinear. At this time, the tangent vector is found again by making the normal curvature vectors of the two surfaces at the tangent line consistent.

[0097] Specifically: The intersection of the surfaces is a curve that lies on both surfaces at the same time, so the curve can be expressed as ,in is the parametric intersection line corresponding to the intersection line on the parameter domain of surface p, and the same is true for surface q. Similarly, the tangent vector at any point of the intersection line can be obtained by a linear combination of the partial derivatives of the surface at the corresponding point, that is:

[0098]

[0099] When two surfaces are tangent, the normal vectors of the two surfaces are consistent, so at a certain point on the tangent line along the c'(s) direction, the two surfaces have the same normal curvature. This means that the second fundamental homogeneity of the two surfaces is consistent, that is, it satisfies the equation:

[0100]

[0101] in and is the second fundamental homogeneous coefficient of the surfaces p and q.

[0102] After reorganizing the above two equations, using u' and v' to represent s' and t', we can get the following equations:

[0103]

[0104] in:

[0105]

[0106] is the first fundamental homogeneous coefficient of the surface q.

[0107] Substituting this system of equations into the second basic equation, we can get

[0108]

[0109] in

[0110]

[0111] Rearranging the original equations yields a set of expressions:

[0112]

[0113]

[0114] Since this equation is a quadratic equation, the classification information of the tangent points can be obtained by analyzing the values ​​of the roots of the equation. :

[0115] : This point is an isolated tangent point between the two surfaces.

[0116] : This point is the tangent point of a cross bifurcation, such as the position of the cross point where two cylinders of equal radius intersect each other to obtain a cross intersection. There are two solutions for the tangent vector at this point.

[0117] : The two surfaces may be at least tangent to each other at this point, that is, the curvatures are consistent.

[0118] : The tangent vector at this point can be uniquely determined.

[0119] When the point is on the tangent line, the tangent vector can be calculated:

[0120] like , then ;like , then ;

[0121] When the point is a cross tangent point, the same method can be used to calculate the two tangent vectors at the point.

[0122] So far, all the elements in the above ODE system have been obtained. In the future, the 4th-order Runge-Kutta method can be used to iteratively solve the differential equations. In the process of intersection, due to the accumulation of errors in the surface position data or the calculation process, the accuracy of the intersection result may not meet the standard. Therefore, it is necessary to feed back the intersection point results obtained each time to the two surfaces to calculate the error. If the error exceeds the preset tolerance value, Newton iteration is used for correction. This correction method is consistent with the previous method of finding the starting point.

[0123] 4Avoid repeated calculations of the same intersection line

[0124] Since the bounding box locks the complete intersection line, if the starting point is calculated for all bounding box pairs by force and the above steps are repeated, the same intersection line will be calculated repeatedly. To avoid this situation, the starting point needs to be screened:

[0125] The initial point needs to be checked for duplication. If the point has been found before, there is no need to start the calculation from this point.

[0126] There will be many bounding boxes for the same intersection line, so the duplicate detection can only filter out a small number of repeated initial points. More importantly, it is necessary to check whether the initial point is already on the existing intersection line. Three strategies have been adopted:

[0127] 1) Bidirectional projection weight detection algorithm:

[0128] a) A direct comparison strategy is adopted, that is, the distance between the calculated initial point and all the point sequences representing the intersection lines. If this distance is less than the given tolerance value, it is determined that the point already exists on the existing intersection line, avoiding unnecessary repeated calculations. In the actual scenario of the present invention, due to the consideration of the adaptive step size, for the intersection line of a straight line or a small curvature of an approximate straight line, it is possible that the distance between the two traced front and rear points is large, and the newly calculated intersection point is just between these two points and outside the set tolerance. At this time, if the adjustment of the tolerance is relied on to determine whether the starting point is repeated, the robustness of the algorithm will be greatly lost. Therefore, in the actual application scenario, the method of calculating the height of the triangle formed by the starting point and the two front and rear intersection points is adopted to complete this step.

[0129] Specifically, if Figure 4 As shown, first violently compare all the points on all the intersection lines to find a point that is close to the current starting point. The nearest point , construct the distance vector , calculate the distance .like If it is less than the given tolerance, the current starting point is considered to be on an existing intersection line, and a new bounding box pair is used to calculate a new starting point. If it is not less than the given tolerance, proceed to the next step.

[0130] It should be a point on a certain intersection line. Try to find the point before this point on this intersection line. and the point after , and Construct distance vectors separately and :

[0131]

[0132] Calculate now arrive and Distance and :

[0133]

[0134] like and If one of them is smaller than the set tolerance, the intersection point is considered to be on an existing intersection line, and a new starting point is calculated from a new bounding box pair.

[0135] Note: If is the first point of the current curve, that is, it does not exist , then only calculate And judge; similarly if If it is the last point of the current curve, only And judge.

[0136] b) Starting point grouping algorithm:

[0137] A similar strategy to union-find is adopted, which takes advantage of the order of bounding boxes. The newly calculated points are compared with the old points that have been calculated. If the distance between them is less than a given tolerance, they are considered to be in the same group and the points used for discrimination are updated. This helps to improve the efficiency of discrimination.

[0138] Specifically, bounding box pairs are collected sequentially during the intersection judgment and collection process. Therefore, when a starting point A is calculated from a new bounding box pair and an intersection line is calculated starting from A, the next pair of bounding boxes is a pair of boxes next to the previous pair of bounding boxes. Therefore, the starting point B calculated from this pair of boxes will be relatively close to A. The calculated starting point is collected in an array, and each time a new starting point is calculated, it is compared with the starting point in the array. If it is close to a starting point P in the array, it is considered that the point and point P belong to the same intersection line. At this time, point P is replaced with the current point, and the next starting point is calculated again. If it is not close to all the starting points in the array, it is considered that this is a point on a new intersection line, so the algorithm continues to advance and this point is included in the array.

[0139] Obviously, the robustness of this algorithm is weak, so this strategy only plays a role in rapid identification and collection in practical applications.

[0140] c) Pixel marking algorithm:

[0141] A pixel-based marking strategy is used to mark the bounding box pairs where the calculated intersection data points are located. If the initial point is within the marked bounding box pair, it is considered that the initial point is a point on the calculated intersection. This method can effectively speed up the intersection solution process while reducing repeated calculations.

[0142] Specifically, each point on the intersection line calculated by the tracking method used in the present invention is actually a parameter point representation in the parameter domain, specifically , which records the corresponding parameter point of the point on the two surface parameter domains. The starting point is constructed in the same way. Therefore, in order to quickly determine whether the starting point is already on the intersection line, the parameter domain information can be used for processing. If the intersection line is already on the parametric curve in the parameter domain of the surface p, it can be considered that there is no need to trace and calculate the intersection line starting from point A.

[0143] Each intersection line calculated by the tracking method is actually a point sequence, and after the BVH intersection judgment stage, each calculated point will be inside a pair of bounding boxes. At this time, you only need to mark the bounding box pair corresponding to each point in the intersection line. In subsequent calculations, if the bounding box pair used to calculate the starting point has been marked, or the calculated starting point is in a marked bounding box, it is considered to be on the existing intersection line. At this time, the subsequent tracking calculation steps are abandoned, and other bounding box pairs are found to find the starting point, thereby avoiding repeated calculations on the same intersection line.

[0144] In actual application, the above three strategies will be used together.

[0145] 5 Stopping conditions during the solution process

[0146] When the complete intersection line is obtained, the tracking method should stop, so it is necessary to provide the judgment condition for stopping the tracking.

[0147] 1) When the calculated data points exceed the parameter domain of the surface, it should stop.

[0148] 2) When the intersection line reaches the vertex of the cone or the pole of the sphere (a degenerate point in parameter representation), it should stop.

[0149] 3) When calculating at the cross intersection, special treatment should be given.

[0150] 4) When the intersection line is a closed loop intersection line inside the surface, the calculation should stop when the result returns to the initial point.

[0151] When judging whether the calculation of a closed loop intersection is completed, the stopping condition cannot simply compare the distance between the calculation result and the starting point, because if the distance tolerance is too small, it is easy to stop tracking the first point; if the distance tolerance is too large, it is easy to calculate the intersection several times before stopping (more often an infinite loop). In addition, due to different surface shapes and different intersection information, the position of the starting point relative to the two surfaces is also different.

[0152] To solve this problem, the present invention adopts two strategies:

[0153] a) Assuming that the closed loop intersection obtained by the intersection may also be a closed loop intersection in the parameter domain, a plane coordinate system is constructed in the parameter domain based on the initial point, and the update status of the data points calculated each time in the four quadrants of this coordinate system is saved. When it leaves the quadrant where the first point is located and returns to this quadrant again, check its distance to the initial point. If it is less than a tolerance, it is considered to have stopped.

[0154] b) The above strategy will fail when the surface is a periodic surface, because the intersection of a periodic surface is not necessarily a closed loop intersection in the parameter domain. Therefore, it is necessary to save the tangent vector at the starting point, and make a cross product of the tangent vector at each new point and the tangent vector at the starting point, and save the direction of the cross product. When the direction is changed twice or more during the intersection process, and the distance from the starting point is less than the set tolerance, it is considered to stop, such as Figure 5 shown.

[0155] 6. Special treatment of cross intersections

[0156] When two surfaces intersect, they may be tangent only at a certain point, such as two cylinders with the same radius that penetrate each other. In this case, the intersection line is a cross shape. At the cross intersection point, the two surfaces are tangent at this point, and the rest of the intersection positions are non-tangent. The intersection line has four extension directions at this point, so when the intersection line passes through this point, it needs to stop exactly at this point. Therefore, the accurate calculation of this tangent point is particularly important.

[0157] If two surfaces and If the intersection lines of the two surfaces (abbreviated as p and q in the formula) intersect, then either at least one of the two surfaces is a self-intersecting surface, or the intersection point is a tangent point. For non-self-intersecting surfaces, if the angles between the normal vectors of the two surfaces corresponding to the data points obtained during the tracking process are relatively close, try to find a tangent point and stop tracking. The singular point must satisfy the roots of the following equations:

[0158]

[0159] A numerical solution calculated from the system of equations is used as a candidate tangent point.

[0160] Singularity points must satisfy .According to Newton's iteration formula:

[0161]

[0162] in

[0163]

[0164] and:

[0165]

[0166] The reason why it is called an alternative tangent point is that is a four-dimensional vector composed of the parameters of the two surfaces. After substituting the result back to the two surfaces, it is only the point where the normal vectors on the surfaces are collinear, not necessarily the tangent point. Therefore, it is necessary to determine whether this result point is the exact intersection point.

[0167] If the intersection line is a tangent line, this strategy cannot be used, because the equation group is satisfied everywhere on the tangent line, which will directly cause the trace not to start. Therefore, it is necessary to judge the shape of the starting point: if the starting point is a tangent point, the intersection line is considered to be a tangent line, that is, this strategy is not used as a stop condition.

[0168] 7 Adaptive step size strategy

[0169] In specific application scenarios, the given surface size may be large. If a fixed step size is still used, the calculation time may be too long. Therefore, the step size should be adjusted adaptively according to the shape of the intersection line. For example, if the intersection line is a long straight line formed by two planes, relaxing the step size can effectively speed up the intersection calculation. Assuming that the intersection line is an ellipse formed by a plane and a cylinder, the step size should be determined based on the curvature of the local position of the ellipse.

[0170] In the actual calculation process, there is no need to try to calculate the curvature of the intersection line through two surfaces, because it involves calculating the second-order derivative at each position, which is too time-consuming. In the present invention, the angle between the tangent vectors of the intersection at the current point and the previous point is calculated. If the angle is less than a preset angle tolerance, the current step size is expanded. In order to avoid the step size being too small or too large, an upper and lower limit of the step size is set to ensure that the step size is not expanded infinitely. In addition, it is necessary to consider the accuracy of the intersection point obtained when calculating with the current step size, and when the intersection line calculation is close to certain special points, such as the starting point, degenerate point, and near the cross tangent point, the step size should be properly handled.

[0171] 1) Setting the upper and lower limits of the step size:

[0172] In order to avoid infinite expansion or reduction of the step size, the upper and lower limits of the step size should be set, and the setting of the upper and lower limits of the step size should be related to the size and shape of the surface. For example, the length of the parameter domain of a sphere in both directions is , and the length of one direction of the parameter domain of the cylinder is , and the length of the other direction is from negative infinity to positive infinity (in actual systems, a larger number (such as 10,000) may be used to approximate this infinity). Therefore, the parameter domain range can be used to preliminarily determine the surface shape. You can compare the parameter domains of the two surfaces, select the shortest length in the parameter direction divided by the bounding box construction resolution as the lower limit step size or initial step size; select the longest length in the parameter direction divided by the bounding box construction resolution as the upper limit step size. If an estimate of the intersecting parameter domains of the two surfaces is made, this strategy can still be used. Directly use the longest and shortest parameter directions in the estimated parameter domain to set the upper and lower limits of the step size.

[0173] 2) Balance between step size and accuracy:

[0174] If the step size is too small, it will obviously affect the calculation efficiency; if the step size is too large, it may cause inaccurate intersection calculation. Although Newton iteration can be used to correct the intersection, when there are more than one intersection lines, the correction with large compensation may directly lead to line skipping. In order to avoid this problem, Figure 6 As shown, the following strategy is adopted in the present invention to ensure the balance between step size and accuracy:

[0175] a) For the calculated new point, first check whether its accuracy meets the standard. If not, check whether the current step length is the initial step length. If it is larger than the initial step length, halve the current step length and recalculate the point. If it meets the standard, proceed to the next step.

[0176] b) When the accuracy of the point is up to standard, compare the angle of the tangent vector of the intersection line at the current point and the previous point. If the angle is within a preset tolerance range, it is considered that the intersection line is relatively gentle, and the step size can be increased to increase the tracking speed. Check whether the current step size is the upper limit step size. If it has not been reached, double the current step size and use the calculation of the next point. If the angle is not within the tolerance range, it is considered that the current intersection line changes drastically, and continue to calculate the new point with the current step size.

[0177] c) If the point accuracy calculated with the initial step size still does not meet the standard, the Newton iteration is used to correct the point. Note that in the specific calculation process, it is necessary to analyze whether the current intersection line is a normal intersection line or a tangent line, so as to use different iterative equations for correction.

[0178] 3) Handling of special situations:

[0179] The so-called special cases refer to the situations where the intersection line is a closed loop intersection line, there is a cross intersection line, the intersection line passes through a degenerate point on the surface (hereinafter collectively referred to as a special point), and when the intersection line calculation result exceeds the surface parameter domain, but the current step size may be large. At this time, the step size needs to be handled with care.

[0180] a) When the intersection calculation approaches these special points, the step size should be shortened to prevent the step size from crossing these special points. Figure 7 As shown, a protection sphere is constructed with these special points as the sphere center and R as the radius. When the intersection point enters the protection sphere, the step length is set to the initial step length regardless of the current accuracy and step length, and the step length is prohibited from being expanded before leaving the protection sphere, until a closed loop intersection line is calculated, or a cross intersection point is reached, or a degenerate point is reached, or the protection sphere is left, the step length is allowed to continue to be adjusted. A preset tolerance k can be given, and R is set to k times the initial step length.

[0181] b) When the calculated intersection point exceeds the boundary, it is necessary to check whether the current step length is the initial step length. If it is not the initial step length, the current step length is halved and the point is recalculated. This is repeated until the calculation result exceeds the boundary when the initial step length is used as the step length, and then the calculation is stopped and the boundary conditions are processed. In this way, the calculation of the intersection line leaving the surface boundary can be completed more evenly and accurately, and it can avoid the situation where when the intersection line is close to the boundary, due to the large step length, it steps out of the surface in one step, and the calculation is stopped because it is mistakenly believed that the intersection line has reached the surface boundary.

[0182] According to a specific embodiment of the present invention, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the aforementioned methods when executing the program.

[0183] According to a specific embodiment of the present invention, there is further provided a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any of the above methods are implemented.

[0184] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Obviously, the present invention is not limited to the above-mentioned specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The purpose of selecting and describing exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different options and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

Claims

1. A general parametric surface intersection method, characterized in that: include: BVH construction and intersection judgment: construct BVH from bottom to top, then judge the intersection of BVH from top to bottom, judge the intersection, record the intersection result, that is, the maximum value of the bounding box corresponding to the leaf node in two directions on the parameter domain, forming the intersection area of ​​the two parametric surfaces on the parameter domain, and then use this area as the sampling interval, resample and construct BVH, and then judge the intersection to obtain the intersection bounding box pair; Solve the starting point: Calculate the starting point from the intersecting bounding box pair to start the tracking method to calculate the intersection line; the calculated starting point needs to be filtered out to filter out valid starting points to avoid repeated calculation of the same intersection line during the tracking and intersection process; Tracking and calculating intersection lines: Adaptive intersection step size is used in the process of tracking and calculating intersections, and corresponding stop conditions are considered for different intersection situations; Topological tangent point determination: In the stage of solving the starting point and tracing the intersection line, the obtained points are topologically checked to distinguish and accurately calculate isolated tangent points, points on the tangent line, and cross singular points; When the tracking method stops, an intersection line will be obtained; mark the bounding box of each intersection point of the intersection line obtained each time. Before calculating the starting point through the bounding box, first check whether the bounding box to be calculated has been marked. If it has been marked, skip the calculation of the starting point and the intersection calculation.

2. The method for intersecting general parametric surfaces according to claim 1, characterized in that: When constructing the BVH, the same bounding box may be used for all surfaces, or different bounding boxes may be used for different types of surfaces. The construction process is based on parameter domain partitioning to form a complete quadtree structure; the complete quadtree structure is stored in an array form.

3. The method for intersecting general parametric surfaces according to claim 2, characterized in that: The Newton iteration method is used to solve the starting point. In this process, the calculated points need to be judged and unqualified starting points need to be screened out, including: 1) Substitute the calculated intersection point back into the two surfaces to obtain two points on the two surfaces respectively, and verify whether the distance between the two points is less than the preset tolerance. If not, discard it; 2) Verify whether the calculated intersection point falls within the parameter domain of the surface. If it exceeds the parameter domain of the surface, discard the starting point and calculate the starting point from a new pair of bounding boxes.

4. The method for finding the intersection of general parametric surfaces according to claim 3, characterized in that: For the starting point obtained by screening, it is necessary to check whether it is a tangent point. If it is a tangent point, it is necessary to classify whether it is an isolated tangent point, a tangent point or a cross tangent point. If it is a tangent point, it is put into tracking calculation; if it is an isolated tangent point, it is judged as a duplicate and recorded as the intersection result, and the calculation continues from the next pair of bounding boxes; if it is a cross tangent point, it is judged as a duplicate and saved.

5. The method for finding the intersection of general parametric surfaces according to claim 4, characterized in that: The obtained starting point needs to be checked for duplication to check whether the obtained starting point is already on the existing intersection line. The duplication detection adopts a bidirectional projection duplication detection algorithm, which is specifically: 1) First compare all the points on all the existing intersection lines and find a point that is close to the current starting point initialPoint The nearest point nearestPoint , the point is a point on a certain intersection line, construct a distance vector, calculate its distance, if the distance is less than the given tolerance, then the current starting point is considered to be on an existing intersection line, and a new bounding box pair is used to calculate a new starting point; If it is not less than the given tolerance, proceed to the next step; 2) Try to nearestPoint Find the point before this point on this intersection line beforNearestPoint and the point after afterNearestPoint , and nearestPoint Construct distance vectors separately beforVector and afterVector , calculate the current starting point to beforVector and afterVector Distance beforDistance and afterDistance ;like beforDistance and afterDistance If one of them is smaller than the set tolerance, the intersection point is considered to be on an existing intersection line, and a new starting point is calculated from a new bounding box pair.

6. The method for finding the intersection of general parametric surfaces according to claim 4, characterized in that: According to the sequence of the bounding box, since the starting points are included in the order of the bounding box during the intersection judgment process, the calculated starting points are included in an array. After each new starting point is calculated, it is compared with the starting point in the array. If the distance to a starting point P in the array is less than the given tolerance, it is considered that the starting point and point P belong to the same intersection line. At this time, point P is replaced by the current point, and the next starting point is calculated again. Otherwise, the starting point is considered to be a point on a new intersection line and is included in the array for tracking and intersection.

7. The method for finding intersection of general parametric surfaces according to claim 1, characterized in that: In the process of tracking intersection, it is necessary to make adaptive adjustments to the iteration step size. The angle between the tangent vectors of the intersection line at the current point and the previous point is used to approximate the local curvature of the intersection line and adaptively adjust the tracking step size. For the calculated new point, first check whether its accuracy meets the standard. If not, check whether the current step length is the initial step length. If it is larger than the initial step length, halve the current step length and recalculate. If the accuracy of the point meets the standard, compare the angle of the tangent vector of the intersection line at the current point and the previous point. If the angle is within a preset tolerance range, increase the step length to improve the tracking speed. Check whether the current step length is the upper limit step length. If it has not been reached, double the current step length and use the calculation of the next point. If the angle is not within the tolerance range, continue to calculate the new point with the current step length. If the accuracy of the point calculated with the initial step size still does not meet the standard, Newton iteration is used to correct the point. In the specific calculation process, it should be analyzed whether the current intersection line is a normal intersection line or a tangent line, so as to use different iterative equations for correction.

8. The method for finding the intersection of general parametric surfaces according to claim 7, characterized in that: For the cases where the intersection is a closed loop intersection, there is a cross intersection, or the intersection passes through a degenerate point on the surface, a protection sphere is constructed at the starting point. When the calculation result enters the protection sphere, the step size is reduced and no longer adjusted dynamically until a closed loop intersection is calculated, a cross intersection is reached, a degenerate point is reached, or the protection sphere is left. Only then is the step size allowed to continue to be adjusted.

9. The method for finding intersection of general parametric surfaces according to claim 1, characterized in that: There are three main stopping conditions for the tracking intersection process: the stopping condition at the closed ring intersection, the stopping condition at the cross point, and the stopping condition beyond the boundary.

10. The method for finding intersection of general parametric surfaces according to claim 9, characterized in that: If the calculation result on the intersection exceeds the surface parameter domain, the tracking is stopped. If the intersection is a closed ring intersection, avoid repeated calculations or even failure to stop the calculation. The cross tangent point should be accurately identified and calculated at the cross point of the intersection, and the calculation should be stopped at that point. For closed ring intersections, the cross product of the tangent vector at each newly obtained intersection and the tangent vector at the starting point is calculated, the number of changes in the vector direction is recorded, and the distance from the calculated intersection to the starting point is controlled to ensure the stopping of the closed ring intersection. For cross intersections, the angle between the normal vectors of the two surfaces where the intersection is located is recorded each time, and the tracking and calculation of the cross tangent point are stopped when it is less than a preset tolerance.

Citation Information

Cited By

  • Method and device for performing Boolean operation on entity formed by any quadric surface and storage medium

    CN119203508A