BVH construction and elimination method for parametric surface intersection
Through the BVH construction and optimization of the separation axis theorem, the problem of difficulty in taking into account both robustness and efficiency in parameter surface intersecting is solved, and the accurate positioning and efficient detection of the intersection lines of multiple parameter surfaces is achieved. It is suitable for industrial software. NURBS surfaces and other common surface types.
Patent Information
- Application Number
- CN202411021863.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2025-01-14
AI Technical Summary
The prior art is difficult to achieve robustness, high precision and high efficiency of parameter surface interception in the field of computer-aided design, especially in industrial software, where efficiency and accuracy are difficult to balance.
Using the parameter surface intersecting method based on BVH construction and separation axis theorem, the construction of a complete quadtree and AABB bounding box is combined with non-recursive construction and approximate separation axis intersecting, optimize the parameter domain range reduction and post-processing steps to improve the intersecting Line positioning accuracy and calculation efficiency.
Accurate positioning and efficient intersection detection between multiple parameter surfaces is realized, which significantly reduces the calculation time and the number of Newton iterations, improves the accuracy and efficiency of intersection positioning, and is suitable for complex and large-difference parameter surface intersection situations. .
Smart Images

Figure CN119312521A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of industrial software technology and relates to a BVH (Bounding Volume Hierarchy) construction and exclusion method for parametric surface intersection, which is mainly used as an underlying algorithm in industrial software in the field of computer-aided design. Background Art
[0002] Calculating the intersection of parametric surfaces is one of the most fundamental and core issues in Computer Aided Design (CAD) industrial software. It is the foundational technology for key modules of industrial software, such as Boolean operations, complex structure / surface modeling, and manufacturing process simulation and control. It is also essential for building CAD / CAM systems. In academia, robust and efficient surface intersection calculation remains an unresolved technical challenge; in industry, domestic CAD kernels still lack effective surface intersection solutions and related modules. Currently, mainstream industrial software, such as Dassault Systèmes CATIA and Siemens NX, utilizes the classic Non-Uniform Rational B-Splines (NURBS) surface / curve representation. Accurately and efficiently calculating the intersection of NURBS surfaces is a difficult and important problem with great practical industrial value.
[0003] The intersection of two parametric surfaces is very complex, involving closed loops, self-intersections, isolated points, point tangency, line tangency, and other ambiguous situations. Detecting and describing all these intersections, and calculating them accurately and with high precision, are key metrics for evaluating surface learning algorithms. Currently, 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 a line-surface intersection problem; Disadvantages: Can easily miss isolated tangent points or small loops, making it difficult to strike a balance between accuracy and computational efficiency;
[0006] Subdivision method: Advantages: After combining 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] Tracing method: Advantages: Fast calculation speed, naturally ordered calculation results, eliminating the need for sorting. Disadvantages: Requires a pre-determined starting point as the algorithm's starting condition. Intersections are easily missed, and the calculation process can easily 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 currently still struggle to meet the industrial standards of robustness, high precision, and high efficiency. Based on this, the present invention provides a BVH construction and elimination method for parametric surface intersection, which is a subdivision method in the subdivision + tracking method. It is applicable to mainstream industrial NURBS surfaces, as well as common parametric surfaces in industrial software, such as planes, cylinders, cones, toruses, quadratics, etc., as well as procedural surfaces generated from a reference curve or a reference surface, including spin, extend, offset, etc. Summary of the Invention
[0010] To address the shortcomings of the existing technology, the present invention proposes a BVH construction and exclusion method for parametric surface intersection. This method designs a parametric surface BVH construction and exclusion method based on the Bounding Volume Hierarchy (BVH) and the Separating Axis Theorem. It is designed to be applicable to BVH construction, intersection and exclusion between different types of parametric surfaces, and to balance the algorithm's computational accuracy, efficiency and robustness.
[0011] The technical solution adopted in the present invention is:
[0012] The present invention provides a more accurate subdivision algorithm from the construction of BVH to the subsequent exclusion of bounding box pairs, ensuring the efficiency and stability of the subsequent intersection process.
[0013] A BVH construction and elimination method for parametric surface intersection, comprising:
[0014] The first step is to build a complete quadtree for the surface. Since the parameter domain of the surface has two directions, uv, the two directions are evenly divided, and the entire parameter domain is divided into n*n parameter domain grids, where each parameter domain grid corresponds to a surface patch. The leaf node of the BVH tree is the surface patch corresponding to each parameter domain grid. The leaf node contains the corresponding parameter domain range and the AABB bounding box, where the AABB bounding box is constructed by the four vertices corresponding to the parameter domain grid. This method is an approximate bounding box and cannot completely contain the entire surface patch. However, due to the high resolution of the parameter domain division (128*128), it can effectively enclose the surface patch in most cases. In the experiment, only four points need to be sampled using AABB, and the efficiency is significantly improved compared to calculating the bounding box of the strict enclosing surface patch.
[0015] After completing the division and sampling of the surface parameter domain, the next step is to non-recursively construct a complete quadtree. Since the construction of leaf nodes is independent of each other, this part can be processed in parallel. However, the recursive construction has the problem that this recursion depends on the result of the lower recursion, which is difficult to parallelize. Therefore, a non-recursive construction is performed according to the iterative method. The first step is to construct the leaf nodes. For a complete quadtree, a node corresponds to a parameter domain grid. By calculating the one-to-one correspondence between the subscript of the leaf node and the parameter on the parameter domain grid, the data of 4 sampling points are obtained from the previously calculated sampling point grid to construct the AABB bounding box. The intermediate nodes in the upper layer only need to directly merge the bounding boxes of the lower layer.
[0016] After completing the construction of BVH, the next step is to perform a parameter domain estimation calculation for the two surfaces. The solution adopted by the present invention is to first use the initial parameter domain range to calculate the BVH of the two surfaces, then intersect the two BVHs, and calculate the maximum parameter domain range corresponding to the leaf node pairs obtained by the intersection, which is the parameter domain range of the first estimation calculation. The stopping condition is set by calculating the aspect ratio before and after the parameter domain range is reduced. Even for two surfaces with a relatively large difference in parameter domain (about 10,000 times), a valid minimum parameter domain can be calculated through three estimation calculations.
[0017] After the parameter domain is reduced, the BVH of the two parametric surfaces is reconstructed using the reduced parameter domain and intersection is determined. The approximate separating axis theorem is used to reduce the number of bounding boxes obtained after intersection. The intersection of the two surface patches is determined by whether the surface patches contained in the bounding boxes overlap in the normal vector direction. If they separate in the normal vector direction, the two surface patches contained in the bounding box pair are considered non-intersecting and the bounding box pair is not used in the subsequent intersection calculation. While using the approximate separating axis to determine intersection, the bounding box pairs are classified. Since the starting points are divided into two types: regular and tangent, which require different equations to calculate, classifying the bounding boxes into two categories in advance facilitates more efficient calculation of the starting points.
[0018] The beneficial effects of the present invention are:
[0019] 1) A BVH intersection framework for two parametric surfaces is proposed, which includes parameter domain reduction, BVH construction, exclusion of intersecting bounding box pairs, and classification. This method is applicable to the intersection judgment between most parametric surfaces and can accurately locate all intersection points and intersection lines no matter how complex the situation is.
[0020] 2) To address the time-consuming calculation problem of NURBS surface assignment, we optimize the underlying architecture. For uniformly sampled parameter domain grids, we pre-calculate and save the B-spline basis functions with the same NURBS surface sampling points on isoparametric lines, thereby reducing the number of repeated calculations.
[0021] 3) For the intersection judgment of two parametric surfaces with a large gap in parameter domains, the BVH-based intersection line parameter domain range positioning algorithm is used to effectively solve the problem of inaccurate intersection point positioning caused by the large gap in parameter domains of the two parametric surfaces.
[0022] 4) A post-processing step was added to the BVH intersection algorithm to effectively exclude the generated bounding box pairs. An approximate separating axis intersection method was used to filter out bounding box pairs with higher accuracy and a greater likelihood of containing intersecting surface patches. This significantly reduced the number of calculation starting points in subsequent Newton iterations and provided a more accurate parameter domain range, reducing the number of Newton iterations. For the case where two surfaces are tangent, the algorithm can reduce the number of bounding box pairs by more than 10 times.
[0023] 5) For the resulting intersecting bounding box pairs, the sampling points corresponding to each bounding box are used to calculate the estimated separating axis. The intersecting bounding box pairs are then divided into regular bounding box pairs and approximately tangent bounding box pairs based on the angle between the separating axes. During the bounding box estimation stage, the relative positions of the surface patches near the intersection are classified. For surface intersections with cross points, the surfaces near the cross points are approximately tangent, while the surface patches at other positions are transversely intersecting. This classification can effectively control the calculation of the starting point from the transversely intersecting bounding box pairs, and can also control the pre-calculation of the cross intersections from the tangent bounding box pairs. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 Figure 1 is a schematic diagram of the overall process of the method of the present invention. (a) shows the uniform division and sampling of the parametric surface, (b) shows the 5-layer BVH construction of the parametric surface, (c) shows the initial BVH intersection result without using the separating axis, and (d) shows the result using the separating axis.
[0025] Figure 2 is a schematic diagram before parameter domain estimation (a), and a schematic diagram after parameter domain estimation (b);
[0026] Figure 3 Schematic diagram of the separating axis theory in a two-dimensional plane (a), a schematic diagram of two BVH intersections before filtering by the separating axis method (b), and a schematic diagram of two BVH intersections after filtering by the separating axis method (c);
[0027] Figure 4 Schematic diagram of a regular bounding box pair (a) and an approximately tangent bounding box pair (b). DETAILED DESCRIPTION
[0028] The present invention provides a BVH construction and elimination method for parametric surface intersection. This method can more accurately locate intersection lines by evenly dividing and sampling the parameter domain, estimating and reducing the parameter domain, and judging intersection using separating axes, thereby greatly reducing the amount of calculation. The contributions of the present invention can be summarized as follows:
[0029] 1) Pre-estimation of the parameter domain range of the surface. By narrowing the parameter domain and locking the range of the intersection line, a more accurate initial value range is provided for the starting point of the subsequent Newton iterative calculation.
[0030] 2) In the sampling point calculation stage, the sampling point calculation of the NURBS surface is optimized by calculating the same B-spline basis in advance and saving it to reduce the number of times.
[0031] 3) Using the approximate separating axis theorem, a large number of bounding box pairs generated by the intersection of two parametric surfaces (BVH) are eliminated, effectively filtering out a large number of redundant bounding box pairs that do not contain intersection lines.
[0032] 4) By calculating the angle between the approximate normal vectors of the bounding box and the two surface patches, the bounding box pairs are divided into two categories: approximate tangent bounding box pairs and regular bounding box pairs.
[0033] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0034] 1. Parallel calculation of sampling points
[0035] After experiments, we set the height of the BVH to 8, the resolution of the parameter domain grid to 128*128, and used a 2D sequence SP to store 129*129 sampling points. Since the sampling point calculation processes are independent of each other, this step can be calculated in parallel.
[0036] 2. NURBS assignment optimization
[0037] The calculation formula for a NURBS surface with p degrees in the u direction and q degrees in the v direction is as follows, where {P i,j} is the control point grid, {w i,j} is the weight factor, {N i,p (u)} and {N j,q (v)} are used as B-spline basis functions defined on the knot vectors U and V.
[0038]
[0039] Convert to homogeneous coordinates
[0040]
[0041] From step 1, the parameter domain grid is uniformly sampled with 128*128, and the value range of parameter u is
[0042] U={u0=uMin,u1,u2,…,u 128 =uMax}
[0043] The value range of parameter v is
[0044] V={v0=vMin,v1,v2,…,v 128 =vMax}
[0045] In step 1, the B-spline basis needs to be calculated 129*129*2 times. There are a lot of repeated calculations in this part. For example, for the isoparametric line
[0046] u=u0,v={v0,v1,v2,…,v 128}
[0047] Among these 129 sampling points, u is constant, and the calculated parameter values are {(u0,v0),(u0,v1),(u0,v2),...,(u0,v 128 )}, they have the same N i,p (u0), so the B-spline basis corresponding to the parameter value in U is calculated in advance And the B-spline basis corresponding to the parameter values in V The number of calculations of the B-spline basis is reduced from the original 129*129*2 to 129*2, and the time complexity is reduced from O(n 2 ) is reduced to O(n)
[0048] 3. BVH bottom-up non-recursive parallel construction
[0049] After completing the calculation of the sampling points, the entire BVH tree is constructed in parallel from the bottom up non-recursively starting from the leaf node.
[0050] 4. Surface parameter domain estimation
[0051] For the case where the parameter domain ranges of two surfaces are quite different, the minimum parameter domain range needs to be calculated in advance. For example, when intersecting a surface with a parameter domain of [-10000, 10000] to [10000, 10000] and a NURBS surface with a parameter domain of [0, 0] to [1, 1], only a small part of them intersect. However, if the BVH intersection is performed according to the original parameter domain, the BVH bounding boxes of the two surfaces will be quite different. For example, Figure 2 (a) shows the blue bounding box, which is larger than the spherical bounding box, and the red one, which is smaller. This situation affects the stability of subsequent starting point calculations.
[0052] Parameter domain reduction step
[0053] a. Construct a 6-layer BVH of S1(u,v) and S2(u,v), denoted as A and B
[0054] b. Traverse A and B. For each pair of intersecting leaf nodes, record the maximum ranges of parameters u and v [uMin,uMax] and [vMin,vMax]. This is the result after the parameter domain is reduced once.
[0055] c. Compare the new parameter domain with the old parameter domain. If the ratio of the old parameter domain to the new parameter domain is less than 2, the algorithm stops. The result obtained in step b is the final reduced parameter domain. If the ratio is greater than 2, repeat steps a and b.
[0056] Finally, the result of reconstructing the BVH intersection after obtaining the narrowed parameter domain is as follows Figure 2 (b) 5. Excluding bounding boxes by approximating the separating axis
[0057] like Figure 3 In the facet, for two convex polygons, if there is a straight line separating the two convex polygons, then the axis perpendicular to this line is called the separating axis. If the projections of the two objects on the separating axis do not intersect, then the two objects do not intersect. If there is a non-intersection on any axis, then the two objects are definitely non-intersecting and the test is exited.
[0058] Extending the 2D Separating Axis Theorem to 3D, in 2D, for two convex polygons, we need to find a straight line to separate the two convex polygons. In 3D, we need to find such a surface to separate the two surface patches. Due to the previous BVH division, the surface patch at the leaf node is small enough, and the four sampling points in the bounding box can approximately form a surface. By finding the separating surface of the two spatial quadrilaterals, we can approximately determine whether the two surface patches intersect. The steps are as follows
[0059] 1) For the surface patches P1 and P2 in the bounding box, we use two surfaces L1 and L2 to approximate the two surface patches, and project the sampling points of the surface patches onto surfaces L1 and L2.
[0060] 2) Determine the three separating axes, the normal vectors n1 and n2 of L1 and L2, and the cross product of the two normal vectors
[0061] n3=n1×n2;
[0062] 3) For each separation axis in step 2, project the sampling points of L1 and L2 onto the normal vector and calculate the projection interval;
[0063] 4) If there is a non-intersecting projection interval on one axis, the algorithm ends, P1 and P2 are considered non-intersecting, and the pair of bounding boxes is discarded.
[0064] 6. Bounding box type classification
[0065] There are two types of starting point calculation equations, which are divided into regular point and tangent point calculations. We also divide the bounding boxes into two categories, approximate tangent bounding boxes and regular bounding boxes. Due to the collinearity of the two surface normal vectors at the tangent point, we calculate the angle between the normal vectors of the surface pieces in the two bounding boxes. If the angle is close to 0 or π, it is considered to be a pair of approximate tangent bounding boxes. The specific method is as follows
[0066] 1) All intersecting bounding box pairs {B1, B2} obtained by intersecting BVH
[0067] 2) The surface patches contained in B1 and B2 are respectively called P1(u,v) and P2(s,t), where (u,v)∈
[0068] [u0,u1]×[v0,v1],(s,t)∈[s0,s1]×[t0,t1], calculate P1 with parameters The normal vector N1 and P2 are in the parameter Normal vector N2
[0069] 3) Calculate the angle ang=angle(N1,N2) between N1 and N2. Given a tolerance ∈, if ang<∈, add {B1,B2} to the approximate tangent bounding box pair tangentBoxPairs, otherwise add the regular bounding box pair regularBoxPairs
[0070] The result of the regular bounding box pair is as follows Figure 4 (a), the results of approximate tangent bounding box pairs are as follows Figure 4 (b).
[0071] According to a specific embodiment of the present invention, an electronic device is also provided, including 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.
[0072] According to a specific embodiment of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. When the program is executed by a processor, the steps of any of the above methods are implemented.
[0073] The foregoing descriptions of specific exemplary embodiments of the present invention are for the purpose of illustration and description. These descriptions are not intended to limit the 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 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 invention. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the invention and various different options and changes. The scope of the present invention is intended to be defined by the claims and their equivalents.
Claims
1. A BVH construction and elimination method for parametric surface intersection, characterized in that: include: Evenly divide and sample the parametric surface; At a specific resolution, a whole parameter domain is divided into n*n parameter domain grids, where each parameter domain grid corresponds to a surface patch; Starting from the leaf nodes, a complete quadtree is constructed from the bottom up non-recursively to complete the construction of BVH; the leaf nodes of the BVH tree are the surface patches corresponding to each parameter domain grid. The leaf nodes contain the corresponding parameter domain range and AABB bounding box, where the AABB bounding box is constructed by the four vertices corresponding to the parameter domain grid; Estimate and calculate the parameter domains of the two surfaces, reduce them, reconstruct the BVH in the final reduced parameter domain range and judge the intersection; The bounding box pairs obtained after the intersection are excluded using the approximate separation axis to reduce the number of bounding boxes, and the bounding box pairs are classified.
2. The BVH construction and elimination method for parametric surface intersection according to claim 1, characterized in that: The specific resolution is 128*128.
3. The BVH construction and elimination method for parametric surface intersection according to claim 1, characterized in that: For uniformly sampled parameter domain grids, the B-spline basis functions with the same sampling points of the NURBS surface are pre-calculated on the isoparametric lines and saved.
4. The BVH construction and elimination method for parametric surface intersection according to claim 1, characterized in that: The method for reducing the parameter domain is: first use the initial parameter domain range to calculate the BVH of the two surfaces, then intersect the two BVHs, calculate the maximum parameter domain range corresponding to the leaf node pairs obtained by the intersection, which is the parameter domain range of an estimated calculation, and set the stopping condition by calculating the aspect ratio before and after the parameter domain range is reduced.
5. The BVH construction and elimination method for parametric surface intersection according to claim 3, characterized in that: If the ratio of the old parameter domain to the new parameter domain is less than the set stopping condition, the final reduced parameter domain is obtained; if it is not satisfied, the BVH is reconstructed on the obtained parameter domain and the intersection is judged. For each pair of intersecting leaf nodes, the corresponding maximum parameter domain range is recorded, and the ratio of the previous parameter domain to the current parameter domain is calculated again for judgment.
6. The BVH construction and elimination method for parametric surface intersection according to claim 1, characterized in that: The use of an approximate separating axis for exclusion is to determine whether the two surface patches intersect by whether there is overlap in the normal vector direction on the surface patches contained in the bounding box. If they are separated in the normal vector direction, it is considered that the two surface patches contained in the bounding box pair do not intersect, and the bounding box pair does not participate in subsequent intersection calculations.
7. The BVH construction and elimination method for parametric surface intersection according to claim 6, characterized in that: Specifically include: 1) For the surface patches P1 and P2 in the bounding box, use two planes L1 and L2 to approximate them respectively, and project the sampling points of the surface patches onto planes L1 and L2; 2) Determine three separation axes: the normal vectors n1 and n2 of L1 and L2, and the cross product of the two normal vectors n3 = n1 × n2; 3) For each separation axis in step 2), project the sampling points of L1 and L2 onto the normal vector and calculate the projection interval; 4) If there is a projection interval on one axis that does not intersect, P1 and P2 are considered to be disjoint, and the pair of bounding boxes is discarded.
8. The BVH construction and elimination method for parametric surface intersection according to claim 1, characterized in that: The classification of the bounding box pairs is specifically as follows: the angle between the normal vectors of the surface patches in the two bounding boxes is calculated; if the angle is close to 0 or π, it is considered that this is a pair of approximately tangent bounding box pairs, otherwise it is a regular bounding box pair.
