Chapter 8 geometric processing technology of Curves
We have introduced the common curve Representation Methods and their related theories in CAD/CAM, the effective use of these curves in shape design and manufacturing relies heavily on the convenience of performing various geometric operations on them, the designer may require that multi-section curves be connected according to certain smoothing constraints, or the intersection of the two curves is a key point in engineering design. It is the geometric processing of curves. Common geometric processing includes: intersecting, filleting, extension, blending, and offseting). Here we will focus on three operations: intersection calculation, offset calculation, and transition.
8.1 Curve Intersection
Intersection is the most important curve operation. It is the basis for image cropping and hiding. Based on the curve type, you can divide the Curve Intersection into the following three types:
(1)
Intersection of two straight lines
If two spatial straight line segments are excluded from parallel and cross-plane segments, there are two kinds of intersection: or at one point, or overlap (partially or entirely ).
Let the parameter equations of the two line segments be:
The intersection is, that is
Because:
(8.1.1)
Likewise
(8.1.2)
The intersection point is as follows:
(8.1.3)
Of course, the intersection point obtained here is not necessarily the required intersection point, because we are dealing with a straight line segment. Therefore, in order to ensure the validity of the intersection, a validity check must be performed to determine the condition. If the condition is true, it indicates a valid intersection. Otherwise, it indicates an invalid intersection.
(2) intersection of line and curve segments
Set the equation of the line segment
It can be a curve segment (), which can be a B '-sergix curve, B-spline curve, or a green-curve.
Or
If it is a piecewise subpolynomial or piecewise rational polynomial, the equation satisfied by the intersection is generally in the form:
Obtained by vector operations
(8.1.4)
You can obtain the parameters by solving the above equation using the numerical method, and then obtain the required intersection point through the validity check.
(3)
Intersection of Curves
If there is a spatial curve segment () and (), the equation that satisfies the intersection is:
It is a nonlinear equations of two unknown numbers. For a plane curve, the two curves are either intersecting or not intersecting. The above equations have exactly two equations that can be directly solved. The commonly used method is the Newton-Raphson iteration method.
If the above equation is written as a component
(8.1.5)
If the actual intersection point is the approximate intersection point we have obtained
(8.1.6)
It can be expanded by Taylor.
If the higher-order items above level 2 are ignored, the following items are available:
That is:
(8.1.7)
Solve the equations. If (the error with the real intersection) meets the precision requirement, the intersection parameter is:
(8.1.8)
The iteration process ends. Otherwise, continue Iteration for the New Approximate Solution of the intersection. If the iteration does not converge, the two curves do not overlap; otherwise, there is an intersection.
This method is characterized by precise intersection and does not depend on the curve type. However, if the curve is a B-é-Z curve or B-B curve, you can use a more convenient discrete intersection. The following describes the basic principle of the discrete Intersection Algorithm Based on the curve of B.
We know that the bé-based curve is completely located in the convex hull of its control vertex, so for the two bé-based curves, the intersection of a polygon can be converted to the intersection judgment of a polygon convex hull and the curve segmentation. If the convex packets of two control polygon do not overlap, the curve must not overlap. Otherwise, the two curves are divided into two parts, and the intersection of the convex packets of the control polygon of the Child curve is determined. Repeat until a clear result is obtained: the intersection is obtained, and the intersection is obtained. The algorithm process is as follows:
A. the discrete intersection algorithm of the bé-Zeri Curve
Step 1 judge the intersection between two curves and the control polygon convex hull. If the intersection is transferred to step 2, otherwise Step 5;
Step 2: determine the accuracy. If the precision requirements are met, go to Step 5; otherwise, go to step 3;
Step 3 divide the two curves and the midpoint (the parameter is) respectively to obtain the curve segment and;
Step 4 perform the intersection test on the convex hull of the control polygon of the curve segment and the control polygon. If not, go to Step 5; otherwise, feed the curve corresponding to the control polygon with the convex hull intersection to step 2;
Step 5: output the result.
B. algorithm Data Structure
The data structure used by the discrete algorithm is a binary tree. Its logical structure is 8.1.
Figure 8.1 discrete intersection algorithm Data Structure
C. Intersection Parameter Determination
The method used to determine the intersection parameter is to correct the parameters of the points at both ends of the intersection curve segment. If the parameters of the start and end points are respectively, then:
①
Initialization .,;
②
Split. If the left curve is involved in the intersection, the end parameter is corrected. If the right curve is involved in the intersection, the start parameter is corrected, where the number of splits is used;
③
The intersection parameter is.
For spatial curves, equations (8.1.7) are super-fixed equations with two unknown numbers and three equations. In this case, the solution is to project the curve to a coordinate plane (suchXoyPlane ),X,YEquations of components. If there is a transaction, substitute the corresponding parameterZVerify the component.
8.2 Curve
The offset of a curve is a curve formed by moving each point on the curve to a given distance along its normal vector. It is the trajectory of the tool center in numerical control machining. Therefore, offset line calculation is essential for 2D contour processing and 3D flat line processing.
If the equation of the curve is set to, the corresponding equi-linear equation is
(8.2.1)
Here is a constant, which is the unit legal vector.
From the equation of the same distance line, we can see that for a given parameter polynomial curve or rational parameter polynomial curve, the corresponding same distance line is no longer a curve of the same type, and its equation is quite complex. Unless a special curve (such as an arc or a straight line segment), secondary fitting is generally required to calculate the same line according to a certain step. Therefore, the study of the same line mainly focuses on what kind of curve the same line can be accurately expressed.
It is a plane rational parameter polynomial curve. If a polynomial function exists, the conditions are met:
(8.2.2)
The offset line can accurately represent a rational parameter polynomial curve.
Verify that
So
The polynomial curve or rational polynomial curve that meets the condition (8.2.2) is called the Pythagoras curve, or the PH curve for short. It can be seen that the arc is a PH curve, so the ARC's offset line can be accurately expressed.
Transition of 8.3 Curves
In engineering, especially in the aviation, aerospace, automotive, marine and other industries, in order to make the product appearance have good mechanical properties and appearance, in order to avoid cutting knives during processing, it is often necessary to construct a transition curve or a transition surface between any two curves and two surfaces. The transition between curves refers to the construction of an arc Based on the given radius between the two curves to keep them continuous with the master curve. In general, there are several types of transition between curves: transition between straight lines, transition between straight arcs, transition between arcs, and transition between curves. In essence, the transition between curves is to construct the same distance line and calculate the intersection.
The algorithm of the transition curve between the two curves is as follows:
Step 1 Construct the same distance line
Step 2: Calculate the intersection and intersection parameters of the curve. If so, go to step 3. Otherwise, the transition radius is not suitable;
Step 3: Calculate the intersection point with the tangent;
Step 4 uses, and as the control vertex and uses the weight factor to construct a Rational Quadratic B 'curve, that is, the desired transitional arc.
The following is an example of the transition between straight lines. Two straight lines on a given plane:
And transition radius.
①
Intersection of sum;
②
Pick up a straight line and a point above;
③
Calculate the angle;
④
Determine the center of the transitional circle and the cut point on the two straight lines:
If yes, the parameter of the upper cut point is. Otherwise, the parameter of the cut point is. The parameters of the cut point on a straight line can be obtained similarly. Transition circle