Professional Documents
Culture Documents
Arcinterpolation PDF
Arcinterpolation PDF
DESIGN
Computer-Aided Design 34 (2002) 10371046
www.elsevier.com/locate/cad
Abstract
In this paper, we present an efcient sub-optimal algorithm for tting smooth planar parametric curves by G 1 arc splines. To t a
parametric curve by an arc spline within a prescribed tolerance, we rst sample a set of points and tangents on the curve adaptively as
well as with enough density, so that an interpolation biarc spline curve can be with any desired high accuracy. Then, we construct new biarc
curves interpolating local triarc spirals explicitly based on the control of permitted tolerances. To reduce the segment number of tting arc
spline as much as possible, we replace the corresponding parts of the spline by the new biarc curves and compute active tolerances for new
interpolation steps. By applying the local biarc curve interpolation procedure recursively and sequentially, the result circular arcs with no
radius extreme are minimax-like approximation to the original curve while the arcs with radius extreme approximate the curve parts with
curvature extreme well too, and we obtain a near optimal tting arc spline in the end. Even more, the tting arc spline has the same end points
and end tangents with the original curve, and the arcs will be jointed smoothly if the original curve is composed of several smooth connected
pieces. The algorithm is easy to be implemented and generally applicable to circular arc interpolation problem of all kinds of smooth
parametric curves. The method can be used in wide elds such as geometric modeling, tool path generation for NC machining and robot path
planning, etc. Several numerical examples are given to show the effectiveness and efciency of the method. q 2002 Elsevier Science Ltd. All
rights reserved.
Keywords: Circular arc interpolation; Arc spline; Active tolerance; Data reduction; CAD/CAM
different optimal biarc curves, the purpose of this paper is to into three categories: The rst kind of algorithms construct
interpolate an original parametric curve with low number of interpolating arc splines by solving optimization problem;
circular arcs. In fact, when we interpolate a part of the curve the algorithms that can be classied into the second category
with an optimal biarc curve, the second segment of the biarc try to nd analytic solutions for the construction of tting
associated with some successive arcs can always be arcs, but they are designed just for a few special kinds of
approximated by another new biarc curve within the toler- parametric curves such as quadratic Bezier curves; the third
ance. Then, we just choose the rst segment of the optimal kind of algorithms construct arc spline with relatively lower
tting biarc curve as the interpolation circular arc to the number of segments by tting a set of sampled points or
original parametric curve, except at the end of the curve based on multiresolution analysis of an arc spline curve.
where we choose both of the two segments. Marciniak and Putz [2] have proved that minimax
To compute the optimal interpolation biarc curve of origi- approximation generates arc spline with lowest number of
nal curve, we compute tight tolerances or active tolerances arc segments within given accuracy for a spiral. However,
for triarc spirals and replace the spirals by the interpolation the algorithm is not efcient and the problem of how to deal
biarc curves within the active tolerances recursively. An with end points constraint has not been mentioned. Qiu et al.
interpolation biarc curve becomes the optimal interpolation [5] have improved this algorithm by solving numerical
biarc curve, until the triarc span that is consisting of this equations with end constraint, but dividing a general smooth
biarc curve with a successive arc segment is not a spiral or a curve into spirals is computationally expensive. Though the
spiral with no interpolation biarc curve within the permitted interpolation for each spiral is optimal, but it may not mean
tolerance. the tting arc spline is optimal for a curve consisting of
The algorithm has the following features: several spirals.
Ong et al. [8] have employed an optimization procedure
Generality: The algorithm constructs the interpolation to nd biarc spline tting a B-spline curve by minimizing
circular arcs by lowering the segment number of a high the area bounded by the B-spline and the arc spline curve.
accuracy tting biarc spline. Then the algorithm can be Meek and Walton [9] have studied the problem of tting
used to approximate any type of smooth parametric quadratic NURBS curve by arc spline. Ahn et al. [6] and
curves. Yong et al. [10] have given several algorithms for
Efciency: We obtain the interpolation circular arcs along approximating quadratic Bezier curves by G 1 arc splines.
with the data sampling and biarc curve tting process, The main drawback of these algorithms is that they cannot
and compute all the parameters for the tting arcs expli- be extended to approximate general types of parametric
citly. The time needed for the whole procedure is just curves.
proportional to the sampling density. Meek and Walton [11] have tted a biarc spline curve to a
Near optimality: We lower the number of segments of an set of discrete point by computing biarcs adaptively. Yeung
arc spline by interpolating local triarc spans with biarcs and Walton [3] have tted an arc spline to a set of sampled
recursively and orderly. The result tting arcs are mini- points from the curve instead of piecewise linear curve for
max-like approximation to the original curve, and the NC machining. Though the arc spline can improve the
number of segments of nal interpolation arc spline machining quality than piecewise linear curve, there still
always reaches or almost reaches the lowest. remain big room for improving the tting quality and
machining efciency with efcient algorithms. Wallner
All these benets of the algorithm make it an efcient and [12] has proposed a method for lowering the number of
practical method for geometric modeling and processing. segments of an arc spline based on multiresolution analysis,
The organization of the paper is as follows. In Section 2 but this method cannot control the approximating error
we will give a brief review of some related work and Section explicitly.
3 will be devoted to the discussion of high accuracy biarc In a recent paper [13], we have presented an active
curve interpolation problem. We will derive the explicit tolerance algorithm for approximating NURBS curves by
formulae and give the algorithm for circular arc interpola- arc splines. In this paper we generalize the algorithm for
tion in Section 4. Some examples will be illustrated in approximating arbitrary types of smooth parametric curves
Section 5 and we will conclude the algorithm in the last by arc splines and improve the former algorithm in several
section. aspects. Firstly, a precise formula for circular arc interpola-
tion is presented. On the second hand, we derive exact
formulae for robust and tight active tolerance computation.
2. Related work Thirdly, a unied algorithm is presented for circular arc
interpolation along with the whole curve, irrespective of
Research on the topic of smooth circular arc interpolation the prole with increasing or with decreasing monotone
for parametric curves has been active in recent years [513]. curvature. All tests we have experimented show that the
According to the ways how the algorithms solve the new algorithm can generate arc spline with lowest or almost
problem, the existing algorithms can be classied roughly lowest number of segments.
X. Yang / Computer-Aided Design 34 (2002) 10371046 1039
curve; otherwise, we sample another point on the curve with of original curve if the deviation of second arc segment is no
a smaller parameter step. larger than t, either.
Without loss of generality, we can assume that the For an arc span consisting of more than three segments of
parameter curve is dened on the interval [0, 1], and we which the radii are monotone increasing, we can construct
choose the xed step as Dt 0:02. In fact, various choices optimal tting biarc curves by checking triarc spirals recur-
of this xed step do not inuence the tting results much sively and orderly. We begin the procedure by choosing the
because of high accuracy requirement. Let Pl21 be one point rst three arcs and construct an interpolation biarc curve.
on the parametric curve P(t) with parameter tl21 , to choose When we replace the rst three arcs by the interpolation
next point Pl we can rst set parameter tl tl21 1 Dt. If the biarc curve, we will obtain a new arc span with one segment
deviation is within the prescribed accuracy, we set fewer. The rst three segments of this new arc span will
Pl Ptl ; otherwise, we will check another sampled again form a new triarc spiral, and we can t this new spiral
point by choosing the parameter with a shorter step, i.e. by another new biarc curve. To guarantee that the deviation
tl tl21 1 0:65Dt. This procedure continues until an from this new biarc curve to the original curve is not larger
accepted point is reached. If the permitted error bound for than t, we compute a new tighter tolerance for the construc-
circular arc interpolation is t, a positive real number less tion of this new biarc curve. This procedure continues until
than 0:01 p t can be set as a well working accuracy for high the active tolerance vanishes and the maximum deviation
accuracy biarc curve interpolation. In all the examples cited from the latest biarc curve to the original curve reaches t. At
in this paper we set the tting accuracy as 0:002 p t. the time, the interpolation biarc curve is the optimal approx-
Because the initial tting biarc spline curve is with so imation to the original curve under the mean of minimax
high accuracy to the original parametric curve, we will approximation. From another point of view, we obtain the
not distinguish these two types of curves and we mean the optimal biarc curve by expanding the rst segment and
high accuracy interpolation arc spline curve when we refer shrinking the last segment of the corresponding arc span
to the original curve without particular declaration in the within the given tolerance. Since the second segment of
following sections. An advantage of the high accuracy biarc the optimal biarc can be expanded with another end xed
spline representation is that we can compute the distance in following steps, we leave the rst segment of the biarc as
from an arc segment or a point to the original curve more an interpolation circular arc to the parametric curve and
easily. check a new triarc spiral that is consisted of the second
segment of the biarc curve associated with another two
successive arcs from the original tting arc spline.
4. Smooth circular arc interpolation
If there exist inection points in the triarc span or the
triarc span is not a spiral, we leave the rst segment as
Though the arc spline constructed above is with high
one interpolation arc, and check another triarc span with
accuracy to the original parametric curve, but the arc
a new arc segment added. One advantage of the method
segments are always too many to be used efciently and
is that it can keep the shape of the nal interpolation arc
should be reduced as much as possible for most applica-
spline compatible with the original curve well. On the other
tions. To obtain interpolation circular arcs within a given
hand, the algorithm can be implemented more easily and
tolerance, we replace local spiral spans by the correspond-
conveniently.
ing interpolating biarc curves within active tolerances. We
will give the circular arc interpolation formula for spirals
with decreasing curvature in the following subsections, and 4.2. Fitting triarc spiral by biarc curve
the formula for spirals with increasing curvature can be
obtained similarly. Without loss of generality, we can assume that O0, O1 and
O2 be three smooth connected arc segments of a triarc spiral
4.1. The strategy with increasing radii r0, r1 and r2, respectively. The spiral
starts at point P0 and ends at P3 with two joint points P1 and
For an arc spiral consisting of three segments or a triarc P2. To determine a new biarc curve interpolating points P0,
spiral, there are a family of biarc curves interpolating the P3 and the tangents at these two points within controllable
same end points and end tangents of the spiral [14]. To nd a deviation, we construct these two new arcs by expanding r0
new biarc curve within a prescribed deviation, we construct and shrinking r2 with end points P0 and P3 and the tangents
the two segments of the biarc curve by expanding the arc at these two points xed (see Fig. 2). Let
segment with smallest radius and shrinking the arc segment
with biggest radius of the triarc spiral, with two end points O0 2 P0 O 2 2 P3
and end tangents of the spiral xed. The magnitude of the V0 and V2 ;
kO0 2 P0 k kO 2 2 P3 k
expansion or shrinking of one new arc segment is decided
by its deviation from the spiral and the another arc segment then the centers for these two new arc segments are Oa
can be decided based on continuity constraint. Then the O0 1 tV0 and Ob O2 2 uV2 , respectively, where t and u
entire new biarc curve will be within the permitted tolerance are the expansion or shrink magnitudes. We obtain the radii
X. Yang / Computer-Aided Design 34 (2002) 10371046 1041
Fig. 2. Approximate a triarc spiral by a biarc curve. Fig. 4. Expand arc O0 within circle O2 .
for these two new arcs as ra r0 1 t and rb r2 2 u, point P1 , and then we have
respectively.
dm ra 1 uuO1 2 Oa uu 2 r1 # ei 5
To guarantee that arc segments Oa and Ob are G1 contin-
uous at the joint point, the radii for the two arcs should By substituting the equations ra r0 1 t and Oa O0 1
satisfy the following equation: tV0 into Eq. (5), we have
ra 1 uuOa 2 Ob uu rb 2 r1 2 r0 1 ei 2 2 O1 2 O0 2
t # tb 6
2r1 2 r0 1 ei 1 O1 2 O0 V0
By expressing Oa , Ob , ra and rb as the functions of t and u,
we have: To be sure that the joint point of the biarc curve lies in the
sector region of the triarc spiral, we expand arc O0 inside
uuO2 2 O0 2 uV2 2 tV0 uu r2 2 r0 2 u 2 t 3
circle O2 (see Fig. 4), then we have
Let D O2 2 O0 and t0 r2 2 r0 , then Eq. (3) can be uuOa 2 O2 uu 1 ra # r2 7
transformed into
From Eq. (7) we have
X 1 X1 t
u 0 4
Y0 1 Y1 t t02 2 D2
t # tc 8
2t0 2 DV0
where X0 t02 2 D2 , X1 2DV0 2 t0 , Y0 2t0 2 DV2
and Y1 2V0 V2 2 1. Once parameter t or u has been The maximum value for t can now be chosen as t
decided, the two new arcs can then be obtained. Let min(tb, tc). It can be easily veried that both tb and tc are
larger than or equal to zero, then we conclude that t is non-
Oa 2 Ob
Vn ; negative. It is clear that ra # rb based on Eq. (2), and rb #
uuOa 2 Ob uu r2 since arc Ob is inside circle O2 . Then the new arc spline is
then the point jointing arc Oa and Ob is Pn Oa 1 ra Vn . still an arc spiral when a triarc span of the original spiral has
Since we construct arc Oa by expanding arc O0 , the been replaced by the corresponding biarc curve.
maximum deviation of arc Oa from the triarc spiral is the The distance from arc Oa to the original curve is within
maximum distance between arc Oa and arc O1 , i.e. dm the permitted bound by the control of active tolerances, then
ra 1 uuO1 2 Oa uu 2 r1 (see Fig. 3). To make sure that arc Oa we should compute the distance from arc Ob to the original
is within the permitted tolerance of the original curve, we curve to conrm whether the biarc curve can be accepted or
assume that dm is no larger than the active tolerance ei at not. Because the tting error is very small compared with
arc radii and the original high accuracy tting arc spline is
dense with arc segments, we choose to compute the
distances from those joint points that lie in the sector region
of arc Ob to the new biarc curve for the estimation of the
distance between the original curve and arc Ob . If the maxi-
mum deviation db is less than t, we will replace the triarc
spiral by the biarc curve; otherwise, set arc O0 as an inter-
polation segment and choose arcs O1 , O2 and another new
arc segment for further approximation.
Because arc Ob is rst obtained by shrinking the radius of an sketch of the algorithm for smooth circular arc interpolation
original arc segment with nal end xed, then, if we expand is given as follows:
this shrunk arc with another end unchanged, the permitted
expansion tolerance at the movable end point is t (such as Algorithm: Smooth Circular Arc Interpolation
point P3 in Fig. 6). If that is the case, we set the new active input: a smooth parametric curve Pt and tolerance t
tolerance as t. If an interpolation circular arc is obtained by output: a smooth circular arc spline within t
shrinking the radius with one end xed and expanding the construct a biarc curve interpolating sampled points Pt0 ,
radius with another end xed, it deviates the original curve Pt1 and tangents Tt0 , Tt1 ;
at both sides. Though the former maximum deviation on one choose rst two arcs from the spline as arc1 and arc2;
side may decrease a little when the arc is expanded toward set active tolerance e0 t;
the maximum deviation on the other side, the interpolation while ((t , 1) or (next arc! NULL))
circular arc is still minimax-like approximation to the {
original curve and it is a sub-optimal approximation to the if (next arc NULL)
curve. {select t tl11 and construct biarc interpolating
If the radius of an arc segment is local minimal in a spline, Ptl and Ptl11 }
the arc segment will rst be expanded with nal end xed in arc0 arc1;
a triarc spiral with increasing curvature and then will be arc1 arc2;
expanded further with another end xed in a triarc spiral arc2 next arc;
with decreasing curvature. Since the second expansion may if (the three arcs form a triarc spiral)
increase the initial deviation, in a similar way as Eq. (10), {
we compute the maximum bound that can keep the Compute arcs arc_a and arc_b based on ei ;
increased deviation within permitted tolerance. Then we Compute the deviation db of arc_b to the original
set the initial active tolerance for second expansion as the curve;
minor one between the obtained bound and t. Similar result if (db , t)
holds for arcs with local maximum curvature radius. If there { delete arc0;
exist inection points on a triarc span, the rst segment will arc1 arc_a;
be used as the interpolation circular arc, and we set t as the arc2 arc_b;
active tolerance for next triarc span. This algorithm will compute the active tolerance ei11 ;
make the circular arc interpolation procedure more natural } else ei11 t;
without the need to divide the parametric curve into spirals } else compute and reset ei11 ;
and lower the number of nal tting arcs much more than }
approximating each spiral separately. output the nal arc spline.
Fig. 9. Smooth circular arc interpolation for a cam prole. t 0:5 1024 .
6. Conclusions
Table 1
Control points of the uniform cubic B-spline curve for face prole
Table 2
Control points of the uniform cubic B-spline curve for the knot shape
Acknowledgements
Table 3
The tolerance and the arc numbers for all the examples