c-shaped hermite interpolation by rational cubic bézier curve with conic precision

7
Computer Aided Geometric Design 31 (2014) 258–264 Contents lists available at ScienceDirect Computer Aided Geometric Design www.elsevier.com/locate/cagd C-shaped G 2 Hermite interpolation by rational cubic Bézier curve with conic precision Yajuan Li a,, Chongyang Deng a , Weiyin Ma b a School of Science, Hangzhou Dianzi University, Hangzhou 310018, China b Department of Mechanical and Biomedical Engineering, City University of Hong Kong, Kowloon, Hong Kong, China article info abstract Article history: Received 26 November 2012 Received in revised form 13 February 2014 Accepted 28 March 2014 Available online 8 April 2014 Keywords: Rational conic Bézier curve Rational cubic Bézier curve G 2 Hermite interpolation Conic precision We present a simple method for C-shaped G 2 Hermite interpolation by a rational cubic Bézier curve with conic precision. For the interpolating rational cubic Bézier curve, we derive its control points according to two conic Bézier curves, both matching the G 1 Hermite data and one end curvature of the given G 2 Hermite data, and the weights are obtained by the two given end curvatures. The conic precision property is based on the fact that the two conic Bézier curves are the same when the given G 2 Hermite data are sampled from a conic. Both the control points and weights of the resulting rational cubic Bézier curve are expressed in explicit form. © 2014 Elsevier B.V. All rights reserved. 1. Introduction It’s well known that (rational) Bézier curves (Farin, 1996) are widely used in Computer Aided Geometric Design (CAGD). Especially, G 2 Hermite interpolation, interpolating points as well as their tangent vectors and curvatures, by rational cubic Bézier curves have been extensively studied in the literature (Farin, 1996; de Boor et al., 1987; Goodman, 1988; Degen, 1993; Sakai, 2001; Chen et al., 2002; Walton and Meek, 2011; Li and Deng, 2012). Recently, methods on interpolating G 1 (Farin, 2008; Femiani et al., 2012) or G 2 (Walton and Meek, 2011; Li and Deng, 2012) Hermite data by rational cubic Bézier curve with circular arc precision property have been proposed. However, to our best knowledge, there are no methods on G 2 Hermite interpolation by rational cubic Bézier curves with conic precision. In consideration of the important applications of conics in CAGD, we propose such a method in this paper. Applying the reparametrization method, rational Bézier curve can be transformed to standard form: both the first and the last weight are equal to 1. For such rational cubic Bézier curve, it is easy to derive the other two weights according to the given G 2 Hermite data under the condition that its control polygon is determined (Farin, 1996; Goodman, 1988). However, they do not describe how to select the Bézier polygons to meet the conic precision property. We also use the rational cubic Bézier curve with standard form. The difference between our method and those of Farin (1996), Goodman (1988) lies in how to construct the control polygon. We derive the control points according to two conic Bézier curves, both matching the G 1 Hermite data and one end curvature of the given G 2 Hermite data. The conic precision property is based on the fact that the two conic Bézier curves are the same conic which the given G 2 Hermite data sampled from. We give the explicit form for both the control points and the weights of the interpolating rational cubic Bézier curve. This paper has been recommended for acceptance by B. Jüttler. * Corresponding author. E-mail addresses: [email protected] (Y. Li), [email protected] (C. Deng), [email protected] (W. Ma). http://dx.doi.org/10.1016/j.cagd.2014.03.002 0167-8396/© 2014 Elsevier B.V. All rights reserved.

Upload: weiyin

Post on 25-Dec-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: C-shaped Hermite interpolation by rational cubic Bézier curve with conic precision

Computer Aided Geometric Design 31 (2014) 258–264

Contents lists available at ScienceDirect

Computer Aided Geometric Design

www.elsevier.com/locate/cagd

C-shaped G2 Hermite interpolation by rational cubic Béziercurve with conic precision ✩

Yajuan Li a,∗, Chongyang Deng a, Weiyin Ma b

a School of Science, Hangzhou Dianzi University, Hangzhou 310018, Chinab Department of Mechanical and Biomedical Engineering, City University of Hong Kong, Kowloon, Hong Kong, China

a r t i c l e i n f o a b s t r a c t

Article history:Received 26 November 2012Received in revised form 13 February 2014Accepted 28 March 2014Available online 8 April 2014

Keywords:Rational conic Bézier curveRational cubic Bézier curveG2 Hermite interpolationConic precision

We present a simple method for C-shaped G2 Hermite interpolation by a rational cubicBézier curve with conic precision. For the interpolating rational cubic Bézier curve, wederive its control points according to two conic Bézier curves, both matching the G1

Hermite data and one end curvature of the given G2 Hermite data, and the weights areobtained by the two given end curvatures. The conic precision property is based on thefact that the two conic Bézier curves are the same when the given G2 Hermite data aresampled from a conic. Both the control points and weights of the resulting rational cubicBézier curve are expressed in explicit form.

© 2014 Elsevier B.V. All rights reserved.

1. Introduction

It’s well known that (rational) Bézier curves (Farin, 1996) are widely used in Computer Aided Geometric Design (CAGD).Especially, G2 Hermite interpolation, interpolating points as well as their tangent vectors and curvatures, by rational cubicBézier curves have been extensively studied in the literature (Farin, 1996; de Boor et al., 1987; Goodman, 1988; Degen, 1993;Sakai, 2001; Chen et al., 2002; Walton and Meek, 2011; Li and Deng, 2012).

Recently, methods on interpolating G1 (Farin, 2008; Femiani et al., 2012) or G2 (Walton and Meek, 2011; Li and Deng,2012) Hermite data by rational cubic Bézier curve with circular arc precision property have been proposed. However, to ourbest knowledge, there are no methods on G2 Hermite interpolation by rational cubic Bézier curves with conic precision. Inconsideration of the important applications of conics in CAGD, we propose such a method in this paper.

Applying the reparametrization method, rational Bézier curve can be transformed to standard form: both the first andthe last weight are equal to 1. For such rational cubic Bézier curve, it is easy to derive the other two weights accordingto the given G2 Hermite data under the condition that its control polygon is determined (Farin, 1996; Goodman, 1988).However, they do not describe how to select the Bézier polygons to meet the conic precision property. We also use therational cubic Bézier curve with standard form. The difference between our method and those of Farin (1996), Goodman(1988) lies in how to construct the control polygon. We derive the control points according to two conic Bézier curves, bothmatching the G1 Hermite data and one end curvature of the given G2 Hermite data. The conic precision property is basedon the fact that the two conic Bézier curves are the same conic which the given G2 Hermite data sampled from. We givethe explicit form for both the control points and the weights of the interpolating rational cubic Bézier curve.

✩ This paper has been recommended for acceptance by B. Jüttler.

* Corresponding author.E-mail addresses: [email protected] (Y. Li), [email protected] (C. Deng), [email protected] (W. Ma).

http://dx.doi.org/10.1016/j.cagd.2014.03.0020167-8396/© 2014 Elsevier B.V. All rights reserved.

Page 2: C-shaped Hermite interpolation by rational cubic Bézier curve with conic precision

Y. Li et al. / Computer Aided Geometric Design 31 (2014) 258–264 259

The rest of this paper is organized as follows. The definitions of rational conic and cubic Bézier curves and their relationsare given in Section 2. Then in Section 3, G2 Hermite data interpolation by rational cubic Bézier curve and its conic precisionproperty are proposed. Examples and remarks are presented in Section 4. Section 5 is devoted to conclusions.

2. Preliminaries

A rational conic Bézier curve with weights 1, w > 0, 1 and control points qi (i = 0,1,2) is defined as (Piegl and Tiller,1997):

r(t) = (1 − t)2q0 + 2(1 − t)t wq1 + t2q2

(1 − t)2 + 2(1 − t)t w + t2, 0 � t � 1. (1)

If the weight is extended within the interval −1 < w < 0, the rational conic Bézier curve (1) is an ellipse arc, while ifw = −1 or w < −1, it’s a parabolic curve or a hyperbolic curve with singular points.

The two end curvatures of rational conic Bézier curve are

κ(0) = ‖(q1 − q0) × (q2 − q1)‖2w2‖q1 − q0‖3

, κ(1) = ‖(q2 − q1) × (q1 − q0)‖2w2‖q2 − q1‖3

. (2)

A rational cubic Bézier curve is defined by weights w1, w2 > 0 and control points bi (i = 0,1,2,3) (Piegl and Tiller,1997) as

r(t) = (1 − t)3b0 + 3(1 − t)2t w1b1 + 3(1 − t)t2 w2b2 + t3b3

(1 − t)3 + 3(1 − t)2t w1 + 3(1 − t)t2 w2 + t3, 0 � t � 1. (3)

Its two end curvatures are

κ(0) = 2w2‖(b1 − b0) × (b2 − b1)‖3w2

1‖b1 − b0‖3, κ(1) = 2w1‖(b3 − b2) × (b2 − b1)‖

3w22‖b3 − b2‖3

. (4)

Rational conic Bézier curve (1) can be exactly represented by rational cubic Bézier curve (3) with weights w1 = w2 =(1 + 2w)/3 and control points

b0 = q0, b1 = q0 + 2wq1

1 + 2w, b2 = q2 + 2wq1

1 + 2w, b3 = q2.

If w = − 12 , then w1 = w2 = 0, which means b1, b2 are points of infinity. In general, a rational cubic curve cannot be

exactly represented by a conic, but we have

Lemma 1. If w1, w2 > 0, the rational cubic curve (3) is a conic arc if and only if (Wang and Wang, 1992):

1. b0b1b2b3 is a planar convex quadrilateral and any three points cannot be on the same line;

2.w2

1w2

= S21

3S0 S2,

w22

w1= S2

23S1 S3

;

where S0, S1, S2, S3 are directed areas of the triangles �b1b2b3 , �b0b2b3 , �b0b1b3 and �b0b1b2 , respectively.

3. C-shaped G2 Hermite interpolation

Given G2 Hermite data {b0,T0, κ0;b3,T1, κ1}, without loss of generality, we assume that the middle point of line segmentb0b3 be the origin O, and b0b3 be the positive direction of x-axis, ‖b3 − b0‖ = L. Let α be the angle from b0b3 to T0 andβ be the angle from T1 to b0b3, then C-shaped G2 Hermite data means 0 < α,β < π (see Fig. 1). The control points of therational Bézier cubic curve matching {b0,T0;b3,T1} are:

b0 = (−L/2,0), b3 = (L/2,0),

b1 = b0 + u(cosα, sinα), b2 = b3 + v(− cosβ, sinβ), (5)

where u = ‖b0b1‖, v = ‖b2b3‖.In the following we describe the interpolating method by classifying two cases, i.e., α+β �= π (Section 3.1) and α+β = π

(Section 3.2).

Page 3: C-shaped Hermite interpolation by rational cubic Bézier curve with conic precision

260 Y. Li et al. / Computer Aided Geometric Design 31 (2014) 258–264

Fig. 1. C-shaped G2 Hermite data.

Fig. 2. Intersection point b of b0T0 and b3T1. (a) 0 < α + β < π , (b) π < α + β < 2π .

3.1. Cases when α + β �= π

Let b be the intersection point of radial lines b0T0,b3T1 (see Fig. 2):

b = b3 + L sinα

sin(α + β)(− cos β, sin β). (6)

With control points b0, b, b3 and a free weight w , the rational conic Bézier curve r(t) interpolates G1 Hermite data{b0,T0;b3,T1}. In general, it is impossible to find a weight w matching κ0 at b0 and κ1 at b3 simultaneously, but it ispossible to have a weight w L matching κ0 at b0 and another weight w R matching κ1 at b3. According to Eq. (2), we have

w L =√

sinα

2Lκ0

sin(α + β)

sinβ, w R =

√sin β

2Lκ1

sin(α + β)

sinα. (7)

Now with control points b0, b, b3 and weights w L , w R , two rational conic curves rL(t), rR(t) are constructed. Both oftwo conics interpolate G1 Hermite data {b0,T0;b3,T1}, and the curvatures of rL(t) at b0, rR(t) at b3 are κ0, κ1, respectively.Note that w L, w R > 0 for 0 < α + β < π , while w L, w R < 0 for π < α + β < 2π .

To guarantee that the weights are positive after degree elevation of these two conics, w L , w R should be greater than− 1

2 . If w S �− 12 , we define

w S = − X

2X + 2> −1

2, S = {L, R}, (8)

where

X = min

{‖b0 − b3‖‖b0 − b‖ ,

‖b0 − b3‖‖b3 − b‖ ,1

}.

We know

‖b0 − b1‖ =∥∥∥∥b0 − b0 + 2w Lb

1 + 2w L

∥∥∥∥ =(

1

1 + 2w L− 1

)‖b0 − b‖

�(

1

1 − 2‖b0−b3‖‖b0−b‖

2‖b0−b3‖‖b0−b‖ +2

− 1

)‖b0 − b‖ = ‖b0 − b3‖,

and similarly we have ‖b3 − b2‖ � ‖b0 − b3‖, thus edges ‖b0 − b1‖, ‖b3 − b2‖ are shorter than ‖b0 − b3‖. It means thatedges ‖b0 − b1‖, ‖b3 − b2‖ are bounded by ‖b0 − b3‖.

Page 4: C-shaped Hermite interpolation by rational cubic Bézier curve with conic precision

Y. Li et al. / Computer Aided Geometric Design 31 (2014) 258–264 261

Fig. 3. Two rational conic Bézier curves and the interpolating rational cubic Bézier curve. (a) 0 < α + β < π , (b) π < α + β < 2π .

Elevating the degree of rL(t) and rR(t) to three, we get two rational cubic Bézier curves, rL(t) and rR(t) with controlpoints (see Fig. 3)

b0, bL1 = b0 + 2w Lb

1 + 2w L, bL

2 = b3 + 2w Lb

1 + 2w L, b3, (9)

b0, bR1 = b0 + 2w R b

1 + 2w R, bR

2 = b3 + 2w R b

1 + 2w R, b3. (10)

The control points of the interpolating rational cubic Bézier curve r(t) are then defined by (see Fig. 3)

b0, b1 = bL1 + bR

1

2, b2 = bL

2 + bR2

2, b3.

Adopting the method of Farin (1996) (p. 234), by Eq. (4) and interpolating condition, we finally get the weights

w1 = 2

33

√C1C2

0

κ1κ20

, w2 = 2

33

√C0C2

1

κ0κ21

, (11)

where

C0 = ‖(b1 − b0) × (b2 − b1)‖‖b1 − b0‖3

, C1 = ‖(b3 − b2) × (b2 − b1)‖‖b3 − b2‖3

. (12)

3.2. The case when α + β = π

There is no intersection point of radial lines b0T0,b3T1 in this case, and so we construct the interpolating cubic curvedirectly.

By Eq. (4) and the interpolation condition we have

κ0 = 2Lw2 sinα

3w21u2

, κ1 = 2Lw1 sinα

3w22 v2

.

If the G2 Hermite data come from an ellipse, then κ0 = κ1, the reduction conditions of Lemma 1 require

w21

w2= v

3u,

w22

w1= u

3v⇒ w1 w2 = 1

9.

Thus the simple selection

w1 = w2 = 1

3, u =

√2L sinα

κ0, v =

√2L sinα

κ1, (13)

satisfies the condition of interpolation and reduction condition of conic and makes the root ratio of two end curvaturesequals to that of edges length u, v .

Summarizing the methods of Sections 3.1 and 3.2, we present Algorithm 1 and finally prove the conic precision propertyof the interpolation method.

Theorem 1. If the input G2 Hermite data is sampled from a rational conic Bézier curve c(t) with weight wc > − 12 , wc �= 0 and control

points c0 , c1 , c2 , the interpolating rational cubic Bézier curve is an arc segment of c(t).

Page 5: C-shaped Hermite interpolation by rational cubic Bézier curve with conic precision

262 Y. Li et al. / Computer Aided Geometric Design 31 (2014) 258–264

Algorithm 1 G2 Hermite data interpolation by rational cubic Bézier curve.Input:

C-shaped G2 Hermite data {b0,T0, κ0;b3,T1, κ1}.Output:

Rational cubic Bézier curve (3) with control points b0, b1, b2, b3 and weights 1, w1, w2, 1.If T0 ∦ T1

Step 1. Compute b by Eq. (6);Step 2. Compute w L , w R by Eqs. (7), (8);

Step 3. Compute b1 = bL1+bR

12 and b2 = bL

2+bR2

2 by Eqs. (9), (10);Step 4. Compute C0, C1 and w1, w2 by Eqs. (12), (11);

elseStep 5. Compute u, v , w1, w2 by Eq. (13);Step 6. Compute b1, b2 by substituting u, v, β = π − α into Eq. (5).

Fig. 4. Conics reproduction. (1) An ellipse curve; (2) A parabolic curve; (3) A hyperbolic curve; (4) A circular curve; (5) An ellipse curve with the controlpolygon forming a parallelogram.

Proof. By the method of Section 3.2, the theorem holds for α + β = π .If α + β �= π , by (2) we have

κ1

κ0= ‖c1 − c0‖3

‖c2 − c1‖3.

Then by (7) we have

w L

w R=

√κ1 sin3 α

κ0 sin3 β= 1.

Thus rL(t) = rR(t) and finally the interpolating rational cubic Bézier curve r(t) is an arc segment of c(t). �4. Examples and further remarks

When w L = w R � −0.5, we simply allow that the weights are not positive after degree elevation of two conics. Inthis way, our method can reproduce all conic Bézier curves, including those having singularities. Fig. 4 illustrates somecomplementary conic curves reproduced by our method.

If the data comes from an ellipse, we get the whole ellipse in two complementary pieces, while if the data come from ahyperbolic curve or a parabolic curve, we also get the ‘whole’ curve in two complementary pieces with at least one of thecomplementary pieces having singularities.

Page 6: C-shaped Hermite interpolation by rational cubic Bézier curve with conic precision

Y. Li et al. / Computer Aided Geometric Design 31 (2014) 258–264 263

Fig. 5. Circular arc reproduction. (For interpretation of the references to color in this figure, the reader is referred to the web version of this article.)

Fig. 6. Examples for {α,β,κ0, κ1} = (1) { π5 , 3π

5 ,2,3}; (2) { 2π5 , 3π

5 ,8,5}; (3) { π5 , 2π

5 , 15 ,3}. (For interpretation of the references to color in this figure, the

reader is referred to the web version of this article.)

We also present some examples in Figs. 5–7 to compare our method (work for 0 < α, β < π , α + β < 2π ) with thoseof Walton and Meek (2011) (work for 0 < α, β < 2

3 π , α + β < 43 π ) and Li and Deng (2012) (work for 0 < α, β < π ,

α + β < 43 π ). Fig. 7 shows an example indicating that only our method works.

Without loss of generality, let b0 = (−1,0), b3 = (1,0) in all examples. Interpolating curves and control polygons pro-duced by Walton and Meek (2011) (‘WM2011’), Li and Deng (2012) (‘LD2012’) and our method (‘LDM’) are displayed ingreen, red and black lines, respectively. Curvature plots are provided in Figs. 6 and 7. Figs. 6 and 7 show that the inter-polating curves of our method always gives better or similar curvature distribution compared with those of ‘WM2011’ and‘LD2012’. Some statistics data is summarized in Table 1 (M is the number of curvature extreme, and ε is the difference ofthe maximum and minimum curvature) to make this fact clearer.

When the input G2 Hermite data is sampled from a circle, Fig. 5 shows that all these methods produce the same curveand control polygon. Both of ‘LDM’ and ‘LD2012’ allow circular arcs with a span up to (not equal to) 4

3 π , i.e. the largestpossible span for a circular arc represented by a rational cubic Bézier curve (Piegl and Tiller, 1997).

5. Conclusions

We have shown how to construct a rational cubic Bézier curve which interpolates a C-shaped G2 Hermite data withconic precision, a property not reported before. The idea is natural in that its control points are constructed based on twoconic Bézier curves, which turn to be the same curve when the G2 Hermite data come from a conic and thus the algorithmis simple. Both the weights and control points are expressed in explicit form. The two tangential angles implied by theG2 Hermite data can range from 0 to π , and the sum of them is no more than 2π , which is more general than previousmethods.

Acknowledgement

This work is supported by NSFC (61003194, 61370166, 61379072), Natural Science Foundation of Zhejiang Province(LY12A01004), Research Grants Council of Hong Kong SAR (CityU 118512) and the Open Project Program of the State KeyLab of CAD&CG (Grant No. A1304), Zhejiang University.

Page 7: C-shaped Hermite interpolation by rational cubic Bézier curve with conic precision

264 Y. Li et al. / Computer Aided Geometric Design 31 (2014) 258–264

Fig. 7. Examples for {α,β,κ0, κ1} = (1) { 4π5 , π

2 ,2,3}; (2) { 9π10 , 3π

5 ,1, 310 }. (For interpretation of the references to color in this figure, the reader is referred

to the web version of this article.)

Table 1The number of curvature extreme and the difference of the maximum and minimum curvature.

Examples {α,β,κ0, κ1} {M, ε} (WM2011) {M, ε} (LD2012) {M, ε} (DLM)

Fig. 6(1) { 2π10 , 3π

5 ,2,3} {2,6.7286} {2,7.3231} {2,5.7654}Fig. 6(2) { 2π

5 , 3π5 ,8,5} {2,11.4054} {3,13.2765} {2,7.6546}

Fig. 6(3) { 1π5 , 4π

5 , 15 ,3} {2,2.8000} {0,2.8000} {0,2.8000}

Fig. 7(1) { 4π5 , π

2 ,2,3} — {3,6.0376} {2,4.2267}Fig. 7(2) { 9π

10 , 6π10 ,1, 3

10 } — — {3,13.4208}

References

Farin, G., 1996. Curves and Surfaces for Computer Aided Geometric Design. Academic Press, New York.de Boor, C., Höllig, K., Sabin, M., 1987. High accuracy geometric Hermite interpolation. Comput. Aided Geom. Des. 4, 269–278.Goodman, T.N.T., 1988. Shape Preserving Interpolation by Parametric Rational Cubic Splines. Int. Ser. Numer. Math., vol. 86. Birkhäuser Verlag, Basel,

pp. 149–158.Degen, W.L.F., 1993. High accurate rational approximation of parametric curves. Comput. Aided Geom. Des. 10, 293–313.Sakai, M., 2001. Osculatory interpolation. Comput. Aided Geom. Des. 18 (8), 739–750.Chen, J., Zhang, S., Bao, H., Peng, Q., 2002. G3 continuous curve modeling with rational cubic Bézier spline. Prog. Nat. Sci. 12 (3), 217–221.Farin, G., 2008. Geometric Hermite interpolation with circular precision. Comput. Aided Des. 40 (4), 476–479.Walton, D.J., Meek, D.S., 2011. G2 Hermite interpolation with circular precision. Comput. Aided Des. 42 (9), 749–758.Li, Y., Deng, C., 2012. C-shaped G2 Hermite interpolation with circular precision based on cubic PH curve interpolation. Comput. Aided Des. 44 (11),

1056–1061.Femiani, J.C., Chuang, C.Y., Razdan, A., 2012. Least eccentric ellipses for geometric Hermite interpolation. Comput. Aided Geom. Des. 29, 141–149.Piegl, L., Tiller, W., 1997. The NURBS Book, second ed.. Springer-Verlag, New York, NY.Wang, G., Wang, G., 1992. The rational cubic Bézier representation of conics. Comput. Aided Geom. Des. 9 (6), 447–455.