Rational Be zier form of hodographs of rational Be ... - Semantic Scholar

Report 3 Downloads 19 Views
COMPUTER-AIDED DESIGN Computer-Aided Design 33 (2001) 321±330

www.elsevier.com/locate/cad

Rational BeÂzier form of hodographs of rational BeÂzier curves and surfaces D.-S. Kim a,*, T. Jang a, H. Shin b, J.Y. Park c a

Department of Industrial Engineering, Hanyang university, 17 Haengdang-Dong, Sungdong-Ku, Seoul, 133-791, South Korea b Technical Computing Center, Chrysler Corporation, Auburn Hills, MI, USA c Department of Industrial Engineering, Dongguk University, Seoul, South Korea Received 4 November 1999; received in revised form 19 May 2000; accepted 26 May 2000

Abstract Applications of rational BeÂzier curves or surfaces often require the computation of derivatives. Even though there are several algorithms or representations for the derivatives of rational BeÂzier curves or surfaces, their advantages and disadvantages have not been explicitly discussed from the viewpoint of computational requirements. This paper presents the representation of the hodographs of rational BeÂzier curves and surfaces in rational BeÂzier curves and surfaces with appropriate degrees. In addition, this paper presents the evaluation of the performances of different representations. q 2001 Elsevier Science Ltd. All rights reserved. Keywords: Derivative; Rational BeÂzier curve and surface; Hodograph

1. Introduction The computation of derivatives of a curve or surface is often necessary for various applications with a curve or surface such as a curve characterization, the computation of tangent, normal and visibility cones, blending, offsetting and rendering. [3,4]. Since some of these applications require frequent computations of derivatives, it is important to compute derivatives of a curve or surface ef®ciently. While the algorithms to compute the derivative of a nonrational curve or surface are well understood, their rational counterparts are not; even though there have been a number of efforts. Sederberg and Wang found that the numerator of the derivative of a rational BeÂzier curve of degree n can be represented as a BeÂzier curve of degree 2n 2 2: This is called a scaled hodograph (SH) [8]. Based on this work, Saito et al. presented improved results of the SH of rational BeÂzier curves and surfaces by manipulating the equations in a homogeneous coordinate system [6]. On the other hand, Floater expressed the derivative of a rational BeÂzier curve in terms of its control points and weights [2]. However, it has not been explicitly discussed which approach is preferable for the computation of information on the derivatives of rational BeÂzier curves or surfaces in different situations. This paper presents the closed form (CF) representation of hodographs for a rational BeÂzier curve and surface. This

representation expresses the derivative of rational BeÂzier curve or surface in another rational BeÂzier curve or surface. Even though it is not a surprising fact that this representation is possible, the explicit formula has never been provided and consequently the advantages of this representation over the others have not been discussed. In addition, this paper provides the evaluation of the performances of different representations of the derivatives of rational BeÂzier curves. Based on the results of experiments, this paper provides the guidelines to ®nd an appropriate approach for different situations. This paper is organized as follows: First, the previous approaches to the given problem will be reviewed. Then, after the main idea of the representation for the hodograph of a rational BeÂzier curve is presented, a similar observation will be provided for the case of a rational BeÂzier surface. Finally, experiments and analyses of the algorithms are presented. 2. Literature review A rational BeÂzier curve of degree n can be de®ned as follows. n X

R…t† ˆ

* Corresponding author. Tel.: 182-2-2290-0472; fax: 182-2-2292-0472. E-mail address: [email protected] (D.-S. Kim). 0010-4485/01/$ - see front matter q 2001 Elsevier Science Ltd. All rights reserved. PII: S 0010-448 5(00)00091-9

wi Pi Bni …t†

iˆ0 n X iˆ0

wi Bni …t†

ˆ

N…t† D…t†

…1†

322

D.-S. Kim et al. / Computer-Aided Design 33 (2001) 321±330

where Pi 's are control points and wi 's are corresponding weights. Consider the derivative of R…t†: The differentiation of Eq. (1) yields the following equation. R 0 …t† ˆ

N 0 …t†D…t† 2 N…t†D 0 …t† {D…t†}2

…2†

There have been several efforts to represent the derivative of a rational BeÂzier curve. In this section, these representations are reviewed. 2.1. Direct differentiation (DD) approach

{D…t†}2 R 0 …t† ˆ

2nX 22 iˆ0

An easiest way for the computation of R 0 …t† might be to bi=2c X

Si ˆ

a SH may be useful in the applications that require the directions of the derivative. However, a SH may not provide the exact magnitudes of derivatives because it ignores the denominator in Eq. (2). The equation of a SH is quoted here from Ref. [8] for the convenience of discussion. To compute the directions of derivatives, this approach requires the compuation of Si 's in advance as a preprocessing. Si B2n22 …t† i

…3†

where

…i 2 2j 1 1†

n j

jˆmax…0;i 2 n 1 1†

!

n

i2j11 ! 2n 2 2

! wi wi2j11 …Pi2j11 2 Pi † …4†

i evaluate N…t†; D…t†; N 0 …t† and D 0 …t† independently and substitute into Eq. (2). We call this method DD approach for short. As the derivative of a Bernstein polynomial is explicitly known, this approach requires no preprocessing. Furthermore, this approach may provide the value of R…t†; without much extra work, while R 0 …t† is computed since the values of N…t† and D…t† have been obtained. This property is useful in applications, such as rendering, requiring the points as well as the derivatives. 2.2. Power form (PF) approach For the rational BeÂzier curve of an arbitrary degree, Eq. (2) can be rearranged in a power basis form. To implement this representation, both denominator and numerator of R…t† are represented in a power basis and then R 0 …t† is represented in a power basis form by operations between polynomials in a power form which is similar to what is discussed in Ref. [5]. Even though this approach requires a little bit of preprocessing operations between polynomials, its overall computational performance outperforms others since the evaluation of a polynomial employing the Horner's rule is faster. The computational requirement of preprocessing stage, however, can be removed if this representation is hardcoded for a curve of ®xed degree. Also, note that a curve represented in a power form may face a numerical problem. 2.3. Scaled hodograph approach {D…t†}2 R 0 …t†; which is the numerator of R 0 …t† in Eq. (2), is called a SH and known to be a non-rational BeÂzier curve of degree 2n 2 2 [8]. The name re¯ects the fact that a SH provides the correct directions of derivatives of a rational BeÂzier curve. Furthermore, a SH can easily provide the bound of tangent directions using control points. Therefore,

2.4. Floater's tangent (FT) formula Floater rewrote Eq. (2) by the rearrangement of Bernstein polynomials as follows [2]. R 0 …t† ˆ

w0;n21 …t†w1;n21 …t† {R1;n21 …t† 2 R0;n21 …t†} w0;n …t†2

…5†

where wk;m …t† ˆ

m X

wk1i Bm i …t†

iˆ0 m X

Rk;m …t† ˆ

iˆ0

…6†

wk1i Pk1i Bm i …t†

m X iˆ0

wk1i Bm i …t†

…7†

The name of the representation re¯ects the fact that the curve R 0 …t† is tangential to the vector starting from R0;n21 …t† and ending at R1;n21 …t† at t [2]. Based on a similar concept, Sederberg proposed the ef®cient procedure to compute a point and a tangent of rational BeÂzier surface simultaneously without preprocessing [7]. In the experiments, which will be discussed later, Sederberg's procedure is adopted for the implementation of this method. Note that Eq. (5) may not easily provide information on the bound of tangent directions. 2.5. Floater's hodograph (FH) formula Floater also proposed a formula for R 0 …t† using a new rational polynomial set with respect to weights [2]. By introducing the polynomial set, he represented R 0 …t† in terms of

D.-S. Kim et al. / Computer-Aided Design 33 (2001) 321±330

where HPi corresponds to a Euclidean point …xi ; yi ; zi †: Then, the subtraction between HPi's are given as

vectors joining consecutive control points as follows: R 0 …t† ˆ

nX 21 iˆ0

…Pi11 2 Pi †li …t†

…8†

where

li …t† ˆ

i n X X 1 …k 2 j†Bnj …t†Bnk …t†wj wk …1 2 t†t{w0;n …t†}2 jˆ0 kˆi 1 1

…9† for i ˆ 0; 1; 2; ¼; n 2 1: This representation has a form similar to the hodograph of a BeÂzier curve. This formula also provides the bound of tangent directions. In this paper, li …t†'s are represented in a power form, as a preprocessing process, a prior to the evaluation of derivatives since the computation of li …t†'s for each R 0 …t† can be extremely expensive. As each li …t† includes …n 2 i† …i 1 1† loops, this preprocessing has at least O(n 3) for the degree of a curve. 3. Hodograph of rational BeÂzier curve Most of the representations of rational hodographs discussed in the above section may be directly used for the calculation of exact derivatives. However, there are situations that it is necessary to compute the bound of all tangent vectors of curve or surface (such as the computation of the tangent cone [4]) as well as exact derivatives. If the approaches, except SH and FH, in the above section are used for the computation of tangent cone, one needs to enumerate all tangent vectors on the curve or surface. While the SH approach can be used to compute the exact tangent cone, the norm of tangent vector computed by this approach is not necessarily correct. However, a CF hodograph, if it is exactly represented in another rational BeÂzier curve or surface, can yield the bound of the all tangent vectors as well as the exact tangent vector in a simple and fast operation [4]. In addition, the fact that this representation can be used to evaluate the exact derivative is an advantage over the SH approach. Furthermore, a CF equation of rational hodograph may facilitate the easy calculation of a higher order derivative by simply calling the same code repeatedly as many times as needed. One can easily verify that R 0 …t† in Eq. (2) is a rational curve of degree 2n [8]. Therefore, to represent R 0 …t† in a form of a rational BeÂzier curve, it is required that both denominator and numerator be represented in terms of a Bernstein basis. By introducing an operator in homogeneous coordinates, which was proposed in Ref. [6], the derivation can be done without much dif®culty. 3.1. Dir( ) operator

HP2 2 HP1 ˆ …X2 2 X1 ; Y2 2 Y1 ; Z2 2 Z1 ; W2 2 W1 †

…11†

Therefore, its counter part representation in Euclidean space is given as   X2 2 X1 Y2 2 Y1 Z2 2 Z1 ; ; …12† W2 2 W1 W2 2 W1 W2 2 W1 Saito et al. suggested the following operator between two homogeneous points [6]. Dir…HP1 ; HP2 † ; …W1 X2 2 W2 X1 ; W1 Y2 2 W2 Y1 ; W1 Z2 2 W2 Z1 †



X2 X1 Y2 Y Z Z 2 ; 2 1 ; 2 2 1 W2 W1 W2 W1 W2 W1

; W1 W2



; W1 W2 …x2 2 x1 ; y2 2 y1 ; z2 2 z1 †

…13†

Eq. (13) shows that Dir( ) is parallel to the difference between two Euclidean points. For the convenience of discussion, a few properties of Dir( ) are quoted from Ref. [6]. Dir…HP1 ; HP1 † ˆ 0

Dir…HP1 ; HP2 † ˆ 2Dir…HP2 ; HP1 †

Dir…kHP1 ; HP2 † ˆ Dir…HP1 ; kHP2 † ˆ k Dir…HP1 ; HP2 † Dir…HP1 1 HP2 ; HP3 † ˆ Dir…HP1 ; HP3 † 1 Dir…HP2 ; HP3 † Dir…HP1 ; HP2 1 HP3 † ˆ Dir…HP1 ; HP2 † 1 Dir…HP1 ; HP3 †: …14† 3.2. Hodograph of rational BeÂzier curve Let us now start with the manipulation of the denominator of R 0 …t† to represent in a Bernstein basis. As the denominator {D…t†}2 is a product of polynomials in a Bernstein basis, the following equation can be easily obtained as is discussed in Ref. [1]: {D…t†}2 ˆ

2n X iˆ0

ki B2n i …t†

…15†

where

ki ˆ

n X jˆ0

wi2j wj cn;n;i2j; j

n cn;m;i; j ˆ

!

m

; where i ˆ 0; 1; 2; ¼; 2n

…16†

!

j i !; n1m

where i ˆ 0; 1; 2; ¼; n j ˆ 0; 1; 2; ¼; m

i1j

Consider the following homogeneous point HPi ˆ …Xi ; Yi ; Zi ; Wi † ˆ …Wi xi ; Wi yi ; Wi zi ; Wi †

323

…10†

ˆ 0;

elsewhere

(17)

324

D.-S. Kim et al. / Computer-Aided Design 33 (2001) 321±330

for i ˆ 0; 1; 2; ¼; n: Rearrangement of Eq. (18) yields N 0 …t†D…t† 2 N…t†D 0 …t† 8 9 n