Computer Aided North-Holland
COMAID
Geometric
Design
521
10 (1993) 521-530
328
The convexity of parametric Bezier triangular patches of degree 2 * Jin-Jin Zheng Department of Mathematics, People’s Republic of China
University of Science and Technology of China (USTC),
Hefei, .4nhui 230026,
Received August 1992 Revised January 1993
Abstract Zeng, J.-J., The convexity Design 10 (1993) 521-530.
of parametric
BCzier triangular
patches
of degree
This paper discusses the convexity of parametric Bezier patches of degree sufficient condition for the convexity of the BCzier patches is presented. Keywords. Parametric tal form.
BCzier patches;
barycentric
coordinates;
2, Computer
2 over triangles.
twist vectors;
convexity;
Aided
Geometric
A necessary
the second
and
fundamen-
1. Introduction
In [Chang & Davis ‘841, it was proved that if the control net is convex then so is the corresponding nonparametric triangular BCzier patch. An improved sufficient condition for the convexity of the triangular patches was obtained by [Chang & Feng ‘841; the condition is also necessary for quadratic and cubic nonparametric triangular patches. The investigation of the convexity of parametric triangular patches is, however, in its infancy. Based upon edge vectors and twist vectors, some sufficient conditions for the convexity of parametric triangular patches were obtained by [Zhou ‘901. With the property that the sign of Gaussian curvature remains unchanged under affine transformations in mind, Cao and Hua [1991] showed a sufficient condition for the convexity of the parametric trangular Bezier patches of degree 2. In Section 4 of this paper, a sufficient and also necessary condition in terms of the coordinates of the vertices on the control net is given for the convexity of parametric triangular BCzier patch of degree 2. A simpler sufficient condition is also given. This sufficient condition is superior to that of Cao and Hua’s.
2. Notation In three-dimensional Euclidean space R3, we consider i(n + l)(n + 2) BCzier points Joining each IWO points of J;:+l,j,k, fi,j+l,k, J;:,j,k+i (i +i + k = n - I> by a line
(fr.j,k)i+j+k=n*
Correspondence too:J.-J. Zheng, Department of Mathematics, University of Science and Technology Hefei, Anhui 230026, People’s Republic of China. * This work was supported by NSF and SF of National Education Committee of China. 0167-8396/93/506.00
0 1993 - Elsevier
Science
Publishers
B.V. All rights
reserved
of China (USTCJ,
J. -3. Zheng / Parametric B&er patches
Fig. 1. Bizier
net and perpendicular
directions,
n = 2.
segment, a piecewise linear continuous $ace consisting of .* triangles is obtained. surface is called BCzier net, denoted by f, (see Fig. 1). We will use the following notation for a parametric patch.
f;z;‘=
Bn( ‘)
C
fi,j,kJcj,k(
The
(2.1)
p>
i+j+k=n
is called the parametric triangular patch associated with the BCzier net fn, where JTj,,(P) := (n!/i!j!k!)u’c’wk, and (u, U, w) are the barycentric coordinates of P with respect to T := ((cl, u, w>l u, L’, w a 0, u + u + w = I]. For more details readers are referred to [Boehm et al. ‘841. In [Chang & Davis ‘841, the following “partial shift operators” were introduced: Elfi.j,k
‘=.f+
1,j.k 9
E2fi.j,k
‘=fi.jc
l,k
E3fi.j,k
‘=fi.j,kc
1
(i+j+k=n-1).
Moreover, the following “twist operators” A,
:=
(E,
-E,)(E,
are introduced:
-&),
A,:=(E,-E,)(E2-El),
(2.2)
A,:=(E,-E,)(E,-E,). A, fi,j.k, Alfi.j.k~ (see Fig. 2).
A3&k
(i +j + k = n - 2) are called the twist vectors of the BCzier net f7,
Fig. 2. Twist vectors,
n = 2.
J.-J. Zhrny / Parametric B&r
523
patches
We also define: n,.,,k'=(E;-Ez)f,.,,~x(E,-E3)fi,j,k
which define perpendicular Fig. 1).
(2.3)
(i+j+k=n-l)?
directions relative to the triangles ilf,,
l,j,k, f,,,,
,,k, fi,,,k fI (see
3. Preliminaries A regular surface r(u, c) E C’(g), fundamental form of r(u, c) II:=L
du2+2Mdu
is positive semi-definite
P
c iw’,
r(u,
dp+Ndu2
(3.1)
or negative
semi-definite L = n . ru:, M = n * ruL., N = n . r,.:, [Su et al. ‘861. The conclusion is equivalent to the following Lemma 3.1. A regular surface r = r(u, c> E C*(9) n .r,2 n.r UL
K(u,c):=
is convex if and only if the second
c>
20
for all (CL,c) ~9,
where
n = ru
X rv,
is concex iff the matrix inequnlby
(GO)
holdsforaff
(u,u)E~,
where a matrix 2 0 (or G 0) means that the mutt-k is positice semi-definite semi-definite), [ Bamhill & Whelan ‘841.
(3.2) (or negatice
The definition (3.2) of convexity would generally guarantee that only locally. However, for a quadratic surface, the definition is equivalent to the commonly used one that all chords are on one side of any of its tangent planes, namely,
Remark.
n(u, c) .(r(ii,
E) - r ( LL,
30
c))
(~0)
holds for all (u, L;), (U, F) ~9. (3.3).
If ~(u, c) is a quadratic surface, then
ru2,
r,.? are all constant vectors. Hence, we have
rllc,
~(U,L?)-f(K,c)=(U-~)f,,(u,L’)+(~-~L’)~,(11,c) +;((U-Ii)2r,*+2(E-u)(F-c)r,,+(c-L.)~rLI).
(3.4)
It follows that n(u, L’)*(r(E,
U) -f(U,
E)) =i((“-U)‘“(Ll,
c).r,,2
+2(ti-u)(E-u)n(u, +(E-/J)‘n(u, Therefore,
L’).f,,, c).r,.z).
(3.3) holds if and only if definition (3.2) is satisfied.
0
Now let us consider the quadratic Bezier patches T(U, c) = B,(f;; w=l-u-u. By a simple well-known calculation we get
P), P = (u, c, w> E T,
~u~=2(~1+~3)f0.0.0~ rut = 2A3f0.0.0 7
( r,z = n(P)
(3.5)
+AAfO.O.,,T
VA2
=4(u(E, X(Wz
-~3)f1.0.0+L:(~, - Qf,.,,,
+
-Wf0.*,0+w(El L’(E,
-
G)f,xu,
--&)fO,O.J +
w(E2
-
E3)fo.o.J.
(3.6)
53-I
J.-J. Zheng
/ Parametric
Bkier
patches
To simplify the notation, we define
i
“1 := “1.0.0~
nz := no.l,o,
A;
(m
:=
il,fO~,~,
=
n3
:=
no.o.1~
(3.7)
1, 2, 3).
Hence, from (3.5) we have Tu’ = 2( 4; + 4;))
rrcL.= aa;,
TcZ=2(.$+40j).
(3.8)
By a simple calculation we obtain n(P) = 4( Wz, + L’rzz+ wn3 +~4~xAo,+cwA;x40,+wu4;~4~).
(3.9)
From the definition (3.2) of K(P), and by (3.81, (3.91, we have K(P) n,.(dy+dO,) =a
n,.Ao,
nZ(4;+40,)
n,*(40,+4aj)
112
u
.4”3
n1
ii
n,*(4(:+4!)
Q.40,
*dO,
n,.(4:+4;)
n,.4”,
+w t
n3
UC + uu
(
Lemma
.4”3
+
L’w
3.2 (Necessary
(.fi,j,k}l+j+k=*
n,*(40,+40,) UL:
uu + wu
condition).
I
I(
(3.10)
Z_ B&f*; P) 1s com’ex ocer T, then the Bkier points
satisfy
either
n;(4~+A~)
nm.4i
n,,,.At
n;(At+4:)
20
or ~0
(m=l,2,3).
(3.11)
Proof. If Bz(f;; P> is convex over T then the matrix K(P) is positive semi-definite or negative semi-definite for all P E T. Setting P = (u, L’, w> = (1, 0, 01, (0, 1, O), (0, 0, 1) in (3.101, respectively, we then get that the BCzier points {J;:,j,k)i+j+k=2 satisfy (3.11). 0 Counterexample
(A nonconcex
patch with a concex Bkzier net>. Consider the BCzier points
(see Fig. 3.): f
2.0,o
=
(07
09
1>9
fo.2.0
=
(1,
-1,
$)?
= (0,- 1,01, fl.0.l = (0,17(99 f,,I,0
fo.o.2
=
(2,
;,
t),
f0,l.l = (2,0,0).
The BCzier net f1 is convex, but the BCzier patch B,(f;; P) is not. To verify this claim, note that the Btzier net f; consists of four triangles, and that the Bezier net is always on one side of any of them. Hence, the Bezier net fZ is convex. By a simple calculation we know that dY=(2,0, n,=(2,0,0),
l),
dO,=(-l,l, n,=(-+,
i),
40,=(0,
1, l),
n,=(-+,
-;,
$), -l,l).
J.-J. Zheng / Paramerric Bkier patches
Fig. 3. A nonconvex
patch with a convex Bkier
net, n = 2.
Hence, we have that n,.(Ay+AO,)
n,.A:
i n1 .A;
is indefinite. By Lemma 3.2, the Bkzier patch BZ(fZ; P) is not convex.
4. The main results
(necessary
and suffkient
0
condition)
Let us first establish a necessary and sufficient condition for the convex of quadratic BCzier patch. To simplify notation we define d :=A: xA;.Ao,.
(4.1)
(4.2) K’(P)
:=$(P).
Then, from (3.10) we know
(4.4)
Inserting w = 1 - u - c into (4.4) we get K’(u, L.) =
a3 + u(a, - a,)+
c(az - a, + d) - dc2
c3 + u(cl - c,) + c(c2 - c,) + dw
where (u, C) E T’ := ((u, C) 1U, c > 0, u + u ,< 11.
c3 + u(c, - c,)+
c(c2 -c,)+
b,+u(b,-b,+d)+r(b,-b,)-du’
due
(4.5)
J.-J. Zheng / Parametric
526
Bkier
patches
Setting A(u, L.) :=a3 + u(a, -aJ B(u, c):=&+u(b,
+c(az-n,+d)
-b,+d)
+~‘(b~--b~)
-dc’,
(4.6a)
-du’,
(4.6b)
C(u,r):=c,+u(c,-c,)+c(c,-c3)+du,
(4.6~)
D(U, C) :=A(lc, U)B(U, c) - (C(u,
c))2.
(4.7)
Then from (4.5) we get K’(u,
A(tr,
c) =
c)
C(u,
0)
C-t-8)
B(u,L’) i . i C(u,L+) Now we give the main theorem of this paper
Theorem 4.1 (Necessary and sufficient condition). A regularity quadratic B&&t-patch Bz(fZ; P> is convex over T if nnd only if the Bkier points (J;:.j,k}i+jrk=2 sat@ 1.
D(s,O),
D(0, s), D(s,
l-s)>O,
foralfsE[O,
l].
(4.9)
2.
A(s,O),
A(O,s),
l-s)&O,
foralfsE[O,
13,
(4.10a)
A(s,
forallsE[O,I].
orA(s,O),A(O,s),A(s,l-s),
(4SOb)
Remark. Note that A(s, 0, A(0, s), As, 1 -s> are all quadratic polynomials, and that D(s, O), D(0, s), D(s, 1 -s> are all reduced to cubic polynomials. Hence, (4.9), (4.10) can be easily converted to conditions in terms of only the coordinates of the control points. The following lemma will show this, Lemma 4.2. Let f(s) = a3s3 + cyzs2 + a,s + LY@be a cubic polynomials Then
f(s) > 0
for all
[O, 11 if and onfy if
sE
1.
cU,ZO,
2.
s;P(O,l)
a3+tu2+“14”o>0, orf(si)>O,
i=l,2,
where -a)* + l/iY/“f - 3aiiY, Sl,
3cu,
s* := --
aI
2a, ’
y
a3 + 0,
(4.11) cr3 = 0, a2 + 0,
and if si is not real or si does not exist, we say si @ (0, 1).
Proof. df f
s>= fri + 2cYz.r+ 3ff,s2.
(4.12) ds The zeros of (4.12) are si, i = 1, 2. = 1yi = constant, so that If a3 = 0, a2 = 0 then s,, s2 do not exist. In this case, df(s)/ds f(s) attains its minimum at 0, 1. Therefore, we obtain that f(s) 3 0 for all s E 10, 11 if and only if l f(O), f(l) 3 0, and si E (0, 11, so that f(s) attains its minimum at 0, 1; or l f(O), fCl> B 0, and f(si) 3 0 (i = 1, 2). •I To prove Theorem 4.1, we introduce some Iemmas.
Lemma
4.3.
KI(LL, r*) =
A(u,
C(l1, 1.)
1’)
2
0,
i C(rr, 19)
for all
(K, r) E aT’,
implies K’(K,
1’)
2
for all (11, c) E T'.
0
Proof. We define F(u, c, x) :=A(~J, t.)x’+2C(rr,
L.)x+B(EI,
(4.13)
c)
where (u, L’)E T’, x E (-co, ~1. Suppose K’( u, c) =
C(u, L’) B(tc, L’)
L’) C(K, c) i A(u,
is positive semi-definite
for all (II, c) E 8T’. namely, D(u, I.) =&II,
A(u, L:) 2 0,
c)B(u,
for all (K, c) E 8T’, x E (--r,
L’) - fC(Ll, r))2 20
=).
Hence, we have F(u, t’, x) 2 0
(4.14)
for ail (II, .Y) E V’, x E ( --cc, 2).
By a simple calculation we obtain xFJL~, L’, x) +F,,(ti,
L‘, x) = (a, -aa,)x3+
(a,-n,
+d+ 312,-2c,)x
f (b, - b3 + d f 2c, - 2cJx Using Cardano’s If x *xi (i = Therefore, F(u, xE(--,=)and
+ b, - b,
(4.15)
formula, we can determine the zeros xi, x1, xi of (4.15). 1, 2, 3), we know that the gradient (FJu, L’?x), F,(ri, c, x)) has no zero. L’, x) attains its minimum on a7”. Hence, we have for all (14, 1’) E T’, xfxtrx2,x3 that
F(u, L’, x) 2
min F(u, c, s) 2 0. fu.cfeaP’
We can aho prove F(u, L’, x) GZZ 0, for all (24, c) E T’, x =.x1, x2, x5. In fact, for any fixed (~4, c) E T’, we set g(x)
XE (-=,
:= F(u, c, x),
(4.16)
r),
then g(x) 3 0 for ail x f xi, i = 1, 2, 3. Since g(x) is continuous obtain that g(x) 3 0 for all x E (- =:, 2). It fohows that F(u,c,x)>O
for all x E (- =, 21, we
foraIl(u,c)ET’,xE(--,=).
This is equivalent to saying that D(u, c) =A(u,
A( u, t*) & 0,
L‘)B( M, c) - (C(rl,
L+))’ 2 0,
for al! (u, E) E T’.
Then, Ki(u,
c) =
t’)
C(u, L.)
i C(u, r)
B(cc, L.)
A(u,
Similarly, we have the following lemma.
20
for all (u, c) ET’.
EI
J.-f. Zheng / Parametric Bkier patches
528
Lemma 4.4.
(
K’(u,
L’) =
K’(u,
L’) Q 0
implies
A(u,
L.)
C(u, r)
C(u,‘c)
< 0,
B(u, c) i
for all (u, L’) E U’,
for all (u, u) E T’.
Proof of Theorem 4.1. By Lemma 3.1, we know that B,(fl; P) is convex over T if and only if K(u, c> 2 0, for all (u, c) E T’; or K(u, L’) G 0, for all (u, P) E T’. Note K’(u, L’) = $K(u, u), and by Lemmas 4.3 and 4.4 we know that B,(f;; p) is convex over T if and only if K’(u, L!) 2 0, for ail (u, L’)E aT’; or K’(u, L’) < 0, for all (u, a) E aT’,
namely, Cl.
D(u, c) >O,
(u, U) EAT’.
C2.
A(u,
(u, c) E aT’;
u) > 0,
or
A(u, L.) ~0,
(u, u) EAT’
Cl and C2 are equivalent to the conditions of Theorem 4.1, which completes the proof of Theorem 4.1. q Next, we will give a simpler sufficient condition. Theorem 4.5 (Sufficient condition). A regular quadratic Bkier patch B&f;; if the Bkier points (A,j,k}i+j+k=Z satisfy
A~xAo,~Ao,>O,
n;(A(f+A0,)
n;A”3
i n,,, .A!
n,
.
(A; + A;)
P) is conuex ocer T
20
(m=l,2,3),
GO
(m=l,2,3).
or
A;xA0,.A0,<0,
n;(A’j+A0,)
n;A”3
n, .A!
n,
.
(A; + A;)
Proof. Note that the matrix
uu + UW UC uu + WLL 1 ( 111: is positive semi-definite for all P E T, from (3.10) we know that the conditions of Theorem 4.5 imply that eigher K(P) 2 0, for all P E T, or K(P) < 0, for all P E T, which means that B,(&; P> is convex over T. 0 Remark. A sufficient condition for a quadratic BCzier patch being convex is also given in [Cao & Hua ‘911. By simple calculation we know, if that condition is satisfied then the condition in Theorem 4.5 must be satisfied. Hence, Theorem 4.5 is superior to that of Cao and Hua’s. As a matter of fact, Theorem 4.5 can be used to justify Case 1 of the following Example, but Cao and Hua’s criterion fails to be valid.
The following Example shows that a nonconvex Btzier net may yield a convex BCzier patch; and the conditions of Theorem 4.5 are not necessary for a patch to be convex. Example.
see Fig. 4.
Consider the BCzier points f *,0,0 = (0, 0, 2),
f0,2,0 = (2, -t,
2)
f 1.1.0= (09 0, 0)7
fl.O., = (07 17 O),
f0,o.z = (19 1, -$)7 fO.l.1 = (19 0, 0)7
J.-J. Zheng / Parametric Btkier patches
Fig. 4. A convex patch with a nonconvex BCzier net. n = 2.
Since pomt f2,0,0 $ not on the same side of A f,_t,O, fo,,,t, then the BCzier net fz is not convex. One can easily verify that ni = (290, O), AY=(l,
-1,2),
n2 = (0, 2, t), A’:=&
1-t,2),
n3=
(4,
f,
ftVo,, as Point
f. .o.*, we know
‘),
A”3= (0, 0, -
f).
One can also verify that (4.17a)
(1.17b)
(4.17c)
(4.18) We know from (4.17bJ (4.17~) that (a) If 4 - 2& G t G 2\/2 + 4, then the matrices in (4.17b), (4.17~) are positive semi-definite. We also know from (4.18) that (b) A: x Ai. Ai 2 0, if and only if t > 2. Case 1. We suppose 2 G t d 26 + ;f,, then from (a) and (b), we know that f’ satisfies conditions of Theorem 4.5. Hence, B,(fz; P> is convex over T. This proves that a nonconvex Btzier net may yield a convex BCzier patch. Case2. Weset t=2-s,O
530
J.-J. Zheng / Parametric Bkier patches
Noting II + L‘+ LV= 1, we get
#(P)=(;; y+[_;;; +
-f::ii!
l=(c’/4-2L’)s
i c(1
-U)S/4
:;;;
yfj
c(l-u)s/4 1 + (1 - u)‘s/4
(4.19) I .
We can easily verify that the first three terms of (4.19) are positive semi-definite. the fourth term of (4.19) K,(P).
We define
det K,(P)=l+(f(l-u)‘+~E~-~L.)s
+(i(1 -cg2(fc2-
2c) - ;ilz;L.?( 1 - U)?)?
(4.20)
Noting 0 f(1 -.)‘(~,z--2c)
-2, - +J2(1 -U)2>
-+ - + > -1.
Hence, we have det K,(P)>1-2s-s’=2-(.~+1)~. Since 0 0, we obtained that K,(P) 3 0. Hence the matrix K(P) is positive semi-definite for all P E T. It follows that B,(fi; P) is convex over T. This proves that there is a convex BCzier patch for which the conditions of Theorem 4.5 are not satisfied.
Acknowledgement
The author would like to thank Professor Gengzhe Chang, Yuyu Feng. John A. Gregory, and the two referees for their valuable comments and suggestions. He would also like to thank Ms. Hong-Jun Zhou for her help in drawing the figures.
References Cao, Y. and Hua, X.J. (1991). The convexity of quadratic parametric triangular Bernstein-BCzier surfaces, Computer Aided Geometric Design 8, l-6. Chang, G.Z. and Davis, P.J. (1984). The convexity of Bernstein-polynomials over triangles. J. Approx. Theory 40, 1 l-28. Chang, G.Z. and Feng, Y.Y. (1984), An improved condition for the convexity of Bernstein-BCzier surfaces over triangles, Computer Aided Geometric Design 1, 279-283. Barnhill, R.E. and Whelan, T. (1984), A geometric interpretation of convexity conditions for surfaces, Computer Aided Geometric Design 1, 285-287. Boehm, W., Farin, G. and Kahmann, J. (1984). A survey of curve and surface methods in GAGD, Computer Aided Geometric Design 1, I-60. Farin, G. (19861, Triangular Bernstein-Bezier patches. Computer Aided Geometric Design 3. 83-127. Su, B.Q., Hua, X.J. and Xin, Y.L. (1986), Introduction to practical differential geometric (in Chinese), Shanghai Science and Technology Publishing House. Zhou. C.Z. (1990), On convexity of parametric BCzier triangular surfaces, Computer Aided Geometric Design 7, 459-463.