Patch Interpolation Using Edge-based Blending Function
Kenjiro T. Miura Department of Software, University of Aizu, Aizu-Wakamatsu, Fukushima 965-80, Japan
E-mail:
[email protected] Masashi Adachi
Department of Software, University of Aizu, Aizu-Wakamatsu, Fukushima 965-80, Japan
E-mail:
[email protected] Hiroaki Chiyokura
Faculty of Environmental Information, Keio University, 5322 Endo, Fujisawa, Kanagawa 252, Japan
E-mail:
[email protected]
ABSTRACT By introducing the edge-based blending function derived from the surface-based one, we can capture the eects of the edges on the shape of the n-sided patch more directly. Because of the good natures of the edge-based blending function, the designers can manipulate it as well as the geometry of the boundary curves to design and modify the patch shape. In this paper, we have discussed the derivation of the edge-based blending function, its properties, especially the dierences between ones for odd-sided and for even-sided patches, and easiness of designing it by the users. We have demonstrated its validty by showing several triangular, rectangular, and pentagonal patchs using the modi able blending functions. 1. Introduction
The need for the surface representation scheme to cover n-sided faces was pointed out during the rst half of 1980's by several pioneers, for example, Gregory , Sabin , and Hosaka and Kimura . Recent researches done by Loop and DeRose, Grim and Hughes have extended Bezier and B-spline ; surface schemes to include nonrectangular topology. Anodther type of research to interpolate arbitrary topological type surfaces was carried out by smoothly approximating an irregular control mesh . Most of the approches to model surfaces are based on the idea of control points. Manipulating positions of the control points, one can modify the surface shape according to his/her intensions. The policy behind the control points methodology is the mixture the geometrical elements and the blending functions. In Bezier surface scheme, the blending functions for the control points depend only on the number of the control points, i.e, order in one parameter direction and that of the other. In Bspline surface scheme, it depends on the orders and knot vectors of the surface. This makes the designers concentrate on a relatively simple work of positioning points to design complicated surfaces without considering how to de ne blending functions. 3
6
5
7
84
9
That is the main reason of using the control point. However, Blanc and Schlick showed the validity and versatility of manipulating the blending functions as well as the positions of the control points by using a simple parameter given to each control point. Their work suggests that it be very useful even for the end-user to design the blending function itself if we can supply a simple tool to do it. Charrot and Gregory developed a pentagonal surface patch which is a convex combination or blend of ve component interpolants: surface patches. Each of the interpolants match given boundary curves and cross boundary tangent vectors on two sides of a regular pentagon. They used a newly de ned blending function for each interpolant. Their interpolation scheme was based on the boundary curves and the cross boundary tangent vectors, but their blending function indicates the rate of the eects of each interpolant patch to the nal surface shape and it is very dicult for the designers to predict the eect of changing one of the boundary curves. Furthermore, because the blending function is de ned in 2 dimensional space of the pentagonal domain, it is practically impossible to change, or design in stronger sense, the blending function with a reasonably simple tool. Hence in this paper, by introducing blending functions for the edges of the n-sided patch(n 3) instead of those for the interpolant patches, we interpolate arbitorary topological type surfaces for given boundary curves. The blending function is practically modi able by simple parameters because it is virtually of one variable. In the following section, we review Charrot and Gregory's pentagonal patch in more detail and clarify problems of their blending function. Section 3 introduce a new edge-based blending function called blending function and discuss our interpolation method for odd-sided and even-sided patches. In section 4, we explain how to modify blending function. Several examples with variously modi ed blending function are shown to demonstrate the validity of our method. 1
2
2. The Pentagonal Patch Interpolation Using
Blending Function
Charrot and Gregory developed a method to interpolate a pentagonal domain using a new blending function. In this paper, we call it blending function to clearify dierence between it and our new blending function: blending function. In this section, we will review their method and address its problems on blending function. 2
2.1. The component interpolant
The component interpolants of the pentagonal patch can be described in terms of a parametric coordinate system (s; t) as follows. Let
F (s; t) = [x(s; t); y(s; t); z(s; t)]
(1)
be a given vector valued function. Then
P (s; t) = F (0; t) + F (s; 0) 0 F (0; 0)
(2)
de nes an interpolant which is such that
P (0; t) = F (0; t) and P (s; 0) = F (s; 0)
(3)
2.2. The pentagonal domain
We de ne a local coordinate system for the pentagonal domain. Let be a regular pentagon of height unity and with vertices Vi = (ui; vi), i = 0; . . . ; 4 in the (u; v) plane. As shown in Fig. 1(a), the patch will be represented in terms of the variables i, i = 0; . . . ; 4 which denote a perpendicular distances of the general point V = (u; v ) from the sides opposite the vertices Vi , i = 0; . . . ; 4. Each i becomes 0 on one side of the pentagonal domain and is greater than 0 otherwise. We de ne a local coordinate system (si; ti ) for the pentagon as follows: si =
i+2 ; i01 + i+2
ti =
i02 ; i+1 + i02
(4)
with the property that for V 2 we have that
0 si 1 and 0 ti 1:
(5)
Here, and else where in this paper, a sux i is interpreted as i mod 5 to make it inside the range 0 i 4 when we deal with the pentagonal domain and i mod n to make it inside the range 0 i n 0 1 when with the n-sided domain. Using this coordinate system, the points Ei0 and Ei on the boundary of the pentagon shown in Fig. 1(b) are expressed as 2
+2
Ei02 = (1 0 si )Vi + si Vi ; Ei+2 = (1 0 ti )Vi + ti Vi :
(6) (7)
Let the intersection point between the sides i = 0 and i = 0 be Ri. Then the radial line joining V and Ri goes through Ei. The detailed discussion about the local coordinate system mentioned above can be found in Charrot and Gregory . Other type of local coordinate systems for general n-sided domain was proposed by Loop and DeRose . Note that the shape of the interpolated patch depends on the used coordinate system. However, our interpolation method using blending function as well as one can be applied for any local +1
+1
2
7
v i-2
v i-2 v i-1
v i-1
v
λi
λ i+1
v i+2
v
Ei+2
v i+2 Ri+2
λ i-1
v i+1
vi Ei-2
λ i+2 λ i-2 vi
v i+1
(a) The pentagon
(b) The local coordinate system
Figure 1: The Pentagonal Domain coordinate systems. 2.3. The pentagonal patch
We review Charrot and Gregory's interpolation method of a pentagonal domain, especially for the C patch. Let F (V ) = [x(V ); y(V ); z(V )]; V 2 ; (8) denote a vector valued function de ned on the pentagon . We assume that F is de ned everywhere on the sides i, i = 0; . . . ; 4 of the pentagon . From Eq. (2), with the local coordinate system (si; ti), the vector valued function can de de ned as P i(V ) = F (Ei ) + F (Ei0 ) 0 F (Vi): (9) This function interpolates F on the sides i = 0 and i0 = 0 of the pentagon, that is P i(Ei ) = F (Ei ); P i(Ei0 ) = F (Ei0 ): (10) The pentagonal patch is de ned by the convex combination using blending function i (V ) 0
+2
2
+2
+2
+2
P (V ) = where
4 X
i=0
2
2
i (V )P i (V )
i (V ) = P4 i01 i i+1 : k=0 k01 k k+1
2
(11) (12)
Eq. (11) is a convex combination since the i, i = 0; . . . ; 4 are positive on and, by construction 4 X
i=0
Since
i (V ) = 1:
i (Ei ) = 0;
it follows that
i = j 0 1; j; j + 1;
P (Ej ) = F (Ej ); j = 0; . . . ; 4; that is, P interpolates F on the entire boundary of the pentagon.
(13) (14) (15)
2.4. Problems of blending function
Eq. (11) can be easily extended to a general case where the domain is not only pentagonal, but also n-sided if a certain local coordinate system is de ned there :
P (V ) = where
n0 1
X i=0
i (V )P i (V )
(16)
. . . i+n04 (17) i (V ) = Pn01i01 k=0 k01 . . . k+n04 with some variables i, i = 0; . . . ; n 0 1 that possess the following properties : i 0 and i (Ei ) = 0: (18) However, there are several problems of using blending function in Eq. (16). The worst one is that as shown in the de nition of the vector vlaued function P i(V ) expressed by Eq. (9), P i(V ) uses F (Ei+2) and F (Ei02). This means that F (Ei) is used by two dierent functions P i+2(V ) and P i02(V ). It makes unclear the eects of i(V ) on the shape of the interpolated patch. Especially to design or modify the shape by changing the values of i(V ) is a very dicult task because of its unclarity. The second problem is that blending function is de ned in 2 dimensional space of the n-sided domain and it is essentially not an easy task to change and design the
function of two variables. The third problem is that the degree and complexity might be unnecessarily high although the requirements for the function i(V ) are only three conditions as follows: 0 i(V ) 1; i = 0; . . . ; n 0 1; (19) n0 1
X i=0
i (V ) = 1;
i (Ej ) = 0;
(20) i = j 0 1; . . . ; j + n 0 4:
(21)
To overcome the problems mentioned above, we will introduce blending function derived from one. The formulation of blending function is simple, but it has much better properties than those of that clarify the eects of the blending function on the shape and make it possible for the designers to design the shape by changing the function values. Also it makes clear one of the essential dierences between even-sided and odd-sided patches. 3.
Blending Function
In this section, rst we will de ne blending function and address the requirements for it inherited from those for blending function expressed by Eqs. (19), (20), and (21). Then two interpolation cases: even-sided and odd-sided patches are treated separately. 3.1. De nition of blending function
As mentined in the previous section, even though the patch-formulation by Eq. (16) are based on the shapes of the boundary curves F i, i = 0; . . . ; n 0 1, the eect on the patch shape of each boudary curve is not clear enough. Therefore we introduce blending function to clarify the eect. Before we de ne it, we would like to point out a fact that the requirements for blending function expressed by Eq. (19), (20), and (21) lead to i (Ei0 ) + i (Ei0 ) = 1; i = 0; . . . ; n 0 1: (22) Considering the fact mentioned above, we de ne blending function as follows: i (V ) i (V ) + i (V ); i = 0; . . . ; n 0 1: (23) This formulation looks rather simple and it does not seem to have much better properties than those of blending function at the rst glance. However, for example, the requirements become simpler and more intuitive. The requirements for blending function are derived from Eqs. (19) and (20), 0 i(V ) 1; i = 0; . . . ; n 0 1; (24) P from Eq. (20), since each i(V ) appears twice in ni 0 i(V ), 2
+1
2
+1
n0 1
X i=0
i (V ) = 2
n0 1
X i=0
1 =0
i (V ) = 2:
The last one expressed by Eq. (21) is rewritten as three requirements: i (Ej ) = 0; i = j; . . . ; j + n 0 4; i (Ei0 ) = 1; i0 (Ei0 ) + i (Ei0 ) = 1: 2
1
2
+1
2
(25)
(26)
These three requirements imply that each i(V ) is equal to 1 on one of the boundary curve Ei0 and on its adjacent boundary curves Ei0 and Ei0 , the sum of i with i0 and with i are equal to 1, respectively. The patch formulation expressed by Eq. (16) is rewritten by using and blending functions as follows: 2
3
1
1
+1
P (V ) = =
n0 1
X
i=0 n0 1
X i=0
i (V )P i (V ) i (V )F (Ei02 ) 0
n0 1
X i=0
i (V )F (Vi ):
(27)
The above expression tells us two things. One is that each boundary curve aects the patch shape at the weight of its corresponding blending function. The other is that we still need the value of blending function to calculate P (V ). In order to get its value, we have to solve the following equations: i (V ) + i+1 (V ) = i (V );
i = 0; . . . ; n 0 1:
(28)
In matrix form, Eq. (28) becomes
M = where
21 66 0 66 0 M = 66 ... 66 40
1 1 0. .. 0 1 0
0 1 1. .. 0 0
0 0 1. .. 0 0
... ... ... ... ... ...
0 0 0. .. 1 0
(29)
2 3 2 3 03 66 77 66 77 0 777 7 6 0. 77 ; = 66 77 ; = 666 777 : 66 ... 77 66 ... 77 .. 77 7 64 7 64 1 75 n0 5 n0 5 1 n0 n0 0
0
1
1
2
2
2
2
1
1
(30)
The matrix M is not singular if n is an odd number. On the other hand, it is singular if n is even. In case where n is odd, since M is not singular, it is straightforward to calculate the value of blending function from that of blending function by solving Eq. (29). However, in the other case where n is even, we have to apply other method to determine the value of blending function. Because of this fact, in the following subsections, each case is discussed separately. 3.2. Odd-sided patch
As discussed above, when n is an odd number, it is possible to solve Eq. (29) to calculate the value of blending function. This means that we can de ne or design
blending function freely with the requirements expressed by Eqs. (24), (25), and
(26). The inverse matrix M 0 of M in Eq. (29) is given as 2 1 01 1 01 . . . 01 1 3 66 1 1 01 1 . . . 1 01 77 7 6 M 0 = 21 666 0...1 1... 1... 0...1 .. .. .. 0...1 1... 777 : 7 66 4 1 01 1 01 . . . 1 01 75 01 1 01 1 . . . 1 1 Hence i, i = 0; . . . ; n 0 1 are obtained as n 0 i0 X 1 X i = f (01)i j j + (01)i j j g; i = 0; . . . ; n 0 1: 2 j j i 1
1
1
1
+ +1
+
=
=0
Note that from Eqs. (19), (25), and (32), n 0 i0 n X X X 1 12 f (01)i j j + (01)i j j g + 21 i 2; i = 0; . . . ; n 0 1; j i j i 1
1
+ +1
+
=
=0
=0
i.e., for example, in case of i = 0, 1 + + . . . + n0 2: 0
2
(31)
(32)
(33) (34)
1
3.3. Even-sided patch
Before we deal with the general even-sided patch, we discuss the rectangular patch, i.e. the case where n is equal to 4. As a local coordinate system for the rectangular domain(unit square), we use the ordinary coordinate system (u; v) shown in Fig.2. Then, i, i = 0; . . . ; 3 can be given as = 1 0 u; = 1 0 v; = u; = v: (35) From Eq. (12), is given as 0
1
2
3
0
3 0 k=0 k01 k
0 = P3
(1 0 u) = v(1 0 u) + (1 0 uv)(1 0 v) + (1 0 v)u + uv = v(1 0 u):
(36)
Similarly, 1 = (1 0 u)(1 0 v );
2 = (1 0 v )u;
3 = uv:
(37)
λ 1 = 1-v v
λ2= u
λ 0 = 1-u λ3= v
u
Fig. 2. The Local Coordinate system (u; v).
Hence i, i = 0; . . . ; 3 are given as = + = v(1 0 u) + (1 0 u)(1 0 v ) = 1 0 u; = + = (1 0 u)(1 0 v ) + (1 0 v )u = 1 0 v; = + = (1 0 v)u + uv = u; = + = uv + v (1 0 u) = v:
(38) (39) (40) (41) (42) The above expressions suggest that blending function can be calculated by using blending function as follows: = ; = ; = ; = : (43) This is possible because the sum of two blending functions i0 and i is equal to 1, i.e. i + i = i0 i + i i (44) = ( i0 + i ) i (45) = i: (46) We extend the procedure discussed above to calculate blending function for the general even-sided domain. We add the following requirements on blending function such that 0
0
0
1
1
1
2
2
2
3
3
3
0
3
0
1
0
1
2
1
2
3
2
3
1
+1
1
+1
1
n 01
X
2
X
2
i=0
+1
2i = 0 + 2 + . . . + n02 = 1;
(47)
2i+1 = 1 + 3 + . . . + n01 = 1:
(48)
i=0
n 01
+1
Then blending function can be expressed as follows: 2i = 2i + 2i+1 = 2i(
n 01
X
2
j =0
2i+1 );
i = 0; . . . ;
n
2 0 1;
(49)
n 01
X
2
n
(50) 2 0 1: Several methods are applicable to determine blending function from Eqs. (49) and (50). One rational method is that since, for example, the edge corresponding to is located relatively far away from the edges corresponding to , ,. . . , and n0 , we assume that there is no interference among these blending functions, i.e. n (51) i j = 0; j = 0; . . . ; 0 1; j 6= i 0 1; i; 2 2i+1 = 2i+1 + 2(i+1) = 2i+1 (
j =0
2i );
i = 0; . . . ;
0
3
2
2 +1
2i+1 2j = 0;
j = 0; . . . ;
n
2 0 1; j 6= i; i + 1:
5
3
(52)
Then blending functions are given i = i0 i ; i = 0; . . . ; n: (53) Another possible method is that we de ne blending function as follows: n 2 X 1 (54) i = i0 i + i 2 j ;j6 i0 ;i j ; n 2 X 1 j (55) i = i i + i 2 j ;j 6 i0 ;i with an extra requirement such that 1
2
2
1
2
2
2 +1
=0 =
2 +1
2
2 +1
1
2 +1
2
=0 =
0 (
n
2 X
j =0;j 6=i01;i
n
2 X
2j +1 ) = 1 (
= ...
1
j =0;j6=i01;i
= n2 0 ( 1
2j )
n
2 X
j =0;j 6=i01;i
2j +1 ):
(56)
The above de nition of blending function is consistent to the original de nition of blending function expressed by Eq. (23). 4. Designing
Blending Function
In this section, we will show exmaples of triangular, rectangular, and pentagonal patches. In each case, the design method by changing the value of blending function is shown. 4.1. The rectangular patch
We deal with the rectangular patch as an example of even-sided patches. As discussed in subsection , i(u; v), i = 0; . . . ; 3 are (u; v ) = 1 0 u; (u; v ) = 1 0 v; ; (u; v ) = u; (u; v ) = v: (57) 0
1
2
3
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0.2
0.4
0.6
0.2
1
0.8
(a) The original function
0.4
0.6
0.8
1
(b) Changed blending functions
Figure 3: Designing blending function Each function is of two variables u and v, but it depends on only one variable and it can be described in a 2D graph as shown in Fig.3(a). This property of blending function gives designers enough easiness and freedom to manipulate the blending functions when the designers want to change the value of the blending functions instead of the shapes of the boundary curves of the patch. For example, Fig.4(a) shows the original rectangular patch using Eq. (57). By changing from u to (
0
1 0 ua 0 u a a