High order approximation of conic sections by quadratic splines

High order approximation of conic sections by quadratic splines
High order approximation of conic
sections by quadratic splines
Michael Floater
SINTEF
P.O. Box 124, Blindern
0314 Oslo
Norway
December 1993. Revised, October 1994
Abstract. Given a segment of a conic section in the form of a rational Bézier curve, a
quadratic spline approximation is constructed and an explicit error bound is derived. The
convergence order of the error bound is shown to be O(h4 ) which is optimal, and the spline
curve is both C 1 and G2 . The approximation method is very efficient as it is based on local
Hermite interpolation and subdivision. The approximation method and error bound are also
applied to an important subclass of rational biquadratic surfaces which includes the sphere,
ellipsoid, torus, cone and cylinder.
Keywords.
approximation, conic sections, quadratic splines
§1. Introduction
The approximate conversion of rational splines to polynomial splines is an important
requirement in computer-aided design. It is often necessary to transfer data from one design
system to another even when they use different representations. Also a number of algorithms
are difficult to generalise from polynomial splines to rational splines, for example lofting
and blending, because of the necessity of positive weights. Evaluation and intersection
algorithms are less efficient for rational splines. So even though NURBS have been described
as the ‘geometry standard’ for curve and surface modelling, it is nevertheless worthwhile
investigating how well one can approximate conics and quadrics by polynomial splines.
A number of papers have been written on the approximation of rational curves and
surfaces by non-rational ones [1], [13], [14], [17], [20]. Though all of these have some strength
of their own, none of them provide an error bound having optimal order of convergence.
Bardis & Patrikalakis [1] point out the lack of bounds for rationals, as do Filip, Magedson,
and Markot [8]. Sederberg and Kakimoto [20] have made some progress by providing an
error bound for their ‘moving control point’ approximation but this is unfortunately not
optimal.
Without an optimal error bound, the approximation will inevitably contain more data
than what is actually necessary for the approximation to be within the given tolerance. In
the worse situation where no error bound is available, one would simply have to guess the
required number of subdivisions, if employing a Hermite approximation, or the number of
interpolation points, if using a global spline approximation. The reason for the difficulty
with rationals is that expressions for derivatives are complicated by the denominator. Yet
1
error bounds for spline approximation normally require bounds on some derivatives of the
curve or surface in question.
In classical spline approximation, the optimal approximation order when approximating
a curve r by a spline curve q with degree n is O(hn+1 ). That is to say, if h is the maximum
length of parameter interval, and the correct approximation method is chosen, there exists
some constant K for which
max |q(t) − r(t)| ≤ Khn+1 .
(1)
t
The power of h cannot be increased. Put in simple terms, each time h is halved, the new error
is roughly 2−(n+1) times the previous one. For example, both C 1 cubic Hermite interpolation
and, provided care is taken near the end points of the parameter domain, C 2 cubic spline
interpolation are O(h4 ) as explained by de Boor [2]. In the cubic Hermite case, K depends
on the fourth derivative of r.
More recently, investigations into so called parametric or geometric approximation suggest that if r is a planar curve, then an approximation order of O(h2n ) is both attainable
and optimal, at least under some restrictions on r such as convexity. By considering the
approximation of a circular segment in a neighbourhood of a point, Lyche & Morken [15]
have derived a local polynomial expansion of order O(h2n ) when n is odd. Very recently,
the author [11] has constructed global Hermite interpolations for conic sections with O(h2n )
convergence. In parametric approximation one exploits the spare degrees of freedom which
become available when one weakens the definition of the error to be a true measure of distance between the curves. For example, one might try to bound the distance of q from
r:
max min |q(s) − r(t)| ≤ Kh2n .
(2)
t
s
Explicit error bounds for parametric approximation have not been derived at all due to
the nonlinearity involved. In the paper by de Boor, Höllig, Sabin [3], it was shown that
parametric cubic Hermite approximation of planar curves, when it is possible, is O(h6 ).
But no explicit expression for K is available, although it is known to depend on the sixth
derivative of r. The same problem is true of the O(h4 ) approximation due to Schaback [19].
The approximation of circular arcs by cubic Bézier segments has been analysed by
Dokken et al. [5]. Their approach is to represent the unit circle in its implicit form x2 (t) +
y 2 (t) = 1. One then argues that if x2 (t) + y 2 (t) − 1 is small then the approximation is good.
By this method they obtained an O(h6 ) error, smaller than that of de Boor, Höllig, Sabin in
this special case. The implicit error bound leads to an explicit one when the approximation
is close. Using a similar method, Mørken [16] has since constructed various fourth order
approximations, i.e. O(h4 ) when approximating a circle by quadratic segments.
So where does this leave the spline approximation of a rational polynomial curve r?
Whether one carries out a classical or a parametric approximation, we do not have any error
bounds in the usual sense. Though bounds have been derived for first derivatives [9] [10], it
is doubtful whether these can be generalised to higher derivatives in a useful way.
Somehow, one feels that, rather than try to bound derivatives, it ought to be possible to
exploit the special form of a rational polynomial in order to construct a good error bound with
respect to a particular approximation method. Knowing already what the approximation
order is for general curves, the goal should be to construct an error bound having the same
2
order of convergence. The bound does not need to be in the form Khk . For example, in the
parametric case, if we can show that
max min |q(s) − r(t)| ≤ ǫ(h),
t
s
and that there exists K for which ǫ(h) ≤ Kh2n , then we will have an excellent method for
approximating rationals. One should still try to find an ǫ(h) which is as small as possible
among those which have optimal convergence order.
Sederberg and Kakimoto [20] give an upper bound on the error q(t) − r(t) of their
‘moving control point’ polynomial approximation q. This method is good in that it applies
to any degree, but in the case when q is quadratic, the error is only O(h2 ) which is neither
optimal in the sense of (1) nor of (2). This is borne out by the slow convergence shown in
the numerical results at the end of that paper.
In the present paper we attack the problem in a different way. A restricted yet important
class of rational polynomials, namely conic sections and surfaces formed from them, for which
an explicit optimal error bound can be constructed is studied. We approximate a rational
quadratic Bézier curve r by geometric quadratic Hermite interpolation and derive an error
bound having order of convergence O(h4 ). This is optimal since we know from the work
of Degen [4] that this type of approximation is O(h4 ), agreeing with (2). Moreover, the
numerical examples indicate that the error bound is sharp in the limit, i.e. the difference
between the error and the error bound becomes negligible in relation to the size of the error.
Thus the algorithm we present here is guaranteed to produce no more data than is absolutely
necessary when approximating conics by quadratic splines.
Since r is a rational Bézier curve, the approximation is very simple. One starts by
approximating r by that quadratic Bézier curve q0 having the same three control points. If
the error is small enough one stops here. Otherwise r is subdivided at the mid point, each
subcurve is normalised and then approximated by a corresponding Bézier curve in the same
way as before, resulting in a spline approximation q1 . The process continues — subdividing
and normalising — until the error between qr and r is small enough. By subdividing in this
non-linear way the spline approximation turns out to be both C 1 and G2 . Thus this method
yields both optimal convergence order and optimal smoothness. This also means that qr
is a special case of the G2 spline developed by Schaback [19]. Normally, to construct a G2
quadratic spline through an arbitrary sequence of points requires the solution of a non-linear
system; a shooting technique is proposed in [19].
An upper bound on the maximum distance of qr from r in each interval is found by using
an explicit parametrisation s(t) for which the error between qr (s(t)) and r(t) can easily be
computed; see Section 2. To be precise, a number ǫr is found such that
max min |qr (s) − r(t)| ≤ ǫr ,
t
s
−4r
and ǫr is O(2 ) where r is the level of subdivision.
Notice that O(2−kr ) implies O(hk ). Indeed, no matter where the subdivision points are
chosen, there are 2r parameter intervals after r levels of subdivision. So let hi,r be the length
of the i-th interval and hr = maxi hi,r . Then
r
h0 = h1,0 =
2
X
i=1
r
hi,r ≤
3
2
X
i=1
hr = 2r hr .
If the approximation error, δr say, is O(2−kr ) then there exists a constant K > 0 for which
δr ≤ 2−kr K. Therefore
δr /hkr ≤ 2kr δr /hk0 ≤ K/hk0
and this means that δr is O(hkr ).
Thus it follows that ǫr above is also O(h4 ), where h is the maximum length of parameter
intervals of r, with respect to the original parameterisation. The subdivision scheme is
described formally in Section 3 and it is proved in Section 4 that ǫr is O(2−4r ) as r → ∞.
In Section 5 the question of continuity is addressed. It is shown that, due to the construction, the spline approximation has both C 1 and G2 continuity, even though it only has
contact of order 1 with the rational curve at the subdivision points. This must be a special
characteristic of conic sections. One would normally expect to achieve at most G1 continuity
when approximating locally with quadratic splines — there are only six degrees of freedom
in a quadratic Bézier segment. The extra order of continuity is also a consequence of the
way the subdivision scheme is chosen; alternating between subdivision at mid points and
normalising. The scheme exploits the natural symmetry of the rational curve in normal
form. In the special case when the rational curve is a circular arc, the subdivision scheme
corresponds precisely to uniform subdivision with respect to angle or arc length.
In Section 6 it is explained how, with very little extra effort, the approximation method
can also be applied to a large class of rational biquadratic surfaces and an optimal error
bound is again derived. One obtains a G2 biquadratic spline approximation which is fourth
order accurate in each parameter direction. Numerical examples are presented in Section 7.
§2. The error bound
We will consider the approximation of the rational quadratic Bézier curve
r(t) =
B0 (t)p0 + B1 (t)wp1 + B2 (t)p2
B0 (t) + B1 (t)w + B2 (t)
(3)
where p0 , p1 , p2 ∈ IR2 are the control points, w ∈ IR is the weight associated with p1 ,
assumed positive, B0 (t) = (1 − t)2 , B1 (t) = 2(1 − t)t, B2 (t) = t2 , are the Bernstein basis
functions, and t is in the range [0,1]. The most general form of a rational curve of degree
two is
B0 (t)w0 p0 + B1 (t)w1 p1 + B2 (t)w2 p2
B0 w0 (t) + B1 (t)w1 + B2 (t)w2
for arbitrary w0 , w1 , w2 > 0 but the so-called normal form (3) can always be arranged by
a scaling and reparametrisation; see Piegl & Tiller [18]. It is shown in Faux & Pratt [7]
that in normal form the size of w determines the type of conic section r represents. r is an
ellipse when w < 1, a parabola when w = 1 and a hyperbola when w > 1; see Figure 1. The
quantity a = w − 1 will play an important role in the analysis which follows.
We shall be concerned with the maximum error |q(s) − r(t)| where q is the Bézier curve
q(s) = B0 (s)p0 + B1 (s)p1 + B2 (s)p2
with s ∈ [0, 1]. Curves r with w < 1 and q are shown in Figure 2. The points r(1/2) and
q(1/2), known as the shoulder points of r and q respectively, both lie on the straight line
4
p
1
w>1
w=1
w<1
p
p
0
2
(p + p ) / 2
0
2
Figure 1. r in the cases 0<w<1, w=1 and w>1.
p
1
q(t)
q(s)
r(t)
p
p
2
0
Figure 2. The curves r and q.
between (p0 + p2 )/2 and p1 . One might expect that |q(t) − r(t)| would achieve its maximum
when t = 1/2 but a calculation reveals that that this is in general not the case. Thus
we dismiss the usual type of approximation q(t) ≈ r(t) and turn instead to a parametric
approximation. Indeed we study a reparametrisation s(t) for which |q(s(t)) − r(t)| does
achieve its maximum at t = s = 1/2. We define s(t) by demanding that the vector q(s(t)) −
r(t) is parallel with p0 − 2p1 + p2 .
5
Proposition 2.1. Let s = t(1 + a(1 − t))/(1 + 2a(1 − t)t) where a = w − 1 > −1. Then
q(s) − r(t) =
a(2 + a)(1 − t)2 t2
(p0 − 2p1 + p2 ).
(1 + 2a(1 − t)t)2
Proof. Since s = t(1 + a(1 − t))/(1 + aB1 (t)), and 1 − s = (1 − t)(1 + at)/(1 + aB1 (t)), it
follows that
B0 (s) =B0 (t)(1 + at)2 /(1 + aB1 (t))2 ,
B1 (s) =B1 (t)(1 + at)(1 + a(1 − t))/(1 + aB1 (t))2 ,
B2 (s) =B2 (t)(1 + a(1 − t))2 /(1 + aB1 (t))2 .
Now
r(t) =
B0 (t)p0 + (1 + a)B1 (t)p1 + B2 (t)p2
,
1 + aB1 (t)
so that
(1 + aB1 (t))2 (q(s) − r(t))
= {(1 + at)2 − (1 + aB1 (t))}B0 (t)p0
+ {(1 + at)(1 + a(1 − t)) − (1 + a)(1 + aB1 (t))}B1 (t)p1
+ {(1 + a(1 − t))2 − (1 + aB1 (t))}B2 (t)p2
=a(2 + a)t2 B0 (t)p0 − a(2 + a)(1 − t)tB1 (t)p1 + a(2 + a)(1 − t)2 B2 (t)p2
=a(2 + a)(1 − t)2 t2 (p0 − 2p1 + p2 ),
as claimed. ⊳
The validity of the reparametrisation can be verified by noticing that both s and 1 − s
are positive whenever 0 < t < 1 because a > −1. Also the denominator is always positive.
The first derivative is found to be
2
s′ (t) = (1 + a(1 − 2t(1 − t)))/(1 + 2a(1 − t)t) ,
and so s′ (t) > 0. Note that the vectors q(s(t)) − r(t) and p0 − 2p1 + p2 have the same
direction when a > 0 and the opposite when a < 0. The magnitude of q(s(t)) − r(t) is
bounded in the following corollary.
Corollary 2.2. With s = s(t) as defined in Proposition 2.1,
|q(s) − r(t)| ≤ |q(1/2) − r(1/2)| =
|a|
|p0 − 2p1 + p2 |
4(2 + a)
for all t ∈ [0, 1].
Proof. From Proposition 2.1 we find that
|q(s) − r(t)| =
|a|(2 + a)B12 (t)
|p0 − 2p1 + p2 |.
4(1 + aB1 (t))2
If φ(t) = B1 (t)/(1 + aB1 (t)) then φ′ (t) = B1′ (t)/(1 + aB1 (t))2 and so, since B1′ (1/2) = 0, φ
takes its maximum in [0, 1] at t = 1/2 . Therefore |q(s) − r(t)| takes its maximum value
when t = s = 1/2. Since B1 (1/2) = 1/2 and φ(1/2) = 1/(2 + a) the corollary is proven. ⊳
6
Remark. An alternative way of deriving the error bound is to affinely map r into either
a circular arc or an equilateral hyperbola x. x can be parametrized in terms of either the
trigonometric or hyperbolic functions repsectively: x(t) = ρ(c(t), s(t)). In these cases the
error bound in the corollary is the error between x and its parabolic approximation along
the x axis and is found after some algebra to be
¶
µ
ρ
1
ρ
− 2 = h4 + O(h6 ),
c(h) +
ǫ=
2
c(h)
8
where h is half the length of the parameter interval spanning x. Since this error bound is a
ratio, it is invariant under the affine mapping and so it is also valid for r. For example, when
r is an elliptic arc, x becomes a circular arc. If θ is the angle subtended by the circular arc,
h = 2θ and we find that
θ4
ǫ≈ρ
,
128
showing that the error is O(θ4 ).
§3. Approximation by subdivision
Corollary 2.2 gives an upper bound on the error when approximating r by a single Bézier
segment q which from now one will be referred to as q0 . Indeed it was demonstrated that
d(q0 , r) ≤ ǫ0 where
d(q0 , r) = max min |q0 (s) − r(t)|
t∈[0,1] s∈[0,1]
is the maximum distance of q0 from r and
ǫ0 = |a||p0 − 2p1 + p2 |/4(2 + a).
One can use this bound to obtain an arbitrarily close spline approximation to r in the
form of a sequence of Bézier segments by recursive binary subdivision. By subdividing r
at the right points we will see that the segments join with order of continuity C 1 and G2 .
Indeed the subdivision scheme consists of alternating between subdividing at mid points and
normalising the new segments. The term G2 refers to geometric continuity of order 2. In
this paper, a parametric curve will be said to be G2 if there exists a reparametrisation for
which it is C 2 .
r is subdivided by the rational de Casteljau algorithm; see Farin [6]. Letting r1 be the
subcurve r|0≤t≤1/2 and r2 be the subcurve r|1/2≤t≤1 one finds
r1 (t) = r(t/2) =
B0 (t)p0,1 + B1 (t)vp1,1 + B2 (t)vp2,1
B0 (t) + B1 (t)v + B2 (t)v
and
r2 (t) = r((1 + t)/2) =
B0 (t)vp2,1 + B1 (t)vp3,1 + B2 (t)p4,1
B0 (t)v + B1 (t)v + B2 (t)
for t ∈ [0, 1] where v = (1 + w)/2, and
p0,1 =p0 ,
p1,1 =(p0 + wp1 )/(1 + w),
p2,1 =(p0 + 2wp1 + p2 )/2(1 + w),
p3,1 =(wp1 + p2 )/(1 + w),
p4,1 =p2 ;
7
p
p
p
1,1
3,1
2,1
r
r
1
2
p
p
0,1
4,1
Figure 3. The first subdivision of r (with w<1).
see Figure 3.
Reparameterising r1 and r2 to put them in normal form, we obtain
√
B0 (t)p0,1 + B1 (t)w1 p1,1 + B2 (t)p2,1
r̂1 (t) = r1 (t/( v(1 − t) + t)) =
B0 (t) + B1 (t)w1 + B2 (t)
and
√
√
B0 (t)p2,1 + B1 (t)w1 p3,1 + B2 (t)p4,1
r̂2 (t) = r2 ( vt/(1 − t + vt)) =
B0 (t) + B1 (t)w1 + B2 (t)
p
√
where w1 = v = (1 + w)/2. If we approximate r̂1 and r̂2 by
q1,1 (s) = B0 (s)p0,1 + B1 (s)p1,1 + B2 (s)p2,1
and
q2,1 (s) = B0 (s)p2,1 + B1 (s)p3,1 + B2 (s)p4,1
respectively, we can apply Corollary 2.2 again and obtain d(q1,1 , r̂1 ) ≤ ǫ1,1 , d(q2,1 , r̂2 ) ≤ ǫ2,1 ,
where
ǫ1,1 = |a1 ||p0,1 − 2p1,1 + p2,1 |/4(2 + a1 ),
ǫ2,1 = |a1 ||p2,1 − 2p3,1 + p4,1 |/4(2 + a1 ),
and a1 = w1 − 1. It is a consequence of the above bounds that the approximation q1
consisting of the two segments q1,1 and q2,1 is such that d(q1 , r) ≤ ǫ1 = max(ǫ1,1 , ǫ2,1 ).
Subdivision algorithm. By continuing to subdivide at the midpoint of each new normalised segment we obtain the subdivision scheme:
(i) Set pi,0 = pi for i = 0, 1, 2 and w0 = w.
(ii) For r = 1, 2, . . .
let, for i = 0, . . . , 2r−1 − 1,
p4i,r =p2i,r−1 ,
p4i+1,r =(p2i,r−1 + wr−1 p2i+1,r−1 )/(1 + wr−1 ),
p4i+2,r =(p2i,r−1 + 2wr−1 p2i+1,r−1 + p2i+2,r−1 )/2(1 + wr−1 ),
(4)
p4i+3,r =(wr−1 p2i+1,r−1 + p2i+2,r−1 )/(1 + wr−1 ),
p4i+4,r =p2i+2,r−1 .
8
p
and let wr = (1 + wr−1 )/2.
The r-th approximation qr (s), s ∈ [0, 1] to r is the piecewise quadratic
qr (s) = B0 (ξ)p2i,r + B1 (ξ)p2i+1,r + B2 (ξ)p2i+2,r
where ξ = 2r s − i, for s ∈ [i/2r , (i + 1)/2r ], i = 0, . . . , 2r − 1.
§4. Order of approximation
In order to study the convergence of the error bound, we define ar = wr − 1 and
ǫr =
|ar |
max |p2i,r − 2p2i+1,r + p2i+2,r |.
4(2 + ar ) i=0,...,2r −1
(5)
Due to the construction of qr and Corollary 2.2, we have that d(qr , r) ≤ ǫr . In the following
theorem it is shown that ǫr → 0 as r → ∞ and the convergence is fourth order. This
of course implies that d(qr , r) also has fourth order convergence but this follows from a
theorem in Degen [4] since qr is a quadratic Hermite interpolation in each segment. The
theorem actually looks a lot more complicated than it really is. Essentially the two significant
components |ar | and maxi=0,...,2r −1 |p2i,r − 2p2i+1,r + p2i+2,r | are both O(2−2r ), i.e. O(h2 ).
The quantity |ar | is in a sense a measure of the “rationality” of each subcurve of r after
r subdivision levels. Indeed, ar = wr − 1 and if ar were 0 (equivalently a were 0), r would be
a parabola. Thus it is not surprising that if |ar | is O(h2 ), as shown in the theorem, that qr
approaches r as r increases — qr can be regarded as a rational curve with ar = 0. The first
part of the theorem shows in fact that the “rationality” of each curve segment gets smaller at
a rate of O(h2 ). This turns out to be quite easy to prove because ar can be solved explicitly.
Meanwhile the quantity |p2i,r − 2p2i+1,r + p2i+2,r |, is clearly a second order difference
and one would expect this to be O(h2 ). Now, had r been non-rational (a = ar = 0 for
all r), it would have been almost trivial to prove this. One could either use the fact that
2(p0 − 2p1 + p2 ) were precisely equal to the constant second derivative r′′ (t) or from the
subdivision scheme (4), one would obtain
1
p4i,r − 2p4i+1,r + p4i+2,r = p4i+2,r − 2p4i+3,r + p4i+4,r = (p2i,r−1 − 2p2i+1,r−1 + p2i+2,r−1 ).
4
But since ar 6= 0, one finds instead equation (6) below. Even so it is relatively straightforward
to demonstrate that αr is O(2−(2−δ)r ) for any small δ. Most of the complications arise when
achieving O(2−2r ).
Theorem 4.1. The error bound ǫr is O(2−4r ) as r → ∞.
Proof. The proof is in two parts. We show that both (i) |ar | is O(2−2r ) and (ii) maxi |p2i,r −
2p2i+1,r + p2i+2,r |/(2 + ar ) is O(2−2r ) as r → ∞.
(i) The recursive equation for wr resembles the half angle formulas for cos and cosh, namely
p
p
cos(x/2) = (cos x + 1)/2,
and
cosh(x/2) = (cosh x + 1)/2.
From this observation we can solve wr explicitly. If w0 < 1 we find
wr = cos(2−r cos−1 (w0 )),
9
and when w0 > 1,
wr = cosh(2−r cosh−1 (w0 )),
Now, taking the case w0 < 1, if we let θ = cos−1 (w0 ), we find by expanding cos in its power
series that
θ4
θ6
θ2
−
···.
22r ar = 22r (wr − 1) = − +
2! 4! 22r 6! 24r
Therefore 22r ar is bounded and indeed
22r ar → −(cos−1 (w0 ))2 /2.
A similar argument shows that 22r ar is also bounded when w0 > 1 and then
22r ar → (cosh−1 (w0 ))2 /2.
Thus |ar | is O(2−2r ) as claimed.
(ii) To improve clarity, set
αr =
βr =
max
i=0,...,2r −1
|p2i−2,r − 2p2i−1,r + p2i,r |/(2 + ar )
max
i=0,...,2r+1 −1
|pi+1,r − pi,r |/(2 + ar ).
The task is to show that αr is O(2−2r ). From the subdivision scheme (4) we find that after
some manipulation,
p4i,r − 2p4i+1,r + p4i+2,r =
p2i,r−1 − 2p2i+1,r−1 + p2i+2,r−1 ar−1 (p2i,r−1 − p2i+1,r−1 )
+
,
2(2 + ar−1 )
(2 + ar−1 )
and
p4i+2,r − 2p4i+3,r + p4i+4,r =
p2i,r−1 − 2p2i+1,r−1 + p2i+2,r−1 ar−1 (p2i+2,r−1 − p2i+1,r−1 )
+
.
2(2 + ar−1 )
(2 + ar−1 )
Taking maximums over each side and dividing by (2 + ar ), we then have
αr ≤
αr−1
|ar−1 |βr−1
+
.
2(2 + ar )
(2 + ar )
(6)
It turns out that |ar−1 |βr−1 becomes negligible relative to αr−1 in the limit. Further algebra
reveals that
(1 + ar−1 )(p2i+1,r−1 − p2i,r−1 )
,
p4i+1,r − p4i,r =
(2 + ar−1 )
and
p4i+2,r − p4i+1,r =
p2i+2,r−1 − p2i,r−1
p2i+2,r−1 − p2i+1,r−1 p2i+1,r−1 − p2i,r−1
=
+
.
2(2 + ar−1 )
2(2 + ar−1 )
2(2 + ar−1 )
10
With the other two cases being symmetries of these, taking the maximum over i of each side
and dividing by (2 + ar ) implies
βr ≤
1 + |ar−1 |
βr−1 ,
2 + ar
and in view of the fact that ar → 0 it is clear that βr is O(2−(1−δ)r ) for any δ > 0. To obtain
the sharper O(2−r ), let φr = 2r βr and take logs. Using the fact that log(x) ≤ x − 1 for
x > 0, one finds
µ
¶
2 + 2|ar−1 |
log(φr ) ≤ log
+ log(φr−1 )
2 + ar
2|ar−1 | − ar
≤
+ log(φr−1 )
2 + ar
≤3|ar−1 | + log(φr−1 ),
since |ar | < |ar−1 | follows from (4) and 2 + ar > 1. Further, because |ar | ≤ 2−2r K, for some
K,
log(φr ) ≤ 4K + log(φ0 ),
i.e.
φr ≤ e4K φ0 ,
which means
βr ≤ 2−r e4K β0 ,
and therefore βr is O(2−r ).
Now we attack (6) in a similar way. Combining the convergence of βr with ar we see
that the product |ar |βr must be O(2−3r ). In other words there exists a constant L for which
23r |ar |βr ≤ L. Therefore if we let γr = 22r αr , we obtain
γr ≤
2
(γr−1 + 2−r+2 L).
(2 + ar )
As previously the key to showing that γr is bounded is to take logs:
µ
¶
2
log(γr ) ≤ log
+ log(γr−1 + 2−r+2 L)
2 + ar
|ar |
≤
+ log(γr−1 + 2−r+2 L).
2 + ar
Now we have log(x) ≤ x − 1 and moreover, since log is concave, log(a + b) ≤ log(a) + b log′ (a)
for a, b > 0. Then log(a + b) ≤ log(a) + b ≤ | log(a)| + b when a ≥ 1 and log(a + b) ≤
a + b − 1 ≤ b ≤ | log(a)| + b when a < 1. In either case, | log(a + b)| ≤ | log(a)| + b. Applying
this estimate, one finds
| log(γr )| ≤ |ar | + | log(γr−1 )| + 2−r+2 L,
and so
log(γr ) ≤ | log(γr )| ≤ K/3 + | log(γ0 )| + 4L.
11
Thus
γr ≤ eK/3+| log(γ0 )|+4L ,
and therefore
Hence αr is O(2−2r ) as claimed.
αr ≤ 2−2r eK/3+| log(α0 )|+4L .
⊳
§5. Order of continuity
Since the r-th approximation qr touches r tangentially at the points of subdivision
p0,r , p2,r , p4,r , . . . , p2r+1 ,r , it is clear that qr and r meet with order of contact 1 and that
qr is itself a G1 curve. In the following theorem it is shown that the order of continuity of
qr is in fact both C 1 and G2 .
Recall that sufficient conditions for the two Bézier curves B0 (u)a0 + B1 (u)a1 + B2 (u)a2
and B0 (u)b0 + B1 (u)b1 + B2 (u)b2 to join with C 1 and G2 continuity at u = 1 and u = 0
respectively are a2 = b0 , a1 − 2a2 + b1 = 0, and b2 − a0 = λ(b1 − a1 ) for some scalar λ.
Thus when r = 1, it can be seen from Figure 3 that the two subcurves of q1 join with C 1
and G2 continuity. Mathematically, from the definition (4) of the pi,1 , one finds
p1,1 − 2p2,1 + p3,1 = 0
and
p4,1 − p0,1 = (1 + w0 )(p3,1 − p1,1 ).
In other words, the vectors p2,1 − p1,1 and p3,1 − p2,1 are equal (in both length and direction)
while the vectors p3,1 − p1,1 and p4,1 − p0,1 are parallel (the ratio of their lengths depends
on the weight w0 ). By a similar argument, after the next subdivision r = 2, the first two of
the four subcurves of q2 join with C 1 and G2 continuity as do the last two. The order of
continuity between the middle two subcurves on the other hand follows from the continuity
of the two subcurves of q1 .
Theorem 5.1. The curve qr is both C 1 and G2 .
Proof. We prove, by induction on r, that for all r and all i,
p2i+1,r − 2p2i+2,r + p2i+3,r = 0,
(7)
p2i+4,r − p2i,r = (1 + wr−1 )(p2i+3,r − p2i+1,r ) = 2wr2 (p2i+3,r − p2i+1,r ).
(8)
and
Let r ≥ 2 and assume that these identities hold for r − 1.
To prove (7), for each i ∈ {0, . . . , 2r−1 − 1} there are two cases. From the subdivision scheme
(4) we find
p4i+1,r − 2p4i+2,r + p4i+3,r = 0
12
and
p4i+3,r − 2p4i+4,r + p4i+5,r =
wr−1
(p2i+1,r−1 − 2p2i+2,r−1 + p2i+3,r−1 ) = 0
(1 + wr−1 )
by the induction hypothesis.
To prove (8) there are again two cases. In the first we find
p4i+4,r − p4i,r = (1 + wr−1 )(p4i+3,r − p4i+1,r )
directly from the subdivision scheme. In the second, by the induction hypothesis, p2i+4,r−1 −
p2i,r−1 = (1 + wr−2 )(p2i+3,r−1 − p2i+1,r−1 ). This implies that
p4i+6,r − p4i+2,r =
2wr−1 + (1 + wr−2 )
(p4i+5,r − p4i+3,r ) = (1 + wr−1 )(p4i+5,r − p4i+3,r ),
2wr−1
as required.
When r = 1,
p1,1 − 2p2,1 + p3,1 = 0,
and
p4,1 − p0,1 = (1 + w0 )(p3,1 − p1,1 ),
which completes the proof.
⊳
The above theorem means that we can express the r-th approximation qr as a uniform
quadratic spline. Its control points are
p0,r , p1,r , p3,r , p5,r , . . . , p2r+1 −1,r , p2r+1 ,r
and its knot vector is 0, 0, 1/2r , 2/2r , . . . , (2r − 1)/2r , 1, 1.
Note that the C 1 and G2 continuity of the approximant depend critically on the fact
that r is subdivided in every interval simultaneously. If one subdivided adaptively, the
approximant would in general only be G1 .
Remark. Note also that the G2 continuity can be demonstrated alternatively by affinely
mapping, at each level of subdivision, each pair of subcurves into a circular arc or equilateral
hyperbola. Since then the two approximating curves are symmetries of each other, they
share the same curvature at their contact point. The G2 continuity then follows because
curvature is an affinely-invariant quantity.
13
§6. Approximation of surfaces
Using the same error bound and essentially the same subdivision scheme as developed
for curves one can obtain a fourth order approximation and error bound for members of an
important subclass of rational tensor-product biquadratic Bézier surfaces. In fact, we can
construct a biquadratic spline approximation to the parametric surface
r(u, v) =
P2
j=0 Bi (u)Bj (v)wij pij
i=0
P2 P2
j=0 Bi (u)Bj (v)wij
i=0
P2
which is both fourth order accurate in each parameter direction and C 1 and G2 provided
only that
w00 wij = wi0 w0j .
(9)
No restrictions whatsoever are put on the control points pij . A surface is said to be G2 if it
can be reparametrised so as to be C 2 .
Without demanding condition (9), the bound in (12) would not be possible. Furthermore
the high order of continuity (both C 1 and G2 ) would be lost as equations (13) and (14) would
no longer be valid. There does not appear to be any easy way of improving on this. With
condition (9), r has the property that every isoparametric curve in u (a surface curve of
the form v = const) is a rational quadratic curve with the same three weights, namely
w00 , w10 , w20 , irrespectively of v. For if one fixes v to be some v̄, one can write (after
multiplying throughout by w00 )
r(u, v̄) =
P2
i=0 Bi (u)wi0 ri (v̄)
P
2
i=0 Bi (u)wi0
where
P2
j=0
ri (v̄) = P2
Bj (v̄)w0j pij
j=0
Bj (v̄)w0j
.
The same is true, of course, of isoparametric curves in the v variable. There is an interesting
analogy between (9) and the condition for a tensor-product Bézier surface to be translational,
namely p00 + pij = pi0 + p0j , as defined in [6].
Among surfaces satisfying (9) are those constructed by revolving any conic section (representable by a rational Bézier curve) in the xz plane about the z axis, through an angle
of less than 180 degrees. For example a sphere is typically represented by 8 patches of this
kind while the torus can be represented by 16 of them; see [18]. Due to the symmetry of the
patches the approximation method will yield an approximant to the whole sphere or torus
which is C 1 and G2 . One must make sure that, in each parameter direction, the number
of subdivisions in each patch is constant. Patches of cylinders, cones, elliptic cones and
ellipsoids can also be expressed in the form of r(u, v) satisfying (9). Note that in all of these
particular cases there is in addition some kind of symmetry among the control points but
this is not a requirement for the approximation method described here.
Given that the weights are in the form (9) it is straightforward to reparametrise r if
necessary in such a way that
"
#
1
w2
1
[wij ] = w1 w1 w2 w1 ,
1
w2
1
14
(the indices go from 0 to 2). We will now approximate r(u, v) by
q(s, t) =
2 X
2
X
Bi (s)Bj (t)pij
i=0 j=0
where
s = u(1 + a1 (1 − u))/(1 + a1 B1 (u))
and
t = v(1 + a2 (1 − v))/(1 + a2 B1 (v)),
and a1 = w1 − 1, a2 = w2 − 1. To compute an upper bound on
d(q, r) = max min |q(s, t) − r(u, v)|,
with Ω = [0, 1] × [0, 1],
(u,v)∈Ω (s,t)∈Ω
we define the intermediate surface
g(u, t) =
P2
i=0
P2
j=0
P2
Bi (u)Bj (t)wi0 pij
i=0
Bi (u)wi0
which is rational in u but non-rational in t. Observe now that
#
" 2
P2
2
X
X
B
(u)w
p
i
i0
ij
i=0
q(s, t) − g(u, t) =
,
Bj (t)
Bi (s)pij − P
2
i=0 Bi (u)wi0
j=0
i=0
and, from (9),
g(u, t) − r(u, v) =
2
X
i=0
Bi (u)wi0
"
P2
2
X
#
2
.X
B
(v)w
p
0j ij
j=0 j
Bj (t)pij − P2
Bi (u)wi0 .
j=0 Bj (v)w0j
j=0
i=0
Now the two expressions in the square brackets are completely analogous to the difference
q(s) − r(t) considered for curves in Corollary 2.2. Appealing to Corollary 2.2 and by the
convex hull property of non-rational and rational Bézier curves respectively it follows that
|q(s, t) − g(u, t)| ≤
|a1 |
max |p0j − 2p1j + p2j |
4(2 + a1 ) j=0,1,2
(10)
|g(u, t) − r(u, v)| ≤
|a2 |
max |pi0 − 2pi1 + pi2 |.
4(2 + a2 ) i=0,1,2
(11)
and
Hence
d(q, r) ≤|q(s, t) − r(u, v)|
|a1 |
|a2 |
≤
max |p0j − 2p1j + p2j | +
max |pi0 − 2pi1 + pi2 |.
4(2 + a1 ) j=0,1,2
4(2 + a2 ) i=0,1,2
(12)
It is clear from this that by recursively subdividing and normalising r in each parameter
direction in an analogous way to (4), the convergence order of the bound is four in each
15
direction. After each subdivision one can compute each of the bounds (10) and (11) separately. The greater of the two error bounds can then be used to determine the parameter
direction in which to subdivide next. Note that for a surface such as a cylinder one would
only need to subdivide in one direction.
The approximant will also be C 1 and G2 . Let us illustrate the proof of continuity by
showing that after subdividing r(u, v) once at u = 1/2, the approximant q(s, t), consisting
of the two patches q1 and q2 , is C 1 and G2 along the edge s = u = 1/2.
The goal then is to prove that the two patches
q1 (s, t) =
2 X
2
X
Bi (s)Bj (t)qij ,
i=0 j=0
q2 (s, t) =
2 X
2
X
Bi (s)Bj (t)q2+ij ,
i=0 j=0
join with C 1 and G2 continuity at s = 1 and s = 0 respectively, where
q0,j
q1,j
q2,j
q3,j
q4,j
=p0,j ,
=(p0,j + w1 p1,j )/(1 + w1 ),
=(p0,j + 2w1 p1,j + p2,j )/2(1 + w1 ),
=(w1 p1,j + p2,j )/(1 + w1 ),
=p2,j .
Similar to the curve case one finds that
q1,j − 2q2,j + q3,j = 0,
(13)
q4,j − q0,j = (1 + w1 )(q3,j − q1,j ).
(14)
and
The C 1 continuity is a consequence of (13) and G2 continuity follows from both (13) and
(14) where the important point is that the factor (1 + w1 ) is independent of j. Indeed C 1
continuity is a consequence of the fact that the first derivatives with respect to s of q1 and
q2 are equal at s = 1 and s = 0 respectively;
2
2
X
X
∂
∂
q2 (0, t) = 2
q1 (1, t).
Bj (t)(q3,j − q2,j ) = 2
Bj (t)(q2,j − q1,j ) =
∂s
∂s
j=0
j=0
The derivatives ∂/∂t and ∂ 2 /∂s∂t also agree since both patches are C 1 in t along the edge.
Now consider G2 continuity. Following Gregory [12], it is sufficient to find a C 2 mapping
ϕ : IR → IR, defined in a neighbourhood of s = 0, with ϕ(0) = 1 and ϕ′ (0) > 0 for which
all partial derivatives in s up to order two of the patches q1 (ϕ(s), t) and q2 (s, t) are equal
at s = 0. It is not necessary to look at derivatives involving t. This is due to the fact
that the patches are C 2 along the adjoining edge and that the direction of the s variable
in the parameter plane is transversal to the knot line; continuity of cross derivatives comes
16
automatically from differentiation. Let ϕ(s) = 1 + s − a1 s2 where a1 = w1 − 1. By the chain
rule one finds
∂
∂
q1 (ϕ(s), t) = (1 − 2a1 s) q1 (ϕ, t),
∂s
∂ϕ
and
2
∂
∂2
2 ∂
q
(ϕ,
t)
+
(1
−
2a
s)
q
(ϕ(s),
t)
=
−2a
q1 (ϕ, t).
1
1
1
1
∂s2
∂ϕ
∂ϕ2
Then, from (13),
2
2
X
X
∂
∂
q2 (0, t) = 2
q1 (ϕ(0), t),
Bj (t)(q3,j − q2,j ) = 2
Bj (t)(q2,j − q1,j ) =
∂s
∂s
j=0
j=0
and, applying both (13) and (14),
2
X
∂2
q2 (0, t) =2
Bj (t)(q2,j − 2q3,j + q4,j )
∂s2
j=0
= − 4a1
2
=
2
X
j=0
Bj (t)(q2,j − q1,j ) + 2
∂
q1 (ϕ(0), t).
∂s2
2
X
j=0
Bj (t)(q0,j − 2q1,j + q2,j )
Therefore q1 and q2 join with G2 continuity. Using an approach similar to that in Theorem 5.1, one easily extends the above proof to cover any depth of subdivision in either
parameter. Also at a point where s and t knot lines meet, the approximant is G2 since each
adjacent pair of the four neighbouring patches join with G2 continuity. This is explained in
[12]. The same remark is valid, for example, at the poles of the sphere considered in the
next section.
17
§7. Numerical examples
The approximation scheme
was applied to an octant
√
weights w1 = w2 = 1/ 2 and control points
"
(1, 0, 0) (1, 0, 1)
[pij ] = (1, 1, 0) (1, 1, 1)
(0, 1, 0) (0, 1, 1)
of a sphere with unit radius. r has
#
(0, 0, 1)
(0, 0, 1) .
(0, 0, 1)
At each level
pof subdivision both the error bound E1 given by (12) and the actual maximum
error E2 = x2 + y 2 + z 2 − 1, found by sampling each patch of the approximant at 20 × 20
points, are shown in Table 1. Note that E1 approaches E2 in the limit, suggesting that the
error bound is sharp. Note also that the error at each level is roughly a sixteenth of the
previous one.
Figure 4 shows the boundaries of the 16 × 8 patches of a biquadratic approximant of a
whole sphere of radius 1. r is a rational biquadratic spline with 4 × 2 patches and there are
two levels of subdivision in each direction. The error bound is 3.80 × 10−4 ; see also Table 1.
Figure 5 shows the boundaries of the 16 × 16 patches of a biquadratic approximant of a
whole torus of outer radius 3 and inner radius 1. r is a rational biquadratic spline with 4 × 4
patches and there are again two levels of subdivision in each direction. The error bound is
9.44 × 10−4 .
Number of patches
1×1
2×2
4×4
8×8
16 × 16
32 × 32
E1
1.34 × 10−1
6.49 × 10−3
3.80 × 10−4
2.33 × 10−5
1.45 × 10−6
9.07 × 10−8
E2
9.70 × 10−2
5.84 × 10−3
3.69 × 10−4
2.31 × 10−5
1.45 × 10−6
9.07 × 10−8
Table 1.
§8. Conclusions
A method for approximating conic sections by quadratic splines with continuous curvature
has been presented. Moreover an explicit error bound is derived and this can be used to
determine how many subdivisions are required in order to satisfy a given tolerance. The
main advantages of this method and the error bound are:
(i) The error bound is O(h4 ) which is optimal,
(ii) The spline approximation is both C 1 and G2 , also optimal,
(iii) The scheme applies also to a large number of the most commonly used analytic
surfaces in computer-aided design.
There is also a good potential for generalising these ideas to higher degree spline approximations and higher degree rational polynomials [11].
Acknowledgement. I would like to thank Knut Mørken for helpful and enjoyable discussions about high order approximation. I would also like to thank the referees for helpful
comments and suggestions for improving the readability of this paper.
18
Figure 4. Approximation of a sphere.
§9. References
1. Bardis L., & Patrikalakis M.,
Approximate conversion of rational B-spline patches,
Computer-Aided Geom. Design 6 (1989), 189–204.
2. de Boor, C., A Practical Guide to Splines, Springer-Verlag, New York, 1978.
3. de Boor, C., Höllig, K., & Sabin M., High accuracy geometric Hermite interpolation,
Computer-Aided Geom. Design 4 (1987), 269–278.
4. Degen, W., High accurate rational approximation of parametric curves, Computer-Aided
19
Figure 5. Approximation of a torus.
Geom. Design 10 (1993), 293–313.
5. Dokken, T., Dæhlen, M., Lyche, T., & Mørken, K., Good approximation of circles by
curvature-continuous Bézier curves, Computer-Aided Geom. Design 7 (1990), 33–41.
6. Farin, G., Curves and surfaces for computer aided geometric design, Academic Press,
San Diego, 1988.
7. Faux, I., & Pratt, M., Computational geometry for design and manufacture, Ellis Horwood, England, 1979.
20
8. Filip, D., Magedson, R., & Markot, R., Surface algorithms using bounds on derivatives,
Computer-Aided Geom. Design 3 (1986), 295–311.
9. Floater, M. S., Derivatives of rational Bézier curves, Computer-Aided Geom. Design 9
(1992), 161–174.
10. Floater, M. S., Evaluation and properties of the derivative of a NURBS curve, in Mathematical Methods in CAGD, T. Lyche & L. L. Schumaker (eds.), Academic Press, Boston,
(1992), 261–274.
11. Floater, M. S., An O(h2n ) Hermite approximation for conic sections, preprint.
12. Gregory, J. A., Geometric continuity, in Mathematical Methods in CAGD, T. Lyche &
L. L. Schumaker (eds.), Academic Press, Boston, (1989), 353–371.
13. Hoschek, J., Approximate conversion of spline curves, Computer-Aided Geom. Design 4
(1987), 59–66.
14. Hoschek, J., & Schneider, F., Spline conversion for trimmed rational Bézier- and B-spline
surfaces, Comput. Aided Design 22 (1990), 580–590.
15. Lyche, T., Mørken, K., A metric for parametric approximation, preprint.
16. Mørken, K., Best approximation of circle segments by quadratic Bézier curves, in Curves
and Surfaces, P. L. Laurent, A. Le Méhaute & L. L. Schumaker (eds.) Academic Press,
Boston, (1991), 331–336.
17. Patrikalakis, M., Approximate conversion of rational splines, Computer-Aided Geom.
Design 6 (1989), 155–165.
18. Piegl, L., & Tiller, W., Curve and surface constructions using rational B-splines, Comput.
Aided Design 19 (1987), 485–498.
19. Schaback, R., Interpolation with piecewise quadratic visually C 2 Bézier polynomials,
Computer-Aided Geom. Design 6 (1989), 219–233.
20. Sederberg, T. & Kakimoto, M., Approximating rational curves using polynomial curves,
in NURBS for Curve and Surface Design, G. Farin (ed), SIAM, Philadelphia, (1991),
149–158.
21
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement