On Smooth Bicubic Surfaces from Quad Meshes Jianhua Fan and Jörg Peters Dept CISE, University of Florida Abstract. Determining the least m such that one m m bi-cubic macropatch per quadrilateral offers enough degrees of freedom to construct a smooth surface by local operations regardless of the vertex valences is of fundamental interest; and it is of interest for computer graphics due to the impending ability of GPUs to adaptively evaluate polynomial patches at animation speeds. We constructively show that m = suffices, show that m = 2 is unlikely to always allow for a localized construction if each macro-patch is internally parametrically C and that a single patch per quad is incompatible with a localized construction. We do not specify the GPU implementation. Introduction Quad(rilateral) meshes are used in computer graphics and CAD because they capture symmetries of natural and man-made objects. Smooth surfaces of degree bi- can be generated by applying subdivision to the quad mesh [CC78] or, alternatively, by joining a finite number of polynomial pieces [Pet00]. When quads form a checkerboard arrangement, we can interpret 4 4 grids of vertices as B-spline control points of a bi-cubic tensor product patch. Then we call the central quad ordinary and are guaranteed that adjacent ordinary quad patches join C 2. The essential challenge comes from covering extraordinary quads, i.e. quads that have one or more vertices of valence n 4 as illustrated in Fig.,left. While this can be addressed by recursive subdivision schemes, in many scenarios, for example GPU acceleration, localized parallel constructions of a finite number of patches are preferable [NYM + 08]. Here localized, parallel means that each construction step is parallel for all quads or vertices and only needs to access a fixed, small neighborhood of the quad or vertex. Due to the size limitations, this paper does not discuss GPU specifics, but addresses the fundamental lower bound question: how to convert each extraordinary quad into a macro-patch, consisting of m m bi-cubic pieces, so as that a general quad mesh is converted into a smooth surface. Prompted by the impending ability of GPUs to tessellate and adaptively evaluate finitely patched polynomial surface at animation speeds, there have recently been a number of publications close to this problem. Loop and Schaefer[LS08] propose bi-cubic C 0 surfaces with surrogate tangent patches to convey the impression of smoothness via lighting. Myles et al. [MYP08] perturb a bi-cubic
2 Jianhua Fan and Jörg Peters base patch near non-4-valent vertices by coefficients of a (5,5) patch to obtain a smooth surface. PCCM [Pet00] generates smooth bi-cubic surfaces but requires up to two steps of Catmull-Clark subdivision to separate non-4-valent vertices. This proves that m = 4 suffices in principle. But bi-cubic PCCM can have poor shape for certain higher-order saddles (e.g. the 6-valent monkey saddle Fig. 5, row ) as discussed in [Pet]. Below we specify an algorithm that constructs smoothly connected C macro-patches without this shape problem; and discuss why the approach fails when m <. p 4 p p 2 0 2 p 0 p p 2n0 p 2n0 g k 0 g k g 00 u k,µ 0 u k,µ u k,µ 2 b k,µν 00 b k,µν 20 w k,µ w k,µ 0 w k,µ w k,µ 2 Fig.. left: extraordinary vertex p 0 with n 0 direct neighbors p 2k, k =... n 0. middle: limit point g 00, tangent points g k 0 and twist coefficients g k. right: BB differences. 2 Notation, and why m = need not be considered We denote the kth bi-cubic Bernstein Bézier (BB) patch, k =...n 0, surrounding a vertex p 0 of valence n 0 (Fig. ) by b k,µ,ν (u, v) := i=0 j=0 b k,µ,ν ij ( ) ( ) u i ( u) i v i ( v) j. () i j Here µ, ν indicate a piece of the m m macro-patch (see Fig. 2, left, for m = ). The BB coefficients (control points) of the tensor-product patch b k,µ,ν are therefore labeled by up to 5 indices when we need to be precise (Fig. 2): b k,µ,ν ij R, k =...n 0, µ, ν {0,...,m }, i, j {0,, 2, }. (2) For the two macro-patches meeting along the kth boundary curve b k,µ0 (u, 0) = b k,0µ (0, u), µ = 0,...,m, we want to enforce unbiased (logically symmetric) G constraints 2 b k,µ0 (u, 0) + b k,0µ (0, u) = α k i (u) b k,µ0 (u, 0), i = 0...,m, () where each α k i is a rational, univariate scalar function and l means differentiation with respect to the lth argument. If α k i = 0, the constraints enforce
On Smooth Bicubic Surfaces from Quad Meshes (parametric) C continuity. The polynomial equalities () hold for the kth curve exactly when all m n 0 polynomial coefficients are equal. The coefficients are differences of the BB control points: i := b k,µ0 i b k,µ0 i0, w k,µ i := b k,0µ i b k,0µ 0i, u k,µ i := b k,µ0 i+,0 bk,µ0 i0. The differences need only have a single subscript since we consider curves (in u) and a simpler superscript since ν = 0. For example, if we choose α k i (u) := λ k i ( u) + λk i+u, then () formally yields 4m equations when µ = 0,...,m: 0 + w k,µ 0 = λ k µu k,µ 0 (4) ( + w k,µ ) = 2λ k µu k,µ + λ k µ+u k,µ 0 (5) ( 2 + w k,µ 2 ) = λ k µ uk,µ 2 + 2λ k µ+ uk,µ (6) + w k,µ = λ k µ+ uk,µ 2. (7) By definition, (7) µ=i = (4) µ=i+, i.e. constraint (7) when substituting µ = i is identical to constraint (4) for µ = i +. We need not consider m =, i.e. one bi-cubic patch per quad, since the vertex-enclosure constraint [Pet02, p.205] implies, for even n 0 > 4 that the normal curvatures and hence the coefficients 20 ( Fig.,right) of the n 0 curves emanating from p 0 are related for k =,...,n 0 : the normal component of their alternating sum k ( )k 20 must vanish. Since, for a bi-cubic patch, the control point 20 lies in the tangent plane of the kth neighbor vertex (Fig.,right), the vertex s enclosure constraint constrains the neighboring tangent planes with respect to its tangent plane. Therefore, if we fix the degree of the patches to be bi-cubic and allow only one patch per quad then no localized construction is possible. For m >, the coefficients 20 no longer lie in the tangent plane of the neighbor; so a local construction may be possible. We next give an explicit construction when m =. Localized smooth surface construction using a macro-patch We factor the algorithm into four localized stages. First, we define the central point g 00, the tangents g 0 g 00 and the face coefficients g as an average (see Fig. ) of the extraordinary vertex p 0 with valence n 0, and its -ring neighbors p, p 2,..., p 2n0. In a second stage, we partition the quad into a arrangement (Fig. 2) and establish its boundary; in the third, we determine the cross-boundary derivatives so that pairs of macro-patches join G (Equation ()) and in the final stage, we determine the interior coefficients. By this construction, a macro-patch joins at least parameterically C with an unpartitioned spline patch (see Fig. 5, row 2, where the second entry displays each polynomial piece in a different color).
4 Jianhua Fan and Jörg Peters. [Initialization] It is convenient (and shown to be effective to approximate the Catmull-Clark limit surface) to set g ij according to [MYP08]. That is to set g 00 to the limit of p 0 under Catmull-Clark subdivision (red circle in Fig. middle) and place the g0 k (blue circle in Fig. middle) on the Catmull-Clark tangent plane: g 00 = g k 00 := n 0 l= ( n 0 p 0 + 4p 2l + p 2l ) n 0 (n 0 + 5) g k 0 := g k 00 + e c k n 0 + e 2s k n 0, e i := σ n 0 (2 + ω n 0), k =... n 0, (8) ( αi p 2j + β i p 2j), (9) g k := 9 (4p0 + 2(p 2k+ + p 2k+ ) + p 2k+2 ), k =...n 0. (0) where the scalar weights are defined as c k 2πk n0 := cos n 0, 2πk sk n0 := sin n 0, c n 0 := c n 0, ω n 0 := 6λ n 0 4, λ n 0 := 6 (c n 0 + 5 + (c n 0 + 9)(c n 0 + )), σ n 0 := α := ω n 0c j n 0, n 0 j= β := c j n 0 + c j n 0, α 2 := ω n 0s j n 0, { 0.5 if n 0 =, 4λ if n 0 >, n 0 β 2 := s j n 0 + s j n 0. Symmetric construction of the other three corners of the quad yields 4 4 coefficients g ij that can be interpreted as the BB coefficients of one bi-cubic patch g : [0, ] 2 R in the form (). b k,02 b k, 00 b k,20 0 b k,20 00 b k,0 00 00 0 00 00 n 0 00 00 0 00 00 n Fig.2. left: Patches b k,µν and coefficients b k,µν ij. right: Coefficients shown as black disks are determined by subdividing the initialization g ij (see ()), coefficients shown as small squares are determined by (4) and (5), coefficients shown as big yellow squares are determined by C 2 continuity of the boundary curve (6), (7), (8). 2. [domain partition and boundary] We partition the domain into pieces (see Fig. 2 left) and let the macro-patch inherit vertex position and
On Smooth Bicubic Surfaces from Quad Meshes 5 tangents (black disks in Fig. 2 right) by subdividing g: 00 := g00, k 0 := 2 gk 00 + gk 0, := 4gk 00 + 2g0 k + 2g k + g k. () 9 Each macro-patch will be parametrically C (and C 2 in the interior). To enforce the G constraints () between macro-patches, we need to distinguish two cases when choosing α k i depending on whether one of the vertices is regular, i.e. has valence 4. Of course, if both valences are 4 then we simply subdivide g and set α k i = 0; and if all four corner points have valence 4, no partition is needed in the first place since g is then part of a bi-cubic tensor-product B-spline patch complex and therefore joins C 2 with its spline neighbors and at least C with macro-patches (Fig. 5, row 2, second entry). 2a. [boundary n 0 4 n ] We choose α k i as simple as possible, namely linear λ k 0 := 2 cos(2π n 0 ), if n 0 4 n : α k i (u) := λk i ( u) + λk i+u, (2) λk := 2 cos(2π n ), λk := 2λk 0 + λ k, λ k 2 := λk 0 + 2λ k. () The three cubic pieces of the boundary curve have enough free parameters to enforce Equation (5) for µ = 0 and Equation (6) for µ = 2 and (small squares in Fig. 2 right) by setting 20 := 0 + (bk,00 + b k,00 2 0 ) λk (bk,00 0 2λ k 0 00 ) b k,20 0 := b k,20 20 + λk 2 (bk,20 0 b k,20 20 ) (bk,20 2 + b k,02 2 2b k,20 20 ) 2λ k and joining the three curve segments C 2 (cf. large squares in Fig. 2 right), (4) (5) for µ = 0, : b k,µ0 0 := (b k,µ0 20 + b k,µ+,0 0 )/2, (6) 0 := 4 bk,00 20 bk,20 20 + 2 bk,20 0 2 bk,00 0, (7) 20 := 2 bk,00 20 2 bk,20 20 + 4 bk,20 0 bk,00 0. (8) 2b. [boundary n 0 4 = n ] If n 0 4 = n, Lemma 2 in the Appendix shows that we cannot choose all α k i to be linear. (If λ k = 0 in Lemma 2 then the dependence appears at the next 4-valent crossing 00.) We set λ := 2 cos(2π n ) 0 and α k 0(u) := λ k ( u) + λk 2 u, αk (u) := λk 2 ( u)2, α k 2(u) = 0. (9) Then 20 is defined by (5) and b k,20 0 by subdividing the cubic boundary of g: b k,20 0 := 2 9 bk,00 00 + bk,00 0 + 4 bk,20 20 4 9 bk,20 0. (20)
6 Jianhua Fan and Jörg Peters From the remaining six G constraints across the macro-patch boundary, (v k,0 2 + w k,0 2 ) = λk u k,0 2 + λ k u k,0, (vk, 2 + w k, 2 ) = 0 (2) (v k,0 + w k,0 ) = 2 λk ( 0 00 9(v k, + w k, ) = 2 λk ( 0 20 ), (vk, + w k, ) = 0 (22) ), 9(vk,2 + w k,2 ) = 0. (2) the two listed as (22) are linked to the remaining four by the requirement that the macro-patches be internally C : for µ = 0, : b k,µ0 0 = (b k,µ0 20 + b µ+,20 0 )/2 (24) 2 + + = 2, w k,µ 2 + w k,µ+ = 2w k,µ. (25) Thus, by adding times (2) to (2) and subtracting 6 times (22) and observing (25), we eliminate the left hand sides and obtain one constraint purely in the boundary coefficients multiplied by λ k 0. A second constraint arises since α k (u) being quadratic implies that the middle segment bk,0 (u, 0) is quadratic, i.e. its third derivative is zero: Both constraints are enforced by setting 0 20 + 0 00 = 0. (26) 0 := 4 25 bk,00 20 + 4 25 bk,20 0 4 5 bk,00 0, bk,0 20 := 6 25 bk,00 20 + 9 25 bk,20 0 4 5 bk,00 0. Together with (24), this fixes the macro-patch boundary (Fig. 2, right).. [First interior layer, G constraints] Enforcing the remaining four G constraints in terms of the red coefficients in Fig. is straightforward and our symmetric solution is written out below. a. [n 0 4 n ] h µ := b k,µ0 20 + λk µ uk,µ 2 + 2λ k µ+ uk,µ 6, h 2µ := b k,µ0 0 + 2λk µ uk,µ + λ k µ+ uk,µ 0 6 µ = 0, : b k,µ0 2 := h µ + k,00 k,00 ( b 2 b 2 ), b k,0µ 2 := h µ + k,00 k,00 ( b 2 b 2 2 2 ) µ =, 2 : b k,µ0 := h 2µ + k,0 k, ( b b ), b k,0µ := h 2µ + k, k,0 ( b b 2 2 ). b.[n 0 4 = n ] h := 20 + λk 0u k,0 2 + λ k 0u k,0, h 2 : = 0 + λk 0u k, 2 6 2 2 := h + k,00 k,00 ( b 2 b 2 ), b k,0j 2 : = h + k,00 k,00 ( b 2 b 2 2 2 ) := h 2 + k,0 k, ( b b ), b k, : = h 2 + k, k,0 ( b b 2 2 ) 2 := 20 + k,0 k, ( b 2 b 2 ), b k, 2 : = 20 + k, k,0 ( b 2 b 2 2 2 ) b k,20 := b k,20 0 + k,20 k,02 ( b b ), b k,02 : = b k,20 0 + k,02 k,20 ( b b 2 2 )
On Smooth Bicubic Surfaces from Quad Meshes 7 k,00 k,00 k,0 k, where the coefficients b 2, b 2, b and b are obtained by subdividing the cubic Hermite interpolate to the transversal derivatives at the endpoints into three parts: The coefficients bk,00 2 : = 4 9 bk,00 + 4 bk,00 + bk,20 2 2 9 bk,20, bk,00 2 : = 4 9 bk,00 0 + 4 bk,00 + bk,02 2 2 9 bk,02, bk,0 : = 20 27 bk,00 + 4 bk,00 + b k,20 2 6 27 bk,20, bk, : = 20 27 bk,00 0 + 4 bk,00 + b k,02 2 6 27 bk,02. k,0 k, b 2, b 2, b k,20 k,02 and b are defined analogously. 5 4 20 4 27 2 2 2 Fig.. left: Once the red BB-coefficients 2, bk,0, bk,0 2, bk,20 of the first interior layer are set, the green coefficients are C averages of their two red neighbor points. Blue, pink and black coefficients are inner points computed by the rules on the right: (top) by subdivision and (bottom) so that the pieces join C 2 : the coefficient indicated by the large is a linear combination, with weights displayed, of the coefficients shown as. 4. [macro-patch Interior] At the center (four black disks in Fig., left) the coefficients are computed according to,right-top, b k, := ( 20 27 bk, + 4 bk, + b k,2 2 + 2 bk,2 ) + ( 20 27 bk,0 + 4 bk,0 + b k,2 2 + 2 bk,2 2 and symmetrically for the other three corners. Coefficients marked in blue and pink are defined by the rules of Fig. right-bottom and the remaining coefficients on the internal boundaries are the C average of their neighbors, e.g. b k, 0 := (b k, + 2 )/2 so that the patches join C everywhere and C 2 with the central subpatch. This completes the local construction of C macro-patches, one per input quad and so that neighbor macro-patches join G. Before we show examples, we discuss why we did not choose m = 2. ),
8 Jianhua Fan and Jörg Peters 4 Can m = 2 provide a construction? b k, b k, 00 20 0 0 0 b k,00 n 0 n 0 0 b k, Fig.4. left: Coefficients initialized according to (28). right: Indexing. We show that an analogous construction is not possible for a 2 2 macropatch. Since the degree of 2 b k,µ0 (u, 0) and b k,0µ (0, u) is, choosing α k µ to be quadratic implies that b k,µ0 (u, 0) must be linear, i.e. each boundary curve segment is piecewise quadratic. If both n 0 and n are even and not 4, then the vertex enclosure constraint (see Section 2) implies that the shared endpoint of the two quadratic segments is determined independently from both sides so a local construction is not possible just as in the case m =. We therefore choose α k µ (u) := λk µ ( u)+λk µ+u, µ = 0, with the unbiased choice (we do not prefer one sector over another) λ k 0 := 2 cos 2π n 0, λk 2 := 2 cos 2π n. (27) As in Section (), we enforce (4) µ=0 and (7) µ= of the eight G continuity constraints by initializing position and tangents (black filled circles in Fig. 4 left) by subdividing g: 00 := g00 k, bk,00 0 := gk 00 + gk 0, := gk 00 + gk 0 + gk + gk. (28) 2 4 Lemma. If each macro-patch is parametrically C, α k 0 and αk are linear with λ k 0 and λ k 2 unbiased then the G constraints can only be enforced for all local initialization of 00, bk,00 0, bk,00 if n 0 = n. Proof. Due to the internal C constraints, adding (6) µ=0 and (5) µ= and subtracting six times (7) µ=0 yields (v k,0 2 +w k,0 2 )+(vk, +w k, ) 6(vk,0 +w k,0 ) = 0 and therefore the right hands sides satisfy λ k 0 uk,0 2 + 2λ k uk,0 + 2λ k uk, + λ k 2 uk, 0 = 6λ k uk,0 2. (29) That is, for an internally C macro-patch, G constraints across the macropatch s boundary imply a constraint exclusively in terms of u k,µ i, i.e. derivatives along the boundary! Since initialization fixes the local position, tangent and
On Smooth Bicubic Surfaces from Quad Meshes 9 twist coefficients at each vertex, (5) µ=0 determines 20 and (6) µ= determines 0 ; and C continuity determines 0 := ( 20 + 0 )/2. Thus all vectors of (29) are fixed and the remaining single free scalar λ k cannot always enforce (29). But if n 0 = n then λ k 0 = λ k 2 and u k,0 2 = u k, 0 ; and λk = 0 solves (29). 5 Conclusion Curvature distribution and highlight lines on the models of Fig. 5 illustrate the geometric soundness of the m = macro-patch construction. Choosing α k and hence the middle boundary curve segment to be quadratic, avoids the PCCM shape problem which is due to α k 0 and hence the first segment being quadratic. Conversely, Section 4 suggests that there is no obvious construction for m = 2; whether a more complex Ansatz can yield a localized construction for m = 2 remains the subject of research. References [CC78] E. Catmull and J. Clark. Recursively generated B-spline surfaces on arbitrary topological meshes. Computer Aided Design, 0:50 55, 978. [LS08] Charles Loop and Scott Schaefer. Approximating Catmull-Clark subdivision surfaces with bicubic patches. ACM Trans. Graph., 27():, 2008. [MYP08] A. Myles, Y. Yeo, and J. Peters. GPU conversion of quad meshes to smooth surfaces. In D. Manocha et al, editor, ACM SPM, pages 2 26, 2008. [NYM + 08] T. Ni, Y. Yeo, A. Myles, V. Goel, and J. Peters. GPU smoothing of quad meshes. In M. Spagnuolo et al, editor, IEEE SMI, pages 0, 2008. [Pet00] Jörg Peters. Patching Catmull-Clark meshes. In K. Akeley, editor, ACM Siggraph, pages 255 258, 2000. [Pet] Jörg Peters. Modifications of PCCM. TR 0, Dept CISE, U Fl, 20. [Pet02] J. Peters. Geometric continuity. In Handbook of Computer Aided Geometric Design, pages 9 229. Elsevier, 2002. Appendix: linear parameterization and valence 4 Lemma 2. If k = 4 curves meet at a vertex without singularity and α k0 i is linear with λ k := l cos 2π n, for fixed scalar l > 0 and valence n k, then the G constraints k () can only be enforced if n k = n k+2 for k = 0,. Proof. For k =, 2,, 4, λ k 0 simplifies to = 0 and therefore αk0 i ( + b k,00 ) = 6 0 + λ k uk,0 0, k =...4. Since 4 k= ( )k ( + b k,00 ) = 0 and 4 k= ( )k 00 = 0, 0 = 4 ( ) k 6( 0 00 ) + λk u k,0 k= 0 = := λ k u. Equation (5) µ=0 then 4 ( ) k (6 + λ k )u k,0 0 (0) k=
0 Jianhua Fan and Jörg Peters Fig. 5. macro-patch construction. left: Quad mesh and surface; middle(top four): Gauss curvature distribution on the surface, right: Highlight lines.
On Smooth Bicubic Surfaces from Quad Meshes implying λ k = λk+2 for k = 0, 2 since u k,0 0 = u k+2,0 0. Therefore n k = n k+2 must hold. Acknowledgement This work was supported by the National Science Foundation Grant 0728797.