A Novel Method of Offset Approximation along the Normal Direction with High Precision

: A new algorithm is proposed for polynomial or rational approximation of the planar offset curve. The best rational Chebyshev approximation could be regarded as a kind of geometric approximation along the ﬁxed direction. Based on this idea, we developed a wholly new offset approximation method by changing the ﬁxed direction to the normal directions. The error vectors follow the direction of normal, and thus could reﬂect the approximate performance more properly. The approximation is completely independent of the original curve parameterization, and thus could ensure the stability of the approximation result. Experimental results show that the proposed algorithm is reasonable and effective.


Introduction
Offset curves are widely used in various computer-aided design and manufacturing (CAD/CAM) areas, such as tool path generation [1,2], 3D numerical control (NC) machining [3,4], solid modeling [5], graphics [6], and so on.However, the offset curve usually cannot be represented in a polynomial or rational form, and thus is difficult to apply in CAD systems.
Many methods for the offset approximation have been proposed and developed.Cobb [7] proposed a new control net by translating each control point, whereas Tiller and Hanson [8] developed the idea by translating each edge of the control polygon.Hoschek [9] suggested a least squares solution, Piegl and Tiller [10] employed sample interpolation, and Cheng and Wang [11] used Jacobi series to approximate the offset curve.Lee et al. [12] regarded the offset curve as a convolution of a sweeping circle, Ahn et al. [13] used conic approximation to approximate the sweeping circle, and Zhao and Wang [14] employed second-order rational polynomials, and achieved high-precision approximation.
Some algorithms, such as those proposed by Piegl and Tiller [10] and Lee et al. [12], employ the point-sample technique for fast and convenient calculation.However, when the input curve changes its parameterization, the algorithms will take it as a new curve, and generate a wholly different approximation result.
When the error calculation depends on curve parameterization, there will also be problems.Suppose the original curve, the offset curve, and the approximation curve are represented by C(t), C r (t), and C a r (t), respectively.The offset radius is r.There are two error calculation formulas: ||C a r (t) − C r (t)|| 2 and C a r (t) − C(t) 2 − r 2 [15].However, they sometimes are not able to accurately estimate the real approximating error.Figure 1 shows two kinds of point correspondence between the original curve and its approximation.Although the approximation curve is the same, the above error calculation formulas produce different results.In this paper, a new offset approximation method is proposed, which approximates the offset curve directly in the normal direction.The distance error in normal directions is more suitable to evaluate the approximation precision, which is independent of the parameterization, and fits closely with human perception.Whatever parameterization the input curve uses, the approximation curve and the error estimation always remain the same.Using the idea of the best rational Chebyshev approximation for reference, the new method generates rational approximation to the planar offset curve.The paper is organized as follows.Section 2 briefly reviews the basic theory of the best rational Chebyshev approximation.Section 3 introduces our offset approximation method.Section 4 gives some experiments.Finally, Section 5 concludes the paper.

Best Rational Chebyshev Approximation Theory
Consider a set of polynomials and rational polynomials:   [16].
Theorem.If f (x) is continuous, there is a unique choice of the values of a and b that minimizes e .For this choice, e(x) has 2 k m   extrema in [0, 1] , all of magnitude e and with alternating signs.

Suppose i
x is the extremum of the minimax solution, then the satisfied equations will be: where  alternates for the alternating extrema.Besides a and b in the equation, e is an additional unknown.
It is difficult to find the coefficients and maximum deviation in the set of equations listed in (1), which is highly nonlinear in e .Remes [16] suggested an iterative method to find the approximation.

Press et al.
[17] proposed a speed-up algorithm, which solves linear equations at each step, and can greatly reduce the computation complexity.

Rational Offset Approximation along the Normal Direction
Suppose ( ) ( ( ), ( )) is a regular rational Bézier curve with the degree of n , and ( ) ( ( ), ( )) x y t N t N t  N is its unit normal vector.The offset curve with radius r can be In this paper, a new offset approximation method is proposed, which approximates the offset curve directly in the normal direction.The distance error in normal directions is more suitable to evaluate the approximation precision, which is independent of the parameterization, and fits closely with human perception.Whatever parameterization the input curve uses, the approximation curve and the error estimation always remain the same.Using the idea of the best rational Chebyshev approximation for reference, the new method generates rational approximation to the planar offset curve.The paper is organized as follows.Section 2 briefly reviews the basic theory of the best rational Chebyshev approximation.Section 3 introduces our offset approximation method.Section 4 gives some experiments.Finally, Section 5 concludes the paper.

Best Rational Chebyshev Approximation Theory
Consider a set of polynomials and rational polynomials: The rational function R(A, x) is called the best Chebyshev rational approximation of the given continuous function f (x)(0 ≤ x ≤ 1), when the choice of values of a and b minimizes the maximum absolute value e = max 0≤x≤1 |e(x)|, where e(x) = R(A, x) − f (x) [16].
Theorem.If f (x) is continuous, there is a unique choice of the values of a and b that minimizes e.For this choice, e(x) has k + m + 2 extrema in [0, 1], all of magnitude e and with alternating signs.Suppose x i is the extremum of the minimax solution, then the satisfied equations will be: where ± alternates for the alternating extrema.Besides a and b in the equation, e is an additional unknown.
It is difficult to find the coefficients and maximum deviation in the set of equations listed in (1), which is highly nonlinear in e. Remes [16] suggested an iterative method to find the approximation.Press et al. [17] proposed a speed-up algorithm, which solves linear equations at each step, and can greatly reduce the computation complexity.

Rational Offset Approximation along the Normal Direction
Suppose C(t) = (C x (t), C y (t)) (0 ≤ x ≤ 1) is a regular rational Bézier curve with the degree of n, and N(t) = (N x (t), N y (t)) is its unit normal vector.The offset curve with radius r can be represented by C r (t) = C(t) + rN(t).In the following, a polynomial is to be found to approximate the offset curve along the normal direction, where The abscissa and ordinate of the offset curve C r (t) could be approximated respectively to obtain rational approximate functions.However, we have to find a common denominator to obtain a rational Bézier curve.The operation may increase the function degree and produce a second-order error.
Inspired by the best rational Chebyshev approximation theory, a wholly new approximation method is proposed.All error vectors of the best Chebyshev rational approximation are parallel to the Y-axis.By changing the direction of the error vectors to the normal direction, a high-precision approximation method is obtained.The approximation curve is assumed to intersect the offset curve at several locations.Then, the domain is subdivided into subintervals.Suppose the error extrema are equal in each subinterval, and set up a set of equations to calculate the approximation.This idea will be introduced in detail as follows, taking the rational approximation as an example.
The error e(t) is measured as the distance between the two parameter points R(A, t) and C r (t), which are located on the same normal curve N(t), so it could be represented as e(t) = (R(A, t) − C r (t)) • N(t), where the sign • denotes the dot product.Let e denote the maximum absolute value of e(t).Suppose there are k parameters, where the sign ± alternates for the alternating extrema.The above vector equations can be split into the following two kinds of equations, one for the direction, and the other for the magnitude: where the sign × denotes the cross product.For the first part of Equation ( 2), the 2D vectors can be regarded as 3D vectors by defining the coordinate z = 0, and the system of Equation ( 2) could be represented by the following matrices: where There are: In Equation ( 2), there are 2k equations and 3n + 3 unknown quantities, including 3n + 2 coefficients of R(A, t) and the extremum e.Therefore, the number of extrema k could be 3n + 2 2 or 3n+3  2 to obtain consistent equations, when the degree n is even or odd, respectively.Equation ( 2) is highly nonlinear since e is additionally unknown.It can be solved efficiently by an iterative method.The main steps are as follows: 2) and obtain the coefficients a and b as well as the extremum e; (iii).Compute the actual error extrema for R(A, t); (iv).Replace the value t i with the nearest actual extremum of the same sign; (v).Go back to step (ii) and iterate to convergence.Exact extrema may be not so important as the approximation curve is the wanted solution, so we could dispense with keeping track of the actual extrema.The approximation error could be measured at the given parameter points.An accelerated algorithm is proposed as follows: (i).Set the values of t i (i = 1, 2, • • • , k), and the extremum e = 0; (ii).Solve Equation ( 2) and obtain the coefficients a and b; (iii).Compute the actual error at t i , and the sign σ i ; (iv).Replace the extremum e with the average error, and replace the approximation curve value at t i with C a r (t i ) + σ i • e; (v).Go back to step (ii) and iterate to convergence.The initial values of t i are set following the method used in the program proposed in Press et al. [17].A polynomial could be regarded as a degenerate rational case whose denominator is 1.Thus, the polynomial approximation curve could also be obtained by the above algorithm when the coefficients b i = 0 (i = 1, • • • , m) are set in the first step.
In the following, the position relationship of parameter points between the offset and its approximating curve are investigated.The two corresponding curve points should be located on the same normal curve.That is, the direction of the error vector R(A, t) − C r (t) should be parallel to that of the normal vector N(t).Here, the length of the vector represented by [R(A, t) − C r (t)] × N(t) is calculated.Considering the unavoidable calculation error, the result should fluctuate around zero. Figure 3 shows the fluctuation curve of the approximation curve obtained by our accelerating iterative algorithm.The curve is the result obtained after the second iteration.Apparently, the curve values are nearly equal to zero, which sufficiently proves that the proposed algorithm approximates the offset curve along the normal direction.
The interpolating method could not guarantee the approximation error, but it is rather convenient in application.When the sample points are carefully selected, the precision is enhanced.However, a number of the sample points may increase greatly when the curve becomes slightly more complex.Our method is rarely influenced by the change of the curve during the theoretical support.For example, the number of the sample points is less than 4(3n + 3) when running the accelerated iterative method.A comparison between the error bounds obtained by the interpolating method and our accelerating method is given as follows.Using 500 sample points, the error bound generated by the interpolating method is 0.0371 (see Figure 4a).Using 96 sample points, the error bound of our algorithm is 0.0428 for the first iteration, and 0.0363 after the second iteration (see Figure 4b).In the following, the position relationship of parameter points between the offset and its approximating curve are investigated.The two corresponding curve points should be located on the same normal curve.That is, the direction of the error vector ( , ) ( ) should be parallel to that of the normal vector N(t).Here, the length of the vector represented by [ ( , ) Considering the unavoidable calculation error, the result should fluctuate around zero. Figure 3 shows the fluctuation curve of the approximation curve obtained by our accelerating iterative algorithm.The curve is the result obtained after the second iteration.Apparently, the curve values are nearly equal to zero, which sufficiently proves that the proposed algorithm approximates the offset curve along the normal direction.In the following, the position relationship of parameter points between the offset and its approximating curve are investigated.The two corresponding curve points should be located on the same normal curve.That is, the direction of the error vector ( , ) ( ) should be parallel to that of the normal vector N(t).Here, the length of the vector represented by [ ( , ) ( )] ( ) is calculated.Considering the unavoidable calculation error, the result should fluctuate around zero.
Figure 3 shows the fluctuation curve of the approximation curve obtained by our accelerating iterative algorithm.The curve is the result obtained after the second iteration.Apparently, the curve values are nearly equal to zero, which sufficiently proves that the proposed algorithm approximates the offset curve along the normal direction.Lee's method [12] is regarded as classical in offset approximation, which is simple and highly precise.Ahn et al. made an improvement of their work to reduce the degree of the approximation curve [13].A comparison is made between our method and their work in terms of the precision in the following.Figure 5 is a quintic Bézier curve with six control points (3, −1), (4, 2), (4.5, 2), (5.5, 1.5), (6.5, 0), and (7, −1). Figure 5 shows the approximation error performance.Table 1 shows the error distance along the norm direction of each method.Lee's method generates a rational approximation curve with degree 21.Ahn's method yields a polynomial curve with the same degree.Our method can approximate the offset with an arbitrary degree, and a quintic rational approximation is given for comparison.It can be seen that our error bound is better than Lee's and Ahn's error estimation.The advantage is more obvious after the curve is subdivided, and the results are shown in the third and the fourth rows of Table 1.
se. Ahn et al. made an improvement of their work to reduce the degree of the approxim [13].A comparison is made between our method and their work in terms of the precisi llowing.Figure 5 is a quintic Bézier curve with six control points (3, −1), (4, 2), (4.5, 2), (5.5 ), and (7, −1). Figure 5 shows the approximation error performance.Table 1 shows the ce along the norm direction of each method.Lee's method generates a rational approxim with degree 21.Ahn's method yields a polynomial curve with the same degree.Our me pproximate the offset with an arbitrary degree, and a quintic rational approximation is g mparison.It can be seen that our error bound is better than Lee's and Ahn's error estima dvantage is more obvious after the curve is subdivided, and the results are shown in the he fourth rows of Table 1.nclusions his paper developed a method of polynomial and rational approximation for planar cu traditional recognition of the best rational Chebyshev approximation is presented.ximation direction is investigated, and the algebraic method could be regarded as a geom ximation method.By changing the approximation direction from the Y-axis to the no tion, a high-precision approximation is developed.The method is driven by geom raints, so the approximation process is independent of parameterization.The directions o

Conclusions
This paper developed a method of polynomial and rational approximation for planar curves.The traditional recognition of the best rational Chebyshev approximation is presented.The approximation direction is investigated, and the algebraic method could be regarded as a geometric approximation method.By changing the approximation direction from the Y-axis to the normal direction, a high-precision approximation is developed.The method is driven by geometric constraints, so the approximation process is independent of parameterization.The directions of the error vectors are along the normal direction, so the error estimation fits closely with human perception.The experiments show the reasonableness and the effectiveness of the proposed algorithm.The method could be used in the approximation of complex curves or surfaces, and applied in the area of interval curves.

Figure 1 .
Figure 1.Two methods of point correspondence.(a) Approximation in a specified direction; (b) Approximation in the normal direction.
it comes a k-degree polynomial.The rational function ( , ) R A x is called the best Chebyshev rational approximation of the given continuous function ( ) f x (0 1) x   , when the choice of values of a and b minimizes the

Figure 1 .
Figure 1.Two methods of point correspondence.(a) Approximation in a specified direction; (b) Approximation in the normal direction.

9 Figure 2 .
Figure 2. The septic Bézier curve and the offset.The original curve is the thin green curve with a control net.The offset is the red curve, and the approximating offset is the thick green curve.

Figure 2 . 9 Figure 2 .
Figure 2. The septic Bézier curve and the offset.The original curve is the thin green curve with a control net.The offset is the red curve, and the approximating offset is the thick green curve.

Figure 3 .
Figure 3. Fluctuation curve of the direction deviation.

Figure 4 .
Figure 4. Error curves of different approximation methods.(a) Interpolating algorithm; (b) Algorithm in this paper after the second iteration.

Figure 5 .
Figure 5. Approximation error performance.(a) After the first iteration; (b) After four iterations.

Figure 5 .
Figure 5. Approximation error performance.(a) After the first iteration; (b) After four iterations.

Table 1 .
Comparison between Lee's, Ahn's, and our algorithms in terms of the error bound.

Table 1 .
Comparison between Lee's, Ahn's, and our algorithms in terms of the error bound.