Shape Analysis of Cubic Bézier Curves – Correspondence to Four Primitive Cubics
Total Page:16
File Type:pdf, Size:1020Kb
568 Shape Analysis of Cubic Bézier Curves – Correspondence to Four Primitive Cubics Takafumi Saito1, Midori Yamada2 and Norimasa Yoshida3 1,2Tokyo University of Agriculture and Technology, [email protected] 3Nihon University, [email protected] ABSTRACT In this paper, we show that any planar polynomial cubic Bézier curve can be described as an affine transformation of a part of four primitive cubics (x3 + x2 − 3y2 = 0, x3 − 3y2 = 0, x3 − x2 − 3y2 = 0, and x3 − y = 0), and propose an algorithm to derive the transformation matrix. For a given cubic Bézier curve, we derive the linear moving line that follows the curve, and find the double point D of the curve. If D is not a point at infinity, we derive the quadratic parallel moving line that follows the curve. By testing whether the quadratic moving line crosses D or not, we classify the curve into three cases (crunode, cusp,oracnode) which correspond to three primitive cubics. If D is a point at infinity, the curve is classified as fourth case (explicit cubic), which requires exceptional process. For each case, the affine transformation matrix between the primitive cubic and given Bézier curve can be derived. We confirm that the proposed algorithm never fails unless the cubic Bézier curve is degree reducible or consists of four collinear control points. Keywords: moving line, double point, crunode, cusp, acnode, inflection point 1. INTRODUCTION condition for polynomial (i.e. non-rational) cubic Bézier curves by experimental analysis [3]and For highly aesthetic curve design, it is important extended it to rational cubic Bézier [4]. Unfortunately, to control curvature properties. In addition to tan- these results are not intuitive. This is due to the com- gent and curvature continuities, a fair curve should plicated relationship between geometry of control have the property that its curvature varies mono- points and curvature variation of the curve. tonically [5]. As a higher level property, Harada et In our project, we plan to investigate the curva- al. analyzed many existing aesthetic curves in real ture variation properties for the whole set of planar objects, and found that the logarithmic curvature his- polynomial cubics instead of curve segments. Here, togram (or logarithmic curvature graph,LCG)ofsuch the whole set consists of limited number of primitive aesthetic curve tends to be linear [6]. Yoshida et al. cubics with affine transformation. By investigation of proposed an interactive method to control a curve each primitive cubic and its scaling and skewing, cur- segment with linear LCG [12]. Such kind of curves, vature properties of cubic curve segments can be called log-aesthetic curves, has potential to be uti- surveyed completely. In this paper, as the prepara- lized in future CAD system, especially in initial design tion of the project, we clarify the correspondence stage. For sophisticated CAD operations, however, between Bézier curves and the four primitive cubics: log-aesthetic curves are not suitable as in original x3 + x2 − 3y2 = 0, x3 − 3y2 = 0, x3 − x2 − 3y2 = 0, and form, and need to be approximated with conven- x3 − y = 0. First, we classify cubic Bézier curves into tional parametric curves [13]. Therefore, higher level four cases by checking the singularities. Then, we curvature analysis is required for parametric curves. show that the whole set of cubic Bézier curves is However, analysis of curvature variation of para- equivalent to the four primitive cubics and their affine metric curves is quite difficult. For example, as the transformation, which is our main contribution. simplest subject in such analysis, monotonic curva- ture condition of planar cubic Bézier curve has been 2. RELATED WORKS studied. Walton et al. proposed a selected family of cubic Bézier curves that guaranties monotonic curva- It is well-known that parametric curve segments may ture [10]. Dietz presented G1 Hermite interpolation have inflection points, loops and cusps. These are Computer-Aided Design & Applications, 11(5), 2014, 568–578, http://dx.doi.org/10.1080/16864360.2014.902690 c 2014 CAD Solutions, LLC, http://www.cadanda.com 569 usually undesirable features for curve design. Sev- 4. CLASSIFICATION OF CUBIC BÉZIER CURVES eral studies have been done to derive conditions of In this section, for given four control points P , P , P these features and/or classification of curves, espe- 0 1 2 and P on a plane, we show that the Bézier curve P(t): cially for cubic curve segments [7,9,11]. For example, 3 Stone et al. presented the geometric condition of 3 2 2 3 P(t) = (1 − t) P0 + 3(1 − t) tP1 + 3(1 − t)t P2 + t P3 Bézier control points whether inflection points or sin- (4.1) gularities exist in the curve segment [9]. On the other hand, we focus on whole cubic curves instead of can be described as an affine transformation of a part 3 2 2 3 2 curve segments, find singularities, classify them into of four primitive cubics (x + x − 3y = 0, x − 3y = 3 2 2 3 four categories, and show the correspondence to four 0, x − x − 3y = 0, and x − y = 0) shown in Fig. 1. primitive cubics. Here, any cubic Bézier curve is acceptable unless it Our research is also related to ideal basis of pla- is degenerate; i.e. if the curve satisfies the following nar curves. Sederberg et al. presented that a cubic conditions: Bézier curve is intersection of two moving lines that • are linear and quadratic, and a quartic Bézier curve is It is not degree reducible; • intersection of two quadratic moving lines (or linear All of its four control points are not collinear. one and cubic one in special case) [8]. Cox et al. gen- eralized this idea as the ideal basis of rational curves, Selection of these four primitive cubics will be dis- which is named μ-basis [2]. They showed that the ideal cussed in subsection 5.3. of any degree n planar rational curve can be gener- The outline of the algorithm is as follows. First, L ( ) ated by two polynomials that are degree n and n in we derive the linear moving line 0 t that follows 1 2 P( ) D t,wheren + n = n.Chenet al. proposed an efficient the Bézier curve t , and find the double point 1 2 D algorithm to compute a μ-basis of a rational curve [1]. of the curve. If is not a point at infinity, we derive L ( ) Our proposed method is an application of μ-basis, the quadratic parallel moving line 1 t that follows P( ) and we focus on polynomial cubic curves. For each the curve t . By testing whether the moving line L ( ) D curve, we find a specific μ-basis that enables to clarify 1 t crosses the double point or not, we classify the correspondence to the primitive cubics. the curve into three cases (crunode, cusp,oracn- ode). Each case corresponds to each primitive cubic (x3 + x2 − 3y2 = 0, x3 − 3y2 = 0, or x3 − x2 − 3y2 = 0). If D is a point at infinity, the curve is classified as 3. MOVING LINES fourth case (explicit cubic) and corresponds to the primitive cubic x3 − y = 0. In this case, we derive the In this paper, most part of the theory is based on mov- quadratic moving line L (t) that contains the inflec- ing line (family of lines on Bernstein basis) [8]. Here 2 tion point I of the curve. For each case, by using are some definitions and properties of point, line, the correspondence of three reference points (D or Bézier curve, and moving line in 2D homogeneous I, and two other characteristic points), from which coordinate. we obtain the affine transformation matrix M between the primitive cubic and given Bézier curve P(t). • Point: P = (XYW) = w (xy1). • Line: L = (abc) : aX + bY + cW = 0. 4.1. Double Point and Linear Moving Line • P L P · L = Point lies on line : 0. A moving line L(t) that goes through a fixed point K • L P P L = Line contains two points 0 and 1 : k and follows the curve P(t) can be obtained as, P0 × P1,wherek is a constant. L( ) = K × P( ) • Point P is the intersection of two lines L0 and t t . (4.2) L P = L × L 1 : k 0 1. n n This is generally a cubic moving line. However, if the • Bézier curve P (t) (degree n): P (t) = = B (t)Pi, i 0 i fixed point is on the curve, i.e. K = P(τ), the moving where Pi(0 ≤ i ≤ n) are control points, and line L(t) has a common factor and is substantially n( ) = n ( − )n−i i Bi t 1 t t . quadratic [8]: i n • L( ) L( ) = n( ) L 2 2 Moving line t (degree n): t i=0 Bi t i, L(t) = P(τ) × P(t) = (t − τ) (1 − τ) (1 − τ)τ τ where Li(0 ≤ i ≤ n) are control lines. ⎡ ⎤ Q × Q Q × Q Q × Q • Curve P(t) follows moving Line L(t) (or moving 0 1 0 2 0 3 × ⎣Q × Q Q × Q + Q × Q Q × Q ⎦ line L(t) follows curve P(t)), i.e. for all t,the 0 2 0 3 1 2 1 3 Q × Q Q × Q Q × Q point P(t) lies on the line L(t) : P(t) · L(t) = 0. 0 3 1 3 2 3 • Moving line L(t) follows two curves P (t) and ⎡ ⎤ 0 (1 − t)2 P (t) : k(t)L(t) = P (t) × P (t),wherek(t) is a 1 0 1 × ⎣(1 − t)t⎦ (4.3) scalar function of t.