Parameterization for Curve Interpolation Michael S
Total Page:16
File Type:pdf, Size:1020Kb
Working title: Topics in Multivariate Approximation and Interpolation 101 K. Jetter et al., Editors °c 2005 Elsevier B.V. All rights reserved Parameterization for curve interpolation Michael S. Floater and Tatiana Surazhsky Centre of Mathematics for Applications, Department of Informatics, University of Oslo, P.O. Box 1035, 0316 Oslo, Norway Abstract A common task in geometric modelling is to interpolate a sequence of points or derivatives, sampled from a curve, with a parametric polynomial or spline curve. To do this we must ¯rst choose parameter values corresponding to the interpolation points. The important issue of how this choice a®ects the accuracy of the approxi- mation is the focus of this paper. The underlying principle is that full approximation order can be achieved if the parameterization is an accurate enough approximation to arc length. The theory is illustrated with numerical examples. Key words: interpolation, curves, arc length, approximation order 1. Introduction One of the most basic tasks in geometric modelling is to ¯t a smooth curve d through a sequence of points p ; : : : pn in , with d 2. The usual approach is 0 ¸ to ¯t a parametric curve. We choose parameter values t0 < < tn and ¯nd a d ¢ ¢ ¢ parametric curve c : [t ; tn] such that 0 ! c(ti) = pi; i = 0; 1; : : : ; n: (1) Popular examples of c are polynomial curves (of degree at most n) for small n, and spline curves for larger n. In this paper we wish to focus on the role of the parameter values t0; : : : ; tn. Empirical evidence has shown that the choice of parameterization has a signi¯cant e®ect on the visual appearance of the interpolant c. We will distinguish between two di®erent applications: 102 Michael S. Floater and Tatiana Surazhsky { Design. If a designer wants to use interpolation to design a curve, then we can simply view parameterization as a design tool. In addition to choosing the points pi, the designer is also free to choose the parameter values ti in order to increase the degrees of freedom at his disposal. { Approximation. If the points pi have been sampled from a smooth curve, e.g. a height contour, ¢ a curve of intersection between two surfaces, ¢ or a physical curve, ¢ then the curve c will be an approximation to the curve the points pi were sam- pled from. The important issue is now the approximation error. An interpolation method with higher approximation order will lead to faster convergence to the sampled curve as the sampling density increases. While a lot of e®ort has been put into the e®ect of parameterization from the view point of design, little was known until recently about its e®ect on approximation order. The purpose of this paper is to summarize the recent results of [7,8] on approximation order and to illustrate the theory with numerical examples. Some comparisons with `geometric interpolation' are made later in the paper. 2. Parameterization methods In order to discuss di®erent parameterization methods, we will use the example 2 d 2 of C cubic spline interpolation. Suppose σ : [t0; tn] is the C cubic spline curve such that ! σ(ti) = pi; i = 0; 1; : : : ; n; and 0 σ (ti) = mi; i = 0; n; (2) for some chosen vectors m0, mn. By `cubic spline curve' we understand that σ is 2 a cubic polynomial curve in each interval [ti; ti+1], and that σ has C continuity at the break points t1; : : : ; tn¡1. As is well-known [1,2,6], σ is unique. The end conditions (2) are sometimes known as `clamped' end conditions, and this kind of spline interpolation is sometimes called `complete' spline interpolation. The ¯rst thing to note about parameterization is that applying a linear transfor- mation to t0; : : : ; tn does not change the resulting spline curve. Provided we treat the end conditions (2) correctly, we simply get a reparameterization of σ. To be precise, if we de¯ne t^i := ¸ti + ¹; i = 0; 1; : : : ; n; d for ¸ > 0 and we de¯ne the curve σ^ : [t^ ; t^n] by 0 ! σ^(t) := σ((t ¹)=¸); ¡ 2 then σ^ is clearly a C cubic spline curve over the partition t^0 < t^1 < < t^n, satisfying the conditions ¢ ¢ ¢ σ^(t^i) = pi; i = 0; 1; : : : ; n; Parameterization for curve interpolation 103 and 0 σ^ (t^i) = mi=¸; i = 0; n: For this reason, we may as well set t0 = 0 and we typically specify a parameteriza- tion by recursively setting ti+1 := ti + di for some chosen interval lengths d0; d1; : : : ; dn¡1 > 0. Multiplying the interval lengths di by a common factor ¸ will not change the intrinsic geometry of the spline curve σ as long as we divide the vectors m0 and mn by the same factor ¸. The simplest choice is the uniform parameterization de¯ned by di = 1, where the values ti are uniformly spaced. But as early as 1967, Ahlberg, Nilson, and Walsh [1] proposed using the chordal parameterization in which di := pi pi ; (3) j +1 ¡ j and denotes the Euclidean norm in d. The motivation behind this was that the distancej ¢ j between two points on a curve is a reasonable approximation to the length of the associated curve segment. Thus the hope was that the `speed' σ0(t) j j of the spline curve might be close to unity at all t [t0; tn]. Epstein [5] showed that when using periodic boundary2 conditions, a chordal C 2 0 cubic spline interpolant is always regular, i.e., σ (t) = 0 at every t [t0; tn]. Later, it was realized that the uniform and chordal6 parameterizations2 are the special cases ¹ = 0 and ¹ = 1 of the more general parameterization ¹ di := pi pi ; j +1 ¡ j with 0 ¹ 1 acting as a kind of blending parameter. The choice ¹ = 1=2 was termed ·by Lee· [11] the centripetal parameterization, and suggested that it sometimes leads to a spline curve which is closer to the polygon passing through the data points pi. Later still, Foley and Nielson [9] observed that the chordal parameterization lacks a±ne invariance. If a non-uniform scaling is applied to the data points pi and the new chord lengths are computed, then the resulting spline curve will not in general be a scaling of the original. This suggested replacing the Euclidean distance in (3) by a metric which is invariant to a±ne transformations of the data points. Nielson had earlier found such an a±ne-invariant metric, and they de¯ned di with the aid of both the a±ne-invariant distance between pi and pi+1 and the angles of the polygon passing through pi¡1; pi; pi+1; pi+2. Thus, unlike the previous methods, every value of di depends on all the data points p0; : : : ; pn. Our goal in this paper is to study the e®ect of parameterization on approximation and with this in mind we have sampled points pi from a ¯xed smooth curve, and computed the four spline curves σ resulting from the uniform, chordal, centripetal, and Foley-Nielson knot-vectors. Figure 1 shows the ¯xed curve in black and the four spline curves shown in grey. We chose the end vectors m0, mn to have the same direction as the given curve and to have the magnitude m := p p =d ; mn := pn pn¡ =dn¡ ; j 0j j 1 ¡ 0j 0 j j j ¡ 1j 1 the motivation being that σ0(t ) (p p )=d . 0 ¼ 1 ¡ 0 0 104 Michael S. Floater and Tatiana Surazhsky (a) uniform (b) chordal (c) centripetal (d) Foley-Nielson Fig. 1. Choice of knot-vector for cubic spline interpolation. f c Fig. 2. Distance between two curves. It is quite evident from the ¯gure that the chordal curve appears to be a par- ticularly good approximation to the original curve. As we will see, this is not coincidence, and due to the fact that the length of a chord is a relatively good approximation to the length of an arc. 3. Approximation error The example of Figure 1 clearly shows that parameterization a®ects approxi- mation error. In order to study approximation, we will assume that the points pi d are samples, pi = f(si), from a parametric curve f : [a; b] , d 2, with ! ¸ a s0 < < sn b. We will assume that f is parameterized with respect to arc length,· by¢ ¢whic¢ h w·e mean that it is (at least) continuously di®erentiable and that f 0(s) = 1 for all s [a; b]. Then the interpolation problem becomes j j 2 c(ti) = f(si); i = 0; 1; : : : ; n; (4) and the error is the distance between the curve piece f [s0;sn] and the curve c, see Figure 2. One well-known way of measuring the distancej between two such curves is the Hausdor® distance, distH (f [s0;sn]; c) = max max min f(s) c(t) ; max min f(s) c(t) : j ft0·t·tn s0·s·sn j ¡ j s0·s·sn t0·t·tn j ¡ jg Parameterization for curve interpolation 105 f(s 0 ) f(s ) f(s ) 2 1 f(s 3 ) Fig. 3. Cubic interpolation. 4. Approximation order It seems di±cult to derive bounds on the error between f and σ. We will in- stead study the approximation order. A higher approximation order implies faster convergence of the interpolating curves to the given curve as the sampling density increases. Consider for simplicity polynomial interpolation, i.e., let c in (4) be the d Lagrange polynomial interpolant p : [t0; tn] of degree at most n, and let h be the length of the curve piece f , i.e., ! j[s0;sn] sn 0 h = L(f [s0;sn]) = f (s) ds = sn s0: j Zs0 j j ¡ k The following table gives numerical estimates of k s.t.