Generalized Bernstein-Bezier curves and surfaces C-H Lin This article presents a flexible curve and surface by using an arbitrary choice o f polynomial as the basis for blending functions. The curve and surface is a generalization o f most well k n o w n curves and surfaces. The conditions for various continuities o f the curve segments and surface patches at the c o m m o n boundaries are given to maintain a low order composite curve and surface.
computer-alded geometric design, curves, surfaces, continuity Because of the critical importance of computer-aided geometric design (CAGD) in the construction of objects, such as car bodies and airplane fuselages and wings, curves and surfaces have been studied widely since the early 1960s. First, Coons' and Ferguson 2 developed a mathematical system for curves and surfaces. Later, B6zier curves were developed independently by de Casteljau and B6zier a, based on the concept of Bernstein polynomials. B-spline curves, which are the proper generalization of B6zier curves, were popularized by Gordon and Riesenfeld 4. More recently Beta-splines were introduced into computer graphics by Barsky s . Each contributes certain advantages to CAGD. Goldman e'7 has used the linear combination of a collection of blending functions to define some new types of curves and surfaces. By using this method, he showed that the shape of a given curve B[P] (t), where P = (Po, ..., Pn), is an array of control points and B(t) = (Bo (t), ..., Bn (t)) is a collection of blending functions, can be altered by changing either the control points or the blending functions. In addition, given a curve B[P] (t) and a collection of blending functions D(t) = (D0(t), ..., Dn(t)) , Goldman found an array of control points Q = (Q0, ..., Qn) so that D[Q] (t) = B[P] (t). In this paper, a parametric curve and surface is defined by choosing the set of Bernstein polynomials as the collection of blending functions. This curve, a generalized BernsteinB~zier curve, is a generalization of that well known group of curves that includes the Ferguson curve, B~zier curve, B-spline curve, Beta-spline curve, Bali's rational cubic curve, and conics. In other words, these curves are special cases of the generalized Bernstein-B~zier curve. By explicitly finding the coefficients of the linear combination, these curves can be converted to the generalized BernsteinB6zier curve. Furthermore, as the derivatives of Bernstein polynomials are easy to compute, this is crucial for deriving the continuity conditions between adjacent curves and surfaces of this general type.
GENERALIZED BERNSTEIN-BEZIER AND SURFACE
CURVE
A generalized Bernstein-B~zier curve is given by n
P(u)=
n
Z (~ bdBn, l(U))V j j=0 /=0
0~
(1)
where Vo, Vx, ..., Vn are n + l 3D points of a characteristic polygon, blj E ~ , 0 ~ i,j <~ n, and Bn.i(u) are the classical Bernstein polynomials. A generalized Bernstein-B~zier surface is given by simple extension of the general equation of the generalized Bernstein-B~zier curve (1) i7
m
P(u,v) = Z
~,
j=0 h=0
n
( ~., bUBn, i(u) ) /=0
m
( ~, b£h Bm,~ (V)) Vjk ~=0
0
(2)
<1
where the V/k are vertices of the characteristic polyhedron that forms a (n+1) x (m+1) rectangular array of points and bij E 6~, 0 <~ i,j <<, (max (n, m} ). The coefficients blj give additional freedom to control the shape of the curve. For instance, given four control points Vo, V , , V2, Va, let boo = baa = 1; b n = b22 = 4/3, blo = b2a = -1/3, and bij = 0 otherwise. Then the generalized Bernstein-B6zier curve is tangent to the line segment V I V 2 . This offsets the defect of the B6zier curve being far away from the characteristic polygon. As the functions Bn/(U ) form a polynomial basis, {bij } are guaranteed to exist such that many well known curves can be converted to the generalized Bernstein-B~zier curve (1). Ferguson curve Let
Vo P(0) v, P(1) =
=
=
P'(0)
= P'(1)
boo = blo = b21 = b31 = I b12 = -b~a
School of Mathematics, University of Minnesota, 127 Vincent Hall, 206 Church Street S.E., Minneapolis, MN 55455, USA. Currently at Department of Mathematics, Fu Jan University, Taipei, Taiwan 24205
volume 20 number 5 june 1988
=
1/3
bol = be2 = boa = bax = bla = b2o = b22 = bao = ba~ = baa = 0
0010-4485/88/050259-04 $03.00 © 1988 Butterworth & Co (Publishers) Ltd
259
Uniformly shaped Beta-spline segment
Then equation (1) becomes a Ferguson curve.
Let Vj = Vi+/_ a
Bernstein-Bdzier curve
= 2/3 /8
Let
bo2 = 2/8
bo, = (/32 +4/3] +4/31)/6 0
i~/
bn = (2/33, +4/3 =, +2/3, +/32,)I6
Equation (1) thus becomes a Bernstein-Bdzier curve.
b;, = (2/33 +2/32',)16 b,, =
2/3 18
Bali's rational cubic curve
b12 = (2/31 + 2)/6
Let
ba,= = (2/3] + 4/3, +/32' + 2)/8 baa = 2/8
Vo = H1W1
ba; = (4/32'1 +4/3, +/32)/8
Vl = H;W2,
blo = b;o =
V 2 = HaW a
where
V3 = H4W4 boo = baa =
b;a
blo
=
bll
= b22 =
b3o = boa = bx3 = b2,3 = 0
I
8 =/32 +2/3~ +4/3] +4/31 + 2 # = 0
= I/3
Then equation (1) becomes a uniformly shaped Beta-spline
2/3
segment.
bol = bo2 = boa = b12 = bla = ba,o = b2,1 = b3o =hal
=ba2
CONTINUITY CONDITIONS CURVES AND SURFACES
=0
Then equation (1) is Bali's rational cubic curve.
Non-uniform B-spline curve Let Vj = V i + / - 3 1
boo = (to It; bll
1
1
)(to/t_,
1
2, 2 = t o/t_]
b31 = ( t ~ / t ; _ 1 )(ta'_,/tao 2
2,
0
1
1
2
1
1
hot = t o / t _ l + ( t _ l / t - l ) ( t o / t - 1 ) - ( t o / t - 1 ) ( t o / t - ; ) b31 =
1
1
(712 / t _ l ) ( t _ l;/ t o ) ;
OF ADJACENT
Appropriate conditions for the continuities of the curve segments and surface patches across the common boundaries are required. These conditions ensure that a loworder composite curve and surface, which is constructed by piecing together several low-order curve segments and surface patches, can avoid those problems generated from a high-order curve and surface. These problems include larger coefficients, whose physical meanings are difficult to understand, and numerical instabilities. Boehm s chose new control points along the control polygon to obtain a curvature continuous curve and surface. Here, by taking advantage of the simple formulas for derivatives of Bernstein polynomials, the continuity conditions between adjacent curves and surfaces of this general type can be derived. Let
bo; = ( t ° l / t l _ l ) ( t ° l / t a _ l ) hi2 = t°_l/t21 b22
Pk(u) =
= t1_l/t22_l 1
2
1
2
b33 = ( t o ~ t o ) ( t o ~ t o ) 2
2
b2'1 = tl/t_ 1 1
2
532 = t-1/t-1
;
2
1
+ (t,/to)(to/t_l)
2
1
2
1
3
- (to/to)(to/to)
blo = ba,o = b3o = boa = b13 = b22a = 0 U =
(t - ti)/(ti+ 1 - ti)
where
t#£ = tl+ h - ti+£
Then equation (1) becomes a non-uniform B-spline curve.
260
n n k Bn, i(u))Vj+ # Z ( ~; b E j=0 i=0
0~u%1
be the (k+])th generalized Bernstein-Bdzier segments for {V0, V l , ..., V~) with respect to {b~.:O<.i,j<~n,O%k<~ £ - n ) . At first, it is necessary to discuss the continuities of the joint point of Pk (u) and P#+ l(u). Segments Pk (u) and Pk+l(u) are said to be of positional continuity if P#+I(0) = Pk(1). Segments Pk(u) and Pk+l(u) are said to be of VC 1 continuity (visual C 1 continuity) if their unit tangent vectors are continuous. Segments Pk(u) and Pk+l(u) are said to be of VC 2 continuity (visual C 2 continuity) if both unit tangent and curvature vectors are continuous. Finally, segments P# (u) and P#+ 1 (u) are said to be of CN continuity, N/t- 1, if their first N derivatives are continuous. computer-aided design
m
As
( Z(-1 ~=0
£rn
/~
) ( £ )b(l*rn-~)J)B(/7-m)'l(U)]V]+l~
/7
/.h+ I
If b~ and ~,/j m
/=0 and
z
~=0 /7
_k+l
Pk+l(0) = 2;
j=O
boj V]+k+1
~=0
and =
(-1)~(r~) b k+l (m-£)n = 0
m
2; ( _ 1 ) £ ( m £=0
k bn(j+l)
0~
where m = 0, 1, ..., N, then Pk(U) and Pk+l(u) are CN continuous at the joint. Given two generalized Bernstein-B~zier surfaces /7
As
P(u,v)= n-1
/7
Pg(u) =
n (bf~+ ,)j - b§)B/7_,,~(.) ] vj+ k
2; [ 2;
j=o
/=o
segments Pk(u) and P/~+l(u)are VC 1 continuous at the joint if _/.#
+1
b~/7-1)0 -"1/7
k )~/bk+l (m_~)j-b(n_~)(j+t))=0
0 ~ < j ~
t"k + 1 b 7 0 =uon =0
•
(-1)~(~') ~/7_~)o = o
m
Z
it is easy to see that P# (u) and P#+ z (u) are continuous at the joint if
b~l
satisfy the following conditions
n
b U" B/7,i(.))
m
x ( 2; b~k" Bm,~(v)) Vjk ~=0
/7
and
m
Z ~, j=0 h=0
Z i=0
m
bk+l lj
=
k
-°cb(n-1)(j+l)
n
P~(u)=
/7-2
2; [ 2 ; j=0 i=o
n(n-1)(bl~i+=)j-2O~l+l)j
+b~" B(n_2),i(u)]
~=0
O<~J<~n-1
where a is a scalar constant. Furthermore, as
bij" B/7,i(x))
n
/77
/7
/71
~.
2;
j=0 k=0
bojb~kWj#
£=0,1,...,m
(5)
If equations (3) and (4) have coincident tangent planes at every point of their common boundary then
=0
Qx (O,v) = ~(v)Pu(1 ,v) + r/(v)Pv(1 ,v)
bk+ 1 = [(1 +e)2+/~/(n-1)] 2(j-1) - [2(a+c~2)+/3/(n-1)]
(4)
~-, ~ bn] b~l¢Vjk j=0 k=0
Vj+#
and k b/7.i
k bl~/7_l)j + el2 b(/7_=)j
(6)
with some functions ~ (v) > 0 and r/(v). If the degrees of Pu, Pv, and Qx are considered, ~ must be a positive constant and ~i must be linear in v. Let
1 <~j <~n-1
(v) = ~ > o
where/3 is a scalar constant. By mathematical induction on m and through a lengthy calculation, it can be shown that n
P')(u)=
O<~x,y<~l
it follows from the common boundary condition P(1,v) = Q(0,y), 0 ~
segments P#(u) and Pk+1(u) are VC 2 continuous at the joint if /7 b(kn_2)0 -~ 2h/~+l
(3)
/7
(
X ( 2; b£k" Bm,£(y))Wjk k (c~+1) bn(j+l)
0 ~< u, v <~ I
and
Q(x,y) =
=0
/77
2; 2; ( 2; j=0 h=0 /=0
n I
2; ---=-"
j=0
(n-m)!
n-m
[
z
i=0
volume :20 number 5 june 1988
and
~(v) = ~(1 - .) + 3'.
(7)
where c~, /3, 3' E ~{. The first and second order partial derivatives of P and Q at the common boundary are given by the following formu as, respectively
261
n
m
CONCLUSIONS
Pu(1,v): £~ ( E E n "~'b(n_~)jb2kVjk)Bm,~(v ) ~=0 /=0 k=O m- 1 n m Pv(l,v) = E ( E E ~=0 j=O k=O m n m
m'bnj'L~'b~/cVjk)Bm_L~{v)
Puu(l,v)= X ( E Z n(n-l).~2b(n_;)jb~#Vjk)Bm,~(v) ~=0
j=O k=O
m-1
Puv(1,v) = E ~=0 m-2
Pvv(l,v)= E
£=0 m
n
m
Qxx(O,v)= E 2=0
1
j=O k=O r/
m
E
Z m(m-1).bnj. A2b2kVjtc) Bm_2,2(v)
j=o k=O n
Ox(O,v) = Z 2=0
m
~, ~, n m ' ~ b(n_l)j. Alb~kVjk)Bm_l;2(v)
m
m E
j=0 k=o
n(n+l)-
A2boj'b2kWjk)
ACKNOWLEDGEMENTS This research was partly supported by the National Science Council of the Republic of China. The author thanks the referees for their valuable suggestions, which led to improvements in the article.
Z n'Alboj'bllkWjk) Bm,2(v) j=O k=O n E
The generalized Bernstein-B~zier curve and surface, which is a generalization of many well known curves and surfaces, is a flexible curve and surface representation. The curve and surface can provide users with more desirable designs when bij are chosen suitably. Conditions are given to ensure the appropriate continuities of the composite curves and surfaces at the common boundary.
Bm,~(v )
(8) REFERENCES
where A l b u = b ( / + l ) j - b U, A2b/j = b 1 (Albij), 0 <~ i <.n, 0 ~
m
E
E
:=o k=O m
= ~ E (c~n. A1b(n_1)j.b~k+bnj[fJ(m-~) j=O k=O X Alb~k+'Y~.'/~lb(~z_l)k]}V]k
(9)
~ = 0 , ] .... ,m
In particular, if a = 1 and ~ = 7 = 0, then equation (9) gives the usual C i condition. Kahmann 9 proved that two surface patches P(u,v) and Q(x,y) have continuous tangent and curvature at the common boundary if
Qxx(O,v) = a2 Puu(l ,v) + 2a [/3(I -v)+Tv] Puv(1,v) + [~(1 - . ) + 7vl ~ P..(],v) + 0 P . O , . )
+ [r (I -v)+ ov] Pv(l,v)
(10)
where 0, r, o E ~. Thus it follows from equations (8) and (10) that the conditions for continuous tangent and curvature at the common boundary are n
m
X X n ( n - I) • A2boy. bQkW/k j=Ok=O =
n
m
~
E, {A2b(n-2): " a 2 n ( n - l ) " b~k
j=O
2 Ferguson, J C 'Multivariable curve interpolation' ]. ACM Vol 2 No 2 (1964) pp 221-228 3 B~zier, P Numerical control, mathematics and applications John Wiley, New York (1972)
n" A1bo] "bfzkW]/¢
n
1 Coons, S A Surfaces for computer aided design Design Division, Mechanical Engineering Dept., MIT, Cambridge, Massachusetts (1964)
4 Gordon, W J and Riesenfeld, R F 'B-spline curves and surfaces' in Barnhill, R E and Riesenfeld, R F (eds) Computer-aided geometric design Academic Press, London, UK (1974) pp 9 5 - ] 2 6 Barsky, B A 'The Beta-spline: a local representation based on shape parameters and fundamental geometric measures' PhD dissertation Dept. of Computer Science, University of Utah, UT, USA (1981) Goldman, R N 'Markov chain and computer-aided geometric design: part I - problems and constraints' ACM Trans. Graph. Vol 3 No 3 (1984) pp 204-222 Goldman, R N 'Markov chain and computer-aided geometric design: part II - examples and subdivision matrices' ACM Trans. Graph. Vol 4 No I (1985) pp 12-40 Boehm, W 'Curvature continuous curves and surfaces' Comput.-A/ded Geometric Des. Vol 2 No 4 (]985) pp 3] 3-323 Kahmann, J 'Continuity of curvature between adjacent B6zier patches' in Barnhill, R E and Boehm, W (eds) Surfaces in CAGD North Holland, Amsterdam (1983) pp 65-75
k=O
+ Alb(n_l)j " [2o~fln(m-£) • Alb£k + 2 a T n £ . A1b(~_1)k + On" b~k]
+ 2~')' (m - ~) ~" ~2b(~_i)k + ,/,2~ (~_1). A20(Q_2)h +'r (m- £) • Alb~k +a£" A1b(~-1)k ] } Vik £=0,1,...,m
(11)
In particular, if a = I and ~ = 3' = 0 = r = o = 0, then equation (I I) gives the usual C 2 condition.
262
computer-aided design