CAD model construction method based on special curved surface intersection, medium and product
By constructing a CAD model with bounded straight-grained surface and truncated quadratic surfaces, calculating the intersection line and ensuring its accuracy, the topological structure error caused by the surface interception algorithm in the CAD system is solved, and the reliability and practicality of the model are improved. .
Patent Information
- Application Number
- CN202411209500.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-20
AI Technical Summary
In existing CAD systems, surface interception algorithms are difficult to ensure the correct topology, and are prone to loss or generate redundant interception lines, resulting in low reliability of the built CAD model.
By constructing an original CAD model including bounded straight-grained surfaces and truncated quadratic surfaces, calculating its bounding box and judging intersections, solving intersection lines, using intersection line parameter equations and singular point parameter equations to ensure accurate calculation of intersection lines, and constructing CAD model with accurate topology.
The high-reliability CAD model construction is realized, the problem of errors in the intersection topology structure in the existing technology is solved, and the reliability and practicality of the CAD model is improved.
Smart Images

Figure CN119167456A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of CAD / CAM and geometric modeling, and in particular to a CAD model construction method, medium and product based on special surface intersection. Background Art
[0002] Surface intersection is a common problem in computer-aided design (CAD) and geometric modeling systems. In many CAD system modeling operations, such as Boolean operations, mesh generation, and rendering, efficient, robust, and topologically correct surface intersection algorithms are required. Currently, the industry generally agrees that the main reason for the low reliability of CAD systems is the lack of efficient and topologically correct surface intersection algorithms.
[0003] The traditional intersection algorithm for general free-form surfaces used in existing CAD systems is difficult to obtain accurate intersection line parameter equations, which leads to the loss of intersection lines or the generation of redundant intersection lines during intersection calculation. It cannot guarantee that all intersection line segments can be found, resulting in the calculated intersection lines having incorrect topological structures, which in turn leads to low reliability of the constructed CAD model. Summary of the invention
[0004] The purpose of this application is to provide a CAD model construction method, medium and product based on special surface intersection, so as to solve the problem that the surface intersection algorithm adopted by the existing CAD system may lose the intersection line or generate redundant intersection lines, resulting in the calculated intersection lines having an erroneous topological structure, and thus resulting in the low reliability of the constructed CAD model.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a CAD model construction method based on special surface intersection, comprising:
[0007] Construct the original CAD model including bounded ruled surfaces and truncated quadric surfaces;
[0008] Determine parametric equations for bounded ruled surfaces and implicit equations for truncated quadric surfaces;
[0009] Based on the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadric surface, the bounding box of the bounded ruled surface and the bounding box of the truncated quadric surface are calculated, and it is determined whether the bounding boxes of the two surfaces intersect, and if so, the intersection line of the truncated quadric surface and the bounded ruled surface is solved;
[0010] The final CAD model is constructed according to the intersection line of the truncated quadratic surface and the bounded ruled surface.
[0011] Optionally, solving the intersection line of the truncated quadratic surface and the bounded ruled surface includes:
[0012] Substituting the parametric equation of the bounded ruled surface into the implicit equation of the truncated quadratic surface to obtain the parametric equation of the plane trajectory;
[0013] Solving the plane trajectory parameter equation to obtain the intersection line parameter equation of the two curves;
[0014] Calculating the singular point of the intersection line of the two surfaces to obtain the singular point parameter equation of the intersection line of the two surfaces;
[0015] Substituting the intersection line parameter equation into the plane constraint of the truncated quadratic surface, and obtaining a set of inequality constraints for parameters in the intersection line parameter equation according to the obtained plane constraint, the given value range of the parameters therein and the singular point parameter equation of the intersection line;
[0016] The inequality constraint is solved to obtain parameter values that satisfy the inequality constraint, that is, the parameter values of the intersection line equation of the two surfaces, so as to achieve accurate calculation of the intersection line of the two surfaces.
[0017] Optionally, the parametric equation of the bounded ruled surface is:
[0018]
[0019] Wherein, P(s, t) represents the ruled surface controlled by parameters s and t; P1(s) is the generating curve of the ruled surface, which controls the position of the ruled surface. As the parameter s changes, the curve P1(s) moves in space; P2(s) is the unit vector related to the parameter s, which controls the direction of the ruled surface. As the parameter s changes, the direction of the ruled surface will also change; t controls the length of the ruled surface, which is determined according to the value range of t;
[0020]
[0021] are the coordinates of the point on the curve P1(s), are the coordinates of a point on the vector P2(s), x1(s), x2(s), y1(s), y2(s), z1(s), z2(s), w(s) are all polynomials with respect to parameter s, and s, t∈[s min ,s max ]×[t min ,t max ],s min is the lower limit of parameter s, s max is the upper limit of parameter s, t min is the lower limit of parameter t, t maxis the upper limit of parameter t, and the value range of parameters s and t determines the range of the ruled surface;
[0022] A quadratic surface is represented by:
[0023] a 11 x 2 +a 22 y 2 +a 33 z 2 +2a 12 xy+2a 13 xz+2a 23 yz+2a 14 x+2a 24 y+
[0024] 2a 34 z+a 44 =0;
[0025] Among them, the coefficient a ij is a constant, 1≤i,j≤4;
[0026] The truncated quadratic surface is composed of a quadratic surface and n plane constraints, and any plane constraint is defined as:
[0027] a i x+b i y+c i z+d i ≤0;
[0028] Among them, the coefficient a i ,b i ,c i ,d i is a constant;
[0029] The implicit equation of the truncated quadratic surface is:
[0030] Q A ={X|X T A u X+2C T X+d=0,a i x+b i y+c i z+d i ≤0,0≤i≤n};
[0031] Where X is the three-dimensional coordinate point on the quadratic surface, X = (x, y, z) T , the coefficient matrix Constant term d = a 44 .
[0032] Optionally, the plane trajectory parameter equation is:
[0033] D(s,t)=c2(s)t 2 +2c1(s)t+c0(s)=0;
[0034] Where D(s,t) represents the parametric equation of the plane trajectory, and the intermediate variables c2(s), c1(s), and c0(s) are:
[0035] c2(s)=P2(s) T A u P2(s);
[0036] c1(s)=P1(s) T A u P2(s)+C T P2(s);
[0037] c0(s)=P1(s) T A u P1(s)+2C T P1(s)+d.
[0038] Optionally, the intersection line parameter equation is:
[0039]
[0040] Where P(s) represents the parametric equation of the intersection line, P x (s), P y (s) and P z (s) is the component of the intersection line parameter equation P(s) in the x, y and z directions, and the intermediate variable Δ(s) = c1(s) 2 -c2(s)c0(s);
[0041] The inequality constraints are:
[0042] s min ≤s≤s max ;
[0043]
[0044] a i P x (s)+b i P y (s)+c i P z (s)+d i ≤0,1≤i≤n.
[0045] Optionally, the singular point includes at least one of an isolated singular point, a cusp point and a self-intersection point.
[0046] Optionally, it also includes:
[0047] In the process of solving the inequality constraint, the tolerance of the real root is controlled to ensure that the intersection line of the two surfaces calculated is within a given tolerance range.
[0048] Optionally, solving the inequality constraint includes:
[0049] The real roots of the polynomial corresponding to each inequality are calculated by using a method based on real root isolation, and the sign of each real root is calculated by using the subresultant theory to obtain the parameter value range that satisfies the inequality constraints;
[0050] In the process of solving the inequality constraint, controlling the tolerance of the real root includes:
[0051] The interval width δ<∈ / M for ensuring real root isolation, where M is the upper bound of the intersection parameter equation estimated based on the parameter value range s∈[a,b] and using interval calculation, and ∈ is a given tolerance threshold.
[0052] In a second aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-mentioned methods for constructing a CAD model based on intersection of special surfaces.
[0053] In a third aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for constructing a CAD model based on special surface intersection.
[0054] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0055] The present application provides a CAD model construction method, medium and product based on special surface intersection. By constructing an original CAD model including a bounded ruled surface and a truncated quadric surface, the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadric surface can be obtained; when calculating the bounding box of the bounded ruled surface and the bounding box of the truncated quadric surface, and accurately judging that the bounding boxes of the two calculated surfaces intersect, the intersection line of the truncated quadric surface and the bounded ruled surface is solved, and the final CAD model is constructed according to the intersection line of the truncated quadric surface and the bounded ruled surface; the truncated quadric surface and the bounded ruled surface are limited to be intersected, and the accurate parametric equation of the intersection line can be obtained according to the parametric equations of the truncated quadric surface and the bounded ruled surface, so that the topological structure of the solved intersection line is accurate and reliable, ensuring the high reliability of the constructed CAD model, and solving the problem that the intersection line calculated by the surface intersection algorithm adopted by the existing CAD system has an erroneous topological structure, which leads to the low reliability of the constructed CAD model. In addition, the present application limits the intersection of truncated quadratic surfaces and bounded ruled surfaces, and defines the range of the intersection, so as to achieve the intersection within the bounded area, thereby greatly improving the practicality of the proposed CAD model construction method based on special surface intersection. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A schematic diagram of a flow chart of a CAD model construction method based on special surface intersection provided in one embodiment of the present application;
[0058] Figure 2 A schematic diagram of functional modules of a CAD model building device based on special surface intersection provided in one embodiment of the present application;
[0059] Figure 3 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0061] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0062] In an exemplary embodiment, Figure 1 As shown, a CAD model construction method based on special surface intersection is provided, including the following steps 101 to 104. Among them:
[0063] Step 101: construct an original CAD model including bounded ruled surfaces and truncated quadratic surfaces.
[0064] Step 102, obtaining the parametric equations of the bounded ruled surface and the implicit equations of the truncated quadratic surface.
[0065] In the embodiment of the present application, the parametric equation of the bounded ruled surface is:
[0066]
[0067] Among them, P(s,t) represents the ruled surface controlled by parameters s and t; P1(s) is the generating curve of the ruled surface, which controls the position of the ruled surface. As the parameter s changes, the curve P1(s) moves in space; P2(s) is the unit vector related to the parameter s, which controls the direction of the ruled surface. As the parameter s changes, the direction of the ruled lines will also change; t controls the length of the ruled lines, which is determined according to the value range of t.
[0068] are the coordinates of the point on the curve P1(s), are the coordinates of a point on the vector P2(s), x1(s), x2(s), y1(s), y2(s), z1(s), z2(s), w(s) are all polynomials with respect to parameter s, and s, t∈[s min ,s max ]×[t min ,t max ],s min is the lower limit of parameter s, s max is the upper limit of parameter s, t min is the lower limit of parameter t, t max is the upper limit of parameter t. The value range of parameters s and t determines the range of the ruled surface.
[0069] A quadratic surface can usually be represented as follows:
[0070] a 11 x 2 +a 22 y 2 +a 33 z 2 +2a12 xy+2a 13 xz+2a 23 yz+2a 14 x+2a 24 y+
[0071] 2a 34 z+a 44 =0;
[0072] Among them, the coefficient a ij is a constant, 1≤i,j≤4.
[0073] For simplicity, the above equation can be abbreviated as:
[0074] X T A u X+2C T X+d=0;
[0075] in:
[0076]
[0077] A truncated quadratic surface is composed of a quadratic surface and n plane constraints (the number of plane constraints can be 0, that is, n = 0 in this case). Any plane equation can be defined as:
[0078] a i x+b i y+c i z+d i =0;
[0079] Among them, the coefficient a i ,b i ,c i ,d i is a constant, so any plane constraint can be defined as:
[0080] a i x+b i y+c i z+d i ≤0.
[0081] Then the implicit equation for a given truncated quadratic surface is:
[0082] Q A ={X|X T A u X+2C T X+d=0,a i x+b i y+c i z+d i ≤0,0≤i≤n};
[0083] Where X is the three-dimensional coordinate point on the quadratic surface, X = (x, y, z) T , n represents the total number of plane constraints that truncate the quadratic surface. The plane constraints that truncate the quadratic surface and the number thereof are determined according to the shape of the truncated quadratic surface that is actually intersected.
[0084] Step 103, based on the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadratic surface, calculate the bounding box of the bounded ruled surface and the bounding box of the truncated quadratic surface, and determine whether the bounding boxes of the two surfaces intersect. If so, solve the intersection line of the truncated quadratic surface and the bounded ruled surface.
[0085] In the embodiment of the present application, since each quadratic surface has three mutually perpendicular main directions, the coefficient matrix A of the truncated quadratic surface can be obtained by u Decompose to get three mutually perpendicular main directions, and find the planes that enclose the quadratic surface in these three directions (which can be obtained by Lagrange multiplier method), and finally get a directed bounding box of the quadratic surface.
[0086] Due to x i (s),y i (s),z i (s), w(s) are both polynomials with respect to parameter s, 1≤i, j≤4. When the range of parameter s is given [s min ,s max ], then these polynomials x i (s),y i (s),z i (s), w(s) are transformed into Bezier polynomials, and then x can be determined based on the convex hull of the Bezier polynomials. i (s),y i (s),z i The range of P1(s), P2(s) is determined by interval calculation, and then the range of the bounded ruled surface P(s, t) is obtained by interval calculation, which is the bounding box of the bounded ruled surface.
[0087] Step 104: construct a final CAD model according to the intersection line of the truncated quadratic surface and the bounded ruled surface.
[0088] In the embodiments of the present application, the specific method of constructing the final CAD model based on the intersection line of the truncated quadratic surface and the bounded ruled surface is not limited and can be selected according to actual needs. For example, in solid modeling, Boolean operations often involve operations between complex geometric bodies. The intersection of the truncated quadratic surface and the bounded ruled surface can help determine the boundary of the intersection of the two geometric bodies, and then construct the final CAD model. For another example, when refining and optimizing the model, it is necessary to cut the ruled surface into smaller surface segments. Through the intersection operation, the intersection line or intersection point of the bounded ruled surface and the truncated quadratic surface can be accurately determined, thereby constructing the final CAD model.
[0089] By implementing the above steps 101 to 104, by limiting the intersection of the truncated quadratic surface and the bounded ruled surface, the accurate parametric equation of the intersection line can be obtained according to the parametric equations of the truncated quadratic surface and the bounded ruled surface, so that the topological structure of the solved intersection line is accurate and reliable, ensuring the high reliability of the constructed CAD model, and solving the problem that the intersection line calculated by the surface intersection algorithm used in the existing CAD system has an erroneous topological structure, which in turn leads to the low reliability of the constructed CAD model. In addition, most of the existing intersection algorithms are to intersect in the whole space, so as to obtain an intersection line in an unconstrained state, but because the surfaces in the actual application scenarios are mostly given in a bounded form, the intersection algorithm that intersects in the whole space is difficult to apply to the actual application scenarios, and the present application limits the intersection of the truncated quadratic surface and the bounded ruled surface, and defines the scope of the intersection, so that the practicality of the proposed intersection method is greatly improved.
[0090] As an optional implementation, the step of solving the intersection line of the truncated quadratic surface and the bounded ruled surface includes the following steps 1031 to 1035. Among them:
[0091] Step 1031, substituting the parametric equation of the bounded ruled surface into the implicit equation of the truncated quadratic surface to obtain the plane trajectory parametric equation.
[0092] In the embodiment of the present application, the parametric equation P(s, t) of the bounded ruled surface is substituted as X into the implicit equation Q of the truncated quadratic surface. A In the above equation, we can get the parametric equation D(s,t) of the plane trajectory with respect to parameters s and t:
[0093] D(s,t)=(P1(s)+tP2(s)) T A u (P1(s)+tP2(s))+2C T (P1(s)+tP2(s))+d=0;
[0094] After finishing, we can get:
[0095] D(s,t)=c2(s)t 2 +2c1(s)t+c0(s)=0;
[0096] in:
[0097] c2(s)=P2(s) T A u P2(s);
[0098] c1(s)=P1(s) T A u P2(s)+C T P2(s);
[0099] c0(s)=P1(s) T A u P1(s)+2C T P1(s)+d.
[0100] Step 1032, solving the plane trajectory parameter equation to obtain the intersection line parameter equation of the two curves.
[0101] In the embodiment of the present application, since the plane trajectory parameter equation D(s, t) is quadratic with respect to the parameter t at this time, the intersection line parameter equation P(s) of the two curves can be obtained by directly solving the plane trajectory parameter equation D(s, t):
[0102]
[0103] Among them, P x (s), P y (s) and P z (s) is the component of the intersection line parameter equation P(s) in the x, y and z directions, and the intermediate variable Δ(s) = c1(s) 2 -c2(s)c0(s).
[0104] Step 1033, calculating the singular point of the intersection line of the two surfaces, and obtaining the singular point parameter equation of the intersection line of the two surfaces.
[0105] In the embodiment of the present application, the singular point includes at least one of an isolated singular point, a cusp point, and a self-intersection point. The isolated singular point of the intersection line can be obtained by calculating the plane trajectory parameter equation, that is, the isolated singular point of the plane curve D(s, t) = 0. For the isolated singular point of the plane curve D(s, t) = 0, the solution process is as follows:
[0106]
[0107] in, represents the first-order derivative of the plane trajectory parameter equation D(s,t) with respect to the parameter s, Represents the first-order derivative of the plane trajectory parameter equation D(s,t) with respect to parameter t;
[0108] Simplifying the above formula, we can get:
[0109] c2(s)t 2 +2c1(s)t+c0(s)=0;
[0110] c'2(s)t 2 +2c'1(s)t+c'0(s)=0;
[0111] c2(s)t+c1(s)=0;
[0112] Wherein, c'2(s) represents the first-order derivative of c2(s), c'1(s) represents the first-order derivative of c1(s), and c'0(s) represents the first-order derivative of c0(s);
[0113] When c2(s)≠0, according to the last equation above, we can get t=-c1(s) / c2(s). Then, substituting t=-c1(s) / c2(s) into the first two equations, we get the parameter s that satisfies the following isolated singular point parameter equation:
[0114]
[0115] When c2(s)=0, it means that c1(s)=0, so it can also be deduced that c0(s)=0. This situation is impossible, so the problem of solving isolated singular points can be directly transformed into the problem of finding roots of isolated singular point parametric equations (univariate polynomials).
[0116] The cusp of a curve is the point where the tangent direction disappears. The solution process is:
[0117] Assume that any point on the intersection line is P, and its corresponding pair of parameters is (s, t). Consider using the implicit function theorem and regard the parameter s as a function s(t) of the parameter t, then we can get:
[0118]
[0119] in, represents the first derivative of parameter s with respect to parameter t;
[0120] Let T P is the tangent direction of the curve at point P, then:
[0121]
[0122] in, represents the first-order derivative of the equation P(s(t), t) with respect to the parameter t. P(s(t), t) is the equation obtained by replacing the parameter s in the parametric equation P(s, t) of the bounded ruled surface with the function s(t). represents the first-order derivative of the equation P(s,t) with respect to parameter s;
[0123] So solving the cusp is equivalent to solving the following cusp parameter equation:
[0124]
[0125] or:
[0126]
[0127] For the self-intersection points, the self-intersection lines of the bounded ruled surface can be obtained based on the mu basis theory, and the self-intersection points of the intersection lines can be calculated through the self-intersection lines of the bounded ruled surface.
[0128] Step 1034, substitute the intersection line parameter equation into the plane constraint of the truncated quadratic surface, and obtain a set of inequality constraints for the parameters in the intersection line parameter equation based on the obtained plane constraint, the given value range of the parameters therein and the singular point parameter equation of the intersection line.
[0129] In the embodiment of the present application, the intersection parameter equation P(s)=(P x (s),P y (s),P z (s)) T Substitute into the plane constraint a of the truncated quadratic surface i x+b i y+c i z+d i ≤0,0≤i≤n, we get:
[0130] a i P x (s)+b i P y (s)+c i P z (s)+d i ≤0,0≤i≤n;
[0131] According to the above plane constraints, the range of the parameter s and the parametric equation of the singular point of the intersection line, the intersection problem is transformed into the following set of inequality constraints:
[0132] s min ≤s≤s max ;
[0133]
[0134] a i P x (s)+b i P y (s)+c i P z (s)+d i ≤0,1≤i≤n.
[0135] Step 1035, solving the inequality constraint to obtain parameter values that satisfy the inequality constraint, that is, parameter values of the intersection line equation of the two surfaces, so as to achieve accurate calculation of the intersection line of the two surfaces.
[0136] In the embodiment of the present application, the method for solving the inequality constraint is not specifically limited and can be selected according to actual needs. For example, the real root of the polynomial corresponding to each inequality is calculated by a method based on real root isolation, and the sign at each real root can be calculated by subresultant theory.
[0137] Implement the above steps 1031 to 1035, analyze the special properties of the truncated quadratic surface and the bounded ruled surface based on the parametric equations of the truncated quadratic surface and the bounded ruled surface, and obtain the parametric equations of the singular points on the intersection line. Finally, substitute the parametric equations of the intersection line into the plane constraints of the truncated quadratic surface, and convert the intersection problem into a series of inequality constraints based on the obtained plane constraints and the given value ranges of the parameters therein and the parametric equations of the singular points of the intersection line. By solving the inequality constraints, the parameter values that satisfy the inequality constraints are obtained, that is, the parameter values of the intersection line of the two surfaces, so as to achieve accurate calculation of the intersection line of the two surfaces, thereby ensuring that the intersection line segment will not lose the intersection line and generate redundant intersection lines (self-intersection points in singular points will cause erroneous intersection lines to form redundant intersection lines), and further ensure that the topological structure of the solved intersection line is accurate and reliable.
[0138] As an optional implementation, in order to ensure that the error of the intersection line of the two surfaces is controllable, in the process of solving the inequality constraint, it is necessary to control the tolerance of the real root to ensure that the final calculated intersection line of the two surfaces is within a given tolerance range.
[0139] In the embodiment of the present application, the real root of the polynomial corresponding to each inequality can be calculated by a method based on real root isolation, and the sign at each real root can be calculated by using the resultant theory to obtain the parameter value range that satisfies the inequality constraint. Assuming that P(s), s∈[a,b] is the parametric equation of the intersection of the two surfaces being calculated, we take the left endpoint of the real root isolation interval [a,b] as an example to consider the error controllability:
[0140] Assume the exact left endpoint is And the width of the interval of real root isolation is δ, then according to the differential mean value theorem we can get:
[0141]
[0142] Wherein, M is the upper bound of the intersection parameter equation estimated based on the parameter value range s∈[a,b] and using interval calculation;
[0143] Then the interval width δ<∈ / M to ensure real root isolation, ∈ is a given tolerance threshold, which can ensure That is, the error is controllable.
[0144] Many surface intersection algorithms often only obtain an intersection result, but the accuracy of this intersection result is difficult to guarantee. To solve this problem, this application transforms the original intersection problem into a set of inequality constraints, and obtains the intersection line representation within the tolerance range by solving this set of inequality constraints, thus ensuring that the error of the intersection line is controllable.
[0145] The present application also provides an application scenario, which applies the above-mentioned CAD model construction method based on special surface intersection. Specifically: The CAD model construction method based on special surface intersection provided in this embodiment can be applied in the scene of automobile body appearance design or aircraft wing design. The CAD model construction method based on special surface intersection provided in this embodiment belongs to the link of CAD model construction in the scene of automobile body appearance design or aircraft wing design. Specifically, when constructing a CAD model in a car body design or an aircraft wing design scenario, an original CAD model including a bounded ruled surface and a truncated quadric surface is constructed, and the bounded ruled surface can be constructed as the appearance. In the process of optimizing the appearance, a truncated quadric surface for clipping the bounded ruled surface can be constructed. By determining the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadric surface, the bounding box of the bounded ruled surface and the bounding box of the truncated quadric surface are calculated based on the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadric surface, and it is determined whether the bounding boxes of the two calculated surfaces intersect, so as to ensure that a truncated quadric surface intersecting with the bounded ruled surface is constructed; finally, the intersection method of the truncated quadric surface and the bounded ruled surface of the embodiment of the present application is used to perform intersection, and the intersection line of the ruled surface and the quadric surface can be accurately determined by intersection, so that the bounded ruled surface can be accurately clipped using the intersection line, and the final CAD model is constructed.
[0146] Based on the same inventive concept, the embodiment of the present application also provides a CAD model construction device based on special surface intersection for implementing the CAD model construction method based on special surface intersection involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the CAD model construction device based on special surface intersection provided below can refer to the limitations of the CAD model construction method based on special surface intersection above, and will not be repeated here.
[0147] In an exemplary embodiment, Figure 2 As shown, a CAD model construction device 20 based on special surface intersection is provided, comprising:
[0148] The original model construction module 201 is used to construct an original CAD model including bounded ruled surfaces and truncated quadratic surfaces;
[0149] The surface equation determination module 202 is used to determine the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadratic surface; the bounded ruled surface, the truncated quadratic surface and the parametric equation thereof are described in detail in the above method embodiment, which will not be repeated here;
[0150] The intersection line solving module 203 is used to calculate the bounding box of the bounded ruled surface and the bounding box of the truncated quadric surface based on the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadric surface, and determine whether the bounding boxes of the two surfaces intersect. If so, solve the intersection line of the truncated quadric surface and the bounded ruled surface;
[0151] The final model construction module 204 is used to construct a final CAD model according to the intersection line of the truncated quadratic surface and the bounded ruled surface.
[0152] As an optional implementation, the intersection line solving module 203 includes:
[0153] A collision detection module 2031 is used to calculate the bounding box of the bounded ruled surface and the bounding box of the truncated quadratic surface based on the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadratic surface, and determine whether the calculated bounding boxes of the two surfaces intersect;
[0154] The trajectory equation calculation module 2032 is used to substitute the parametric equation of the bounded ruled surface into the implicit equation of the truncated quadratic surface to obtain the plane trajectory parametric equation when the bounding boxes of the two calculated surfaces intersect;
[0155] The intersection line equation calculation module 2033 is used to solve the plane trajectory parameter equation to obtain the intersection line parameter equation of the two curves;
[0156] A singular point analysis module 2034 is used to calculate the singular point of the intersection line of the two surfaces and obtain the singular point parameter equation of the intersection line of the two surfaces;
[0157] The inequality constraint conversion module 2035 is used to substitute the intersection line parameter equation into the plane constraint of the truncated quadratic surface, and obtain a set of inequality constraints for the parameters in the intersection line parameter equation according to the obtained plane constraint, the given value range of the parameters therein and the singular point parameter equation of the intersection line;
[0158] The intersection line solving module 2036 is used to solve the inequality constraint and obtain parameter values that satisfy the inequality constraint, that is, the parameter values of the intersection line equation of the two surfaces, so as to achieve accurate calculation of the intersection line of the two surfaces.
[0159] As an optional implementation, the collision detection module 2031 is further used for:
[0160] By truncating the coefficient matrix A of the quadratic surface u Decompose to obtain three mutually perpendicular main directions of the truncated quadratic surface, and find the planes that enclose the quadratic surface in these three directions (which can be obtained by the Lagrange multiplier method), and finally get a directed bounding box of the quadratic surface;
[0161] When the range of parameter s is given [s min ,s max ], then these polynomials x i (s),y i (s),z i (s), w(s) are transformed into Bezier polynomials, 1≤i, j≤4, and then x can be determined based on the convex hull of the Bezier polynomial. i (s),y i (s),z i The range of P1(s), P2(s) is determined by interval calculation, and then the range of the bounded ruled surface P(s, t) is obtained by interval calculation, which is the bounding box of the bounded ruled surface.
[0162] As an optional implementation, the trajectory equation calculation module 2032 is further used for:
[0163] Substitute the parametric equation of the bounded ruled surface P(s, t) as X into the parametric equation of the truncated quadratic surface Q A In the above equation, we can get the parametric equation D(s,t) of the plane trajectory with respect to parameters s and t:
[0164] D(s,t)=(P1(s)+tP2(s))A u(P1(s)+tP2(s))+2C T (P1(s)+tP2(s))+d=0;
[0165] After finishing, we can get:
[0166] D(s,t)=c2(s)t 2 +2c1(s)t+c0(s)=0;
[0167] in:
[0168] c2(s)=P2(s) T A u P2(s);
[0169] c1(s)=P1(s) T A u P2(s)+C T P2(s);
[0170] c0(s)=P1(s) T A u P1(s)·+2C T P1(s)+d.
[0171] As an optional implementation manner, the intersection equation calculation module 2033 is also used for:
[0172] Solve the plane trajectory parametric equation D(s,t) and obtain the intersection line parametric equation P(s):
[0173]
[0174] Among them, P x (s), P y (s) and P z (s) is the component of the intersection line parameter equation P(s) in the x, y and z directions, and the intermediate variable Δ(s) = c1(s) 2 -c2(s)c0(s).
[0175] As an optional implementation, the singularity analysis module 2034 is further used to:
[0176] At least one of the isolated singular points, cusps and self-intersection points is calculated to obtain a parametric equation of at least one of the isolated singular points, cusps and self-intersection points of the intersection line of the two surfaces. The relevant introduction of the calculation process of the isolated singular points, cusps and self-intersection points is detailed in the description of the above method embodiment, which will not be repeated here.
[0177] As an optional implementation, the inequality constraint conversion module 2035 is further used to:
[0178] The intersection line parameter equation P(s) = (P x (s),P y (s),P z (s)) T Substitute into the plane constraint a of the truncated quadratic surface i x+b i y+c i z+d i ≤0,0≤i≤n, we get:
[0179] a i P x (s)+b i P y (s)+c i P z (s)+d i ≤0,0≤i≤n;
[0180] According to the above plane constraints, the range of the parameter s and the parametric equation of the singular point of the intersection line, the intersection problem is transformed into the following set of inequality constraints:
[0181] s min ≤s≤s max ;
[0182]
[0183] a i P x (s)+b i P y (s)+c i P z (s)+d i ≤0,1≤i≤n.
[0184] As an optional implementation, the intersection line solving module 2036 is further used for:
[0185] In the process of solving the inequality constraint, the tolerance of the real root is controlled to ensure that the intersection line of the two surfaces calculated is within a given tolerance range.
[0186] As an optional implementation, the inequality constraint conversion module 2035 is further used to:
[0187] The real roots of the polynomial corresponding to each inequality are calculated by using a method based on real root isolation, and the sign of each real root is calculated by using the subresultant theory to obtain the parameter value range that satisfies the inequality constraints;
[0188] The intersection line solving module 2036 is also used for:
[0189] The interval width δ<∈ / M for ensuring real root isolation, where M is the upper bound of the intersection parameter equation estimated based on the parameter value range s∈[a,b] and using interval calculation, and ∈ is a given tolerance threshold.
[0190] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store video tag processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a CAD model construction method based on special surface intersection is implemented.
[0191] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0192] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0193] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0194] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0195] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0196] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0197] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0198] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0199] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A CAD model construction method based on special surface intersection, characterized in that: The CAD model construction method based on special surface intersection includes: Construct the original CAD model including bounded ruled surfaces and truncated quadric surfaces; Determine parametric equations for bounded ruled surfaces and implicit equations for truncated quadric surfaces; Based on the parametric equation of the bounded ruled surface and the implicit equation of the truncated quadric surface, the bounding box of the bounded ruled surface and the bounding box of the truncated quadric surface are calculated, and it is determined whether the bounding boxes of the two surfaces intersect, and if so, the intersection line of the truncated quadric surface and the bounded ruled surface is solved; The final CAD model is constructed according to the intersection line of the truncated quadratic surface and the bounded ruled surface.
2. The CAD model construction method based on special surface intersection according to claim 1 is characterized in that: The step of solving the intersection line of the truncated quadratic surface and the bounded ruled surface comprises: Substituting the parametric equation of the bounded ruled surface into the implicit equation of the truncated quadratic surface to obtain the parametric equation of the plane trajectory; Solving the plane trajectory parameter equation to obtain the intersection line parameter equation of the two curves; Calculating the singular point of the intersection line of the two surfaces to obtain the singular point parameter equation of the intersection line of the two surfaces; Substituting the intersection line parameter equation into the plane constraint of the truncated quadratic surface, and obtaining a set of inequality constraints for parameters in the intersection line parameter equation according to the obtained plane constraint, the given value range of the parameters therein and the singular point parameter equation of the intersection line; The inequality constraint is solved to obtain parameter values that satisfy the inequality constraint, that is, the parameter values of the intersection line equation of the two surfaces, so as to achieve accurate calculation of the intersection line of the two surfaces.
3. The CAD model construction method based on special surface intersection according to claim 1 is characterized in that: The parametric equation of the bounded ruled surface is: Wherein, P(s, t) represents the ruled surface controlled by parameters s and t; P1(s) is the generating curve of the ruled surface, which controls the position of the ruled surface. As the parameter s changes, the curve P1(s) moves in space; P2(s) is the unit vector related to the parameter s, which controls the direction of the ruled surface. As the parameter s changes, the direction of the ruled surface will also change; t controls the length of the ruled surface, which is determined according to the value range of t; are the coordinates of the point on the curve P1(s), are the coordinates of a point on the vector P2(s), x1(s), x2(s), y1(s), y2(s), z1(s), z2(s), w(s) are all polynomials with respect to parameter s, and s, t∈[s min ,s max ]×[t min ,t max ],s min is the lower limit of parameter s, s max is the upper limit of parameter s, t min is the lower limit of parameter t, t max is the upper limit of parameter t, and the value range of parameters s and t determines the range of the ruled surface; A quadratic surface is represented by: a 11 x 2 +a 22 y 2 +a 33 z 2 +2a 12 xy+2a 13 xz+2a 23 yz+2a 14 x+2a 24 y+2a 34 z+a 44 =0; Among them, the coefficient a ij is a constant, 1≤i,j≤4; The truncated quadratic surface is composed of a quadratic surface and n plane constraints, and any plane constraint is defined as: a i x+b i y+c i z+d i ≤0; Among them, the coefficient a i ,b i ,c i ,d i is a constant; The implicit equation of the truncated quadratic surface is: Where X is the three-dimensional coordinate point on the quadratic surface, X = (x, y, z) T , the coefficient matrix Constant term d = a 44 .
4. The CAD model construction method based on special surface intersection according to claim 2 is characterized in that: The plane trajectory parameter equation is: D(s,t)=c2(s)t 2 +2c1(s)t+c0(s)=0; Where D(s,t) represents the parametric equation of the plane trajectory, and the intermediate variables c2(s), c1(s), and c0(s) are: c2(s)=P2(s) T A u P2(s); c1(s)=P1(s) T A u P2(s)+C T P2(s); c0(s)=P1(s) T A u P1(s)+2C T P1(s)+d。 5. The CAD model construction method based on special surface intersection according to claim 4 is characterized in that: The intersection line parameter equation is: Where P(s) represents the parametric equation of the intersection line, P x (s), P y (s) and P z (s) is the component of the intersection line parameter equation P(s) in the x, y and z directions, and the intermediate variable Δ(s) = c1(s) 2 -c2(s)c0(s); The inequality constraints are: s min ≤s≤s max ; a i P x (s)+b i P y (s)+c i P z (s)+d i ≤0,1≤i≤n。 6. The CAD model construction method based on special surface intersection according to any one of claims 1 to 5, characterized in that: The singular point includes at least one of an isolated singular point, a cusp point and a self-intersection point.
7. The CAD model construction method based on special surface intersection according to any one of claims 1 to 5, characterized in that: Also includes: In the process of solving the inequality constraint, the tolerance of the real root is controlled to ensure that the intersection line of the two surfaces calculated is within a given tolerance range.
8. The CAD model construction method based on special surface intersection according to claim 7 is characterized in that: The solving the inequality constraint comprises: The real roots of the polynomial corresponding to each inequality are calculated by using a method based on real root isolation, and the sign of each real root is calculated by using the subresultant theory to obtain the parameter value range that satisfies the inequality constraints; In the process of solving the inequality constraint, controlling the tolerance of the real root includes: The interval width δ<∈ / M for ensuring real root isolation, where M is the upper bound of the intersection parameter equation estimated based on the parameter value range s∈[a,b] and using interval calculation, and ∈ is a given tolerance threshold.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the CAD model construction method based on special surface intersection described in any one of claims 1 to 8 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the CAD model construction method based on special surface intersection described in any one of claims 1 to 8 are implemented.
