Optimal Parameterizations of Bézier Surfaces - Semantic Scholar

Report 1 Downloads 21 Views
Optimal Parameterizations of B´ ezier Surfaces Yi-Jun Yang1,2 , Jun-Hai Yong1 , Hui Zhang1 , Jean-Claude Paul1 , and Jiaguang Sun1,2 2

1 School of Software, Tsinghua University, Beijing, China Department of Computer Science and Tech., Tsinghua University, Beijing, China

Abstract. The presentation of B´ezier surfaces affects the results of rendering and tessellating applications greatly. To achieve optimal parameterization, we present two reparameterization algorithms using linear M¨ obius transformations and quadratic transformations, respectively. The quadratic reparameterization algorithm can produce more satisfying results than the M¨ obius reparameterization algorithm with degree elevation cost. Examples are given to show the performance of our algorithms for rendering and tessellating applications.

1

Introduction

In Computer Aided Geometric Design (CAGD), algorithms for rendering, intersecting and tessellating curves and surfaces are generally based on their parameterization rather than their intrinsic geometry. The quality of the parameterization influences the results of the applications greatly. Uniform speed on parameter lines-i.e., equal increments in the parameter defining equal increments in arc length) is identified as an important character of optimal parameterizations for many applications such as computer numerical control(CNC), texture mapping and tessellating. In the past 10 years, how to achieve uniform speed on the B´ezier curves has been extensively studied in many literatures such as [1,2,3,4,5,6,7,8,9,10,11]. Farouki [1] studied the optimal reparameterization of B´ezier curves. In [1], arclength parameterization is identified as the optimal parameterization of B´ezier curves. By minimizing an integral which measures the deviation from arc-length parameterization, the optimal representation is obtained by solving a quadratic equation . J¨ uttler [2] presented a simplified approach to Farouki’s result by using a back substitution in the integral. Costantini [3] obtained closer approximations to arc-length parameterization by applying composite reparameterizations to B´ezier curves. To the author’s knowledge, little attention has been paid to the B´ezier surface reparameterization. The representation of B´ezier surfaces influences the results of rendering and tessellating applications greatly. Given a B´ezier surface (see Figure 1 (a)), we map a chessboard texture image onto the surface. However the texture mapping result (see Figure 1 (c)) deviates from our expectation. There is much unwanted variation in the texture mapping result. Many surface tessellating algorithms [12,13,14] first triangulate the parameter domain of the G. Bebis et al. (Eds.): ISCV 2006, LNCS 4291, pp. 672–681, 2006. c Springer-Verlag Berlin Heidelberg 2006 

Optimal Parameterizations of B´ezier Surfaces

(a)

(b)

(d)

673

(c)

(e)

Fig. 1. Texture mapping and tessellating results of a B´ezier surface: (a) B´ezier surface and its polynomial parameterization; (b) texture image; (c) texture mapping result; (d) triangulation of the parameter domain; (e) tessellating result by mapping triangles in (d) to the surface

given surface (see Figure 1 (d)). Then the 2D triangles are mapped onto the surface to obtain the 3D triangles. Also the representation of B´ezier surfaces affects the final results greatly (see Figure 1 (e)). From our point of view, the lack of satisfying representation is the bottleneck for rendering and tessellating algorithms to achieve high quality results. In this paper, we identify the optimal reparameterizations of B´ezier surfaces within the realm of linear and quadratic reparameterizations. Uniform parameter line is an important character of optimal reparameterizations. To achieve uniform speed on parameter lines, linear M¨ obius transformation is first studied. However the M¨ obius reparameterizations can not change the shape of the parameter lines. What changes is the distribution of the parameter lines. To obtain more uniform parameter lines, a quadratic reparameterization algorithm is presented. First the M¨ obius transformations are applied to some definite parameter lines to yield uniform speed on the selected lines. By interpolating the M¨ obius transformation coefficients using a least square technique, we then get the quadratic reparameterization coefficients. The examples indicate that, in practice, the algorithm produces significantly more uniform parameter lines across the B´ezier surfaces. The main contribution of our work can be summarized as follows: – We show that linear M¨ obius transformations can not change the shape of the parameter lines. What changes is the distribution of the parameter lines. – We present a quadratic reparameterization algorithm to obtain more uniform parameter lines across the B´ezier surfaces.

674

Y.-J. Yang et al.

The paper is organized as follows. Section 2 describes how to obtain uniform speed on parameter lines using M¨ obius transformations. Section 3 shows how to use the quadratic reparameterization to achieve more uniform parameter lines for B´ezier surfaces. In Section 4, we conclude the paper.

2

M¨ obius Reparameterization

Given a B´ezier surface of the following form X(u, v) =

n m  

Bim (u)Bjn (v)Pi,j ,

u ∈ [0, 1], v ∈ [0, 1],

(1)

i=0 j=0

where the Pi,j are the control points, the Bim (u) and Bjn (v) are the Bernstein polynomials, we try to obtain uniform speed for finitely many parameter lines X(ui , v), for certain constant values of ui , and X(u, vj ), for certain constant values of vj . For these parameter lines, we take the uniform speed functional used in Farouki’s paper [1]. To start with, we just consider the four boundary curves and try to obtain uniform speed there. To obtain uniform speed on the four boundaries, the following integral function 1 J(α, β) = 0

1 + 0

∂X(u, 0) 2 || du + || ∂u

∂X(0, v) 2 || dv + || ∂v

1 || 0

1 || 0

∂X(u, 1) 2 || du ∂u

∂X(1, v) 2 || dv ∂v

(2)

is adopted. The integral measures the deviation of the four boundaries from the uniform-speed paramterizations of the four boundaries. It is convenient to adopt normalized coordinates for the four boundaries such that J = 4 if the four boundary curves are of arc-length parameterization, otherwise, J > 4 [1]. Each parameter is subjected to a M¨obius transformation as follows. u = u(s) =

(α − 1)s , 2αs − s − α

(3)

v = v(t) =

(β − 1)t . 2βt − t − β

(4)

and

Applying the transformations (3) and (4) to surface (1) results in the rational B´ezier surface m  n 

X(s, t) =

Bim (s)Bjn (t)ωi,j Pi,j

i=0 j=0 n m  

i=0 j=0

Bim (s)Bjn (t)ωi,j

,

s ∈ [0, 1], t ∈ [0, 1],

Optimal Parameterizations of B´ezier Surfaces

675

with ωi,j = (1 − α)i αm−i (1 − β)j β n−j . Here we want to choose the transformations (3) and (4) such that J(α, β) becomes as small as possible. With the help of the chain rule, we get from Equation (2) 1

J(α, β) = 0 1

||

+ 0

∂X(s, 0) 2 (1 − α + 2sα − s)2 || ds + || ∂s α(1 − α)

∂X(0, t) 2 (1 − β + 2tβ − t)2 || dt + ∂t β(1 − β)

1

|| 0

1

|| 0

∂X(s, 1) 2 (1 − α + 2sα − s)2 || ds ∂s α(1 − α)

∂X(1, t) 2 (1 − β + 2tβ − t)2 || dt ∂t β(1 − β)

The solution satisfies the following two equations 0=

∂J(α, β) , ∂α

(5)

0=

∂J(α, β) . ∂β

(6)

and

First, we simplify Equation (5) as follows. ∂J(α, β) 0= = ∂α 1 || 0

1 || 0

∂X(s, 0) 2 −B02 (s)B02 (α) + B22 (s)B22 (α) || ds+ ∂s α2 (1 − α)2

∂X(s, 1) 2 −B02 (s)B02 (α) + B22 (s)B22 (α) P1 B02 (α) + Q1 B22 (α) || ds = ∂s α2 (1 − α)2 α2 (1 − α)2

with the coefficients 1 −(||

P1 = 0

and

1 Q1 =

(|| 0

∂X(s, 0) 2 ∂X(s, 1) 2 2 || + || || )B0 (s)ds, ∂s ∂s

∂X(s, 0) 2 ∂X(s, 1) 2 2 || + || || )B2 (s). ∂s ∂s

Note that P1 < 0 < Q1 holds. Hence we get exactly one root of P1 B02 (α) + Q1 B22 (α) = 0 with 0 < α < 1. Equation (6) can be solved using a similar method. Also the polynomial form of the coefficients can be easily obtained. In Figure 2, we give an example to show the improved parameter speed that can be realized by the M¨ obius reparameterizations. The parameter lines corresponding to a fixed parameter increment in another parameter for the original representation and the optimal rational representation are given in Figure 2(a) and Figure 2(b) respectively. For the surface in Figure 2(a), the original polynomial representation has J = 5.139. The optimal reparameterization occurs for

676

Y.-J. Yang et al.

(a)

(b)

(c)

(d)

(e)

(f)

Fig. 2. Texture mapping and tessellating results of a B´ezier surface: (a) B´ezier surface and its polynomial parameterization; (b) B´ezier surface and its optimal parameterization; (c) texture mapping result of the surface; (d) texture mapping result of the reparameterized surface; (e) tessellating result of surface (a) by mapping Figure 1(d) to the surface; (f) tessellating result of surface (b) by mapping Figure 1(d) to the reparameterized surface

α = 0.274, β = 0.311 - yielding a value, J = 4.019 that yields satisfying results for rendering and tessellating applications. For the B´ezier surface in Figure 2(a), the original polynomial parameterization has J = 4.524. The optimal reparameterization occurs for α = 0.482, β = 0.432 - yielding a value, J = 4.469 that yields a surface similar to the original surface (see Figure 3). From Figures 2 and 3, we can see that the linear M¨ obius transformations can not change the shape of the parameter lines. What changes is the distribution of the parameter lines. Thus the parameter lines will not become more uniform after linear M¨obius reparameterizations for some surface cases. Also the M¨ obius reparameterizations are not expected to yield dramatic improvements in the parameter speed for arbitrary B´ezier surfaces. The optimal reparameterization coefficients (using the integral in [1]) for the four boundary curves are shown in Table 1. We can see that if the changes of the parameter speed across the two opposite boundaries are not consistent (the optimal reparameterization coefficient for one boundary is greater than 0.5 while the reparameterization coefficient for another opposite boundary is less than 0.5), the M¨ obius transformations take little effect. Table 1. Optimal reparameterization coefficients for B´ezier curves Curve S(u, 0) S(u, 1) S(0, v) S(1, v) surface in Figure 2(a) 0.268 0.279 0.294 0.324 surface in Figure 1(a) 0.290 0.676 0.435 0.428

Optimal Parameterizations of B´ezier Surfaces

3

677

Quadratic Reparameterization of B´ ezier Surfaces

Given a B´ezier surface, each parameter is subjected to a transformation as follows. (α − 1)s , (7) u = u(s) = 2αs − s − α and (β − 1)t v = v(t) = , (8) 2βt − t − β where α = α1 t + α2 (1 − t) and β = β1 s + β2 (1 − s). Here in order to achieve more uniform parameter lines, we need additional free parameters. We choose α in (7) as a linear function of t, with coefficients α1 and α2 , and β in (8) as a linear function of s, with coefficients β1 and β2 . This will lead to an optimization problem with 4 variables, and it will also raise the degree of the surface accordingly.

(a)

(b)

(c)

Fig. 3. Texture mapping and tessellating results of a B´ezier surface: (a) B´ezier surface and its optimal parameterization; (b) texture mapping result of reparameterized surface (a); (d) tessellating result by mapping Figure 1(d) to the reparameterized surface

3.1

Computing the Control Points and Weights of the Reparameterized Surface

The new surface would be of degree (m + n) × (m + n). The new B´ezier functions are computed as follows. Bim (s) =

Bim (u)(α2 v − α1 v − α2 )m−i (α1 v + α2 − α2 v − 1)i (2uα1 v + 2uα2 − 2uα2 v − u − α1 v − α2 + α2 v)m

(α2 v − α1 v − α2 )m−i (α1 v + α2 − α2 v − 1)i can be expressed as

m  l1 =0

cl1 ,i Blm (v) 1

by a linear matrix solving. Thus we have m 

Bim (s) =

l1 =0

cl1 ,i Blm (v)Bim (u) 1

(2uα1 v + 2uα2 − 2uα2 v − u − α1 v − α2 + α2 v)m

(9)

678

Y.-J. Yang et al.

(a)

(b)

(c)

Fig. 4. Texture mapping and tessellating results of a B´ezier surface: (a) B´ezier surface and its optimal parameterization; (b) texture mapping result of reparameterized surface; (c) tessellating result by mapping Figure 1(d) to the reparameterized surface

Similarly, we have n 

Bjn (t)

=

l2 =0

al2 ,j Bln2 (u)Bjn (v) (10)

(2uβ1 v + 2vβ2 − 2vα2 u − v − α1 u − α2 + α2 u)n

From Equations (9) and (10), we obtain

    m  n  n  m   m  n  l1 j m+n  l2 i Blm+n cl ,i al ,j +j (v)Bl +i (u) m + n m + n l =0 l =0    1

1

2

1

2

l1 + j

Bim (s)Bjn (t) =

2

l2 + i D1 D2

where D1 = (2uα1 v + 2uα2 − 2uα2 v − u − α1 v − α2 + α2 v)m and D2 = (2uβ1 v + 2vβ2 − 2vα2 u − v − α1 u − α2 + α2 u)n . Thus the (k1 , k2 ) control point of the reparameterized surface is









 m  n  n  m  k1 k2   k2 − j j  k1 − i  i Pi,j ck2 −j,i ak1 −i,j m + n i=max(k1 −n,0) j=max(k2 −m,0)   m + n  k2 k1 k1 



k2 

i=max(k1 −n,0) j=max(k2 −m,0)

ck2 −j,i ak1 −i,j

the weight of the (k1 , k2 ) control point is k1 

k2 

i=max(k1 −n,0) j=max(k2 −m,0)

ck2 −j,i ak1 −i,j











m  n  n  m  k2 − j j  k1 − i  i  m + n  m + n  k2 k1

    n n m m j k1 − i i k2 − j    . m+n m+n k2 k1

Thus we get the reparameterized surface with degree (m + n) × (m + n).

.

Optimal Parameterizations of B´ezier Surfaces

3.2

679

Determining the Coefficients

The four coefficients α1 , α2 , β1 and β2 influence the parameterization of the resultant surface greatly. α1 and α2 affect the shape and distribution of v curves while the β1 and β2 affect the shape and distribution of u curves. To obtain a satisfying representation (more uniform parameter lines), we compute the αi for some u curves X(u, vi ) firstly. A least square technique is then applied to interpolate the αi to get α1 and α2 . β1 and β2 can be computed similarly. For most surface cases, the quadratic reparameterizations can produce more uniform parameter lines. For the surface shown in Figure 1(a), the rendering and tessellating results of the reparameterized surface using quadratic reparameterization are shown in Figure 4.

(a)

(b)

(d)

(e)

(c)

(f)

Fig. 5. Texture mapping and tessellating results of B´ezier patches: (a) an arbitrary network of bicubic B´ezier patches; (b) triangular mesh of the parameter domain; (c) texture mapping result of surfaces (a); (d) texture mapping result of the reparameterized patches; (e) tessellating result of (a) by mapping (b) to the patches; (f) tessellating result of (a) by mapping (b) to the reparameterized patches

680

Y.-J. Yang et al.

From Figure 4, we can see that the quadratic reparameterization can change the shape of the parameter lines as well as the distribution of the parameter lines. The example shown in Figure 5 illustrates the application of quadratic reparameterization in animation industries. In Figure 5, we use a bicubic Bspline surface to approximate the original face model with 1024 triangles. Then the B-spline surface is split into 196 bicubic B´ezier patches (see Figure 5(a)). After the quadratic reparameterization, the curves shared by two B´ezier patches should have the same control points and the same weights. To achieve this, the coefficients of the quadratic reparameterization are determined by interpolating the reparameterization coefficients of the boundary curves directly. No interior u(or v) curves are involved in the computation. For the rendering and tessellating applications, the quadratic reparameterization produces more satisfying results with a cost that the degree of the surface patches is raised to (m + n) × (m + n).

4

Conclusions

We have shown that linear M¨ obius transformations can not change the shape of the parameter lines. What changes is the distribution of the parameter lines. In order to obtain more uniform parameter lines, a quadratic reparameterization algorithm is presented to reparameterize the B´ezier surfaces. The examples indicate that, in practice, the algorithm produces significantly more uniform parameter lines across the B´ezier surfaces.

Acknowledgements The authors appreciate the comments and suggestions of the anonymous reviewers. The research was supported by Chinese 973 Program(2004CB719400), and the National Science Foundation of China (60403047). The second author was supported by the project sponsored by a Foundation for the Author of National Excellent Doctoral Dissertation of PR China (200342), and a Program for New Century Excellent Talents in University(NCET-04-0088).

References 1. Farouki RT. Optimal parameterizations. Computer Aided Geometric Design 1997,14(2):153-168. 2. J¨ uttler B. A vegetarian approach to optimal parameterizations. Computer Aided Geometric Design, 1997,14(9):887-890. 3. Costantini P, Farouki RT, Manni C and Sestini A. Computation of optimal composite re-parameterizations. Computer Aided Geometric Design 2001,18(9):875-897. 4. Yeh S-S, Hsu P-L. The speed-controlled interpolator for machining parametric curves. Computer-Aided Design 1999,31(5):349-357. 5. Yang DCH, Wang FC. A quintic spline interpolator for motion command generation of computer-controlled machines. ASME J. Mech. Design 1994,116:226-231.

Optimal Parameterizations of B´ezier Surfaces

681

6. Yang DCH, Kong T. Parametric interpolator versus linear interpolator for precision CNC machining. Computer-Aided Design 1994,26(3),225-234. 7. Wever U. Optimal parameterization for cubic spline. Computer-Aided Design 1991,23(9):641-644. 8. Wang FC, Yang DCH. Nearly arc-length parameterized quintic spline interpolation for precision machining. Computer-Aided Design 1993,25(5):281-288. 9. Wang FC, Wright PK, Barsky BA, Yang DCH. Approximately arc-length parameterized C 3 quintic interpolatory splines. ASME J. Mech. Design 1999,121:430-439. 10. Shpitalni M, Koren Y, Lo CC. Realtime curve interpolators. Computer-Aided Design 1994,26(11):832-838. 11. Ong BH. An extraction of almost arc-length parameterization from parametric curves. Ann. Numer. Math. 1996,3:305-316. 12. Piegl LA. and Richard AM. Tessellating trimmed NURBS surfaces. ComputerAided Design 1995,27(1):15-26. 13. Ng WMM and Tan ST. Incremental tessellation of trimmed parametric surfaces. Computer-Aided Design 2000,32(4):279-294. 14. Hamann B, Tsai PY. A tessellation algorithm for the representation of trimmed nurbs surfaces with arbitrary trimming curves. Computer-Aided Design 1996,28(6/7):461-472.