Surfaces for CAGD FSP Tutorial FSP-Seminar, Graz, November 2005 1
Tensor Product Surfaces Given: two curve schemes (Bézier curves or B splines): I: x(u) = m i=0 F i(u)b i, u [a, b], II: x(v) = n j=0 G j(v)c j, v [c, d]. Tensor product surface generated by the curve schemes I and II: x(u, v) = m i=0 n F i (u)g j (v)b ij, j=0 (u, v) [a, b] [c, d], TP Bézier surface TP B spline surface Torus-line TP surface FSP-Seminar, Graz, November 2005 2
Generation of TP Surfaces Factorization of the definition: x(u, v) = m n F i (u)g j (v)b ij = n ( m G j (v) F i (u)b ij ) i=0 j=0 j=0 i=0 Each fixed u gives a control point of the v curve. TP surface is a curve of curves. TP surfaces are generated by a motion of the boundary curves. FSP-Seminar, Graz, November 2005 3
Control Nets b ij : control net of the surface b 02 02 32 b 00 b 32 00 30 Parameter grid Control net TP surface b 30 FSP-Seminar, Graz, November 2005 4
Computation of Surface Points Computation of a surface point x(u 0, v 0 ): Construct the points c j = m i=0 F i(u 0 )b ij with algorithm I (n + 1-times) Construct x(u 0, v 0 ) from the points c j with the algorithm II Alternative: Construct the points d i = n j=0 G j(v 0 )b ij with algorithm II (m + 1-times) Construct x(u 0, v 0 ) from the points d i with the algorithm I Control net, computed points TP Bézier surface FSP-Seminar, Graz, November 2005 5
Properties If I is endpoint interpolating, then the curves from II to b 00,..., b 0n and b m0,..., b mn are boundary curves of the surface patch. If I and II possess the convex hull property, then also the TP surface lies in the convex hull of its control net. Local control of TP B spline surfaces i,j Nk i (u)nj l(v)d ij: changing a control point d ij changes the surface only in the region corresponding to [u i, u i+k+1 ] [v j, v j+l+1 ] Convex hull property for TP Bézier surfaces: x convhull(b ij ) FSP-Seminar, Graz, November 2005 6
Shape Properties of Bézier Surfaces Affine invariance Convex hull property: x convex hull (b ij ) Interpolation of the corners of the control net: x(a, c) = b 00, x(b, c) = b m0, x(a, d) = b 0n, x(b, d) = b mn Tangency in corner points: e.g. the tangent plane at x 00 is spanned by b 10 b 00 and b 1 b 00. The boundary curves are Bézier curves formed by the boundary control points of the control net. Variation diminishing property does not hold Object design: Part of a vase as TP Bézier surface and its control mesh FSP-Seminar, Graz, November 2005 7
Direct de Casteljau scheme Idea: Use bilinear interpolation instead of linear interpolation (TP-approach) b 1,1 (r, s) = (1 r)(1 s)b 00 + r(1 s)b 10 + (1 r)sb 01 + rsb 11 b 1,1 (r, s) s b 01 b 11 (r, s) r b 00 b 10 Algorithm (repeated bilinear interpolation): IN: Control net b 00 i,j = b i,j Iteration: for all p = 1,..., n, i, j = 0,..., n p b p,p i,j (r, s) = (1 r)(1 s)b p 1,p 1 i,j +r(1 s)b p 1,p 1 i+1,j + (1 r)sb p 1,p 1 i,j+1 + rsb p 1,p 1 i+1,j+1 OUT: b n,n 0,0 = x(r, s) FSP-Seminar, Graz, November 2005 8
Special Tensor Product Patches A (1,1) tensor product patch is contained in a hyperbolic paraboloid. b 00 b 11 b 10 b 01 b 20 b 22 b 10 b 11 b 12 This surface carries also two onepar. families of parabolas with parallel axes. Parabolas of the same family are congruent. b 21 b 00 b 01 b 02 FSP-Seminar, Graz, November 2005 9
Ruled Surface Patches A general polynomial ruled surface carries a one-par. family ofstraight lines. Thus it can be parametrized by x(u, v) = (1 v) i F i (u)b i0 + v i F i (u)b i1. Cylinder: control polygons are congruent. Cone: control polygons are similar w.r.t a center. FSP-Seminar, Graz, November 2005 10
Translational Surface Patches Congruent control polygons b i0, b i1,..., b in, i = 0,..., m imply that the surface patch carries two one-par. families of congruent curves. FSP-Seminar, Graz, November 2005 11
TP surfaces vs. Triangular Bézier Patches TP surfaces are defined over rectangular parameter domains. Triangular Bézier patches are defined over triangular parameter domains: Triangles give more topological flexibility TP surfaces can have high degree T f b 120 b 030 R b 210 S b 021 b 012 b 201 b 102 b 300 b 003 Control net of Bézier triangle FSP-Seminar, Graz, November 2005 12
Barycentric Coordinates Given: R, S, T, point U = (u x, u y ) R 2 U can be represented as an affine combination of R, S, T: U = rr + ss + tt, r + s + t = 1 From Carthesian coordinates to barycentric coordinates: u x r x s x t x r u y = r y s y t y s 1 1 1 1 t T r + s + t = 1 t : r U s : t R s : r S Barycentric coordinates (r, s, t) with respect to a triangle FSP-Seminar, Graz, November 2005 13
Bézier Triangles R 2 with vertices R, S, T Points U of shall be represented by their barycentric coordinates r, s, t Triangular Bézier surface: f(u) = i+j+k=n Bijk n (r, s, t)b ijk i,j,k 0 Bernstein polynomials as weights: B n ijk b 002 (r, s, t) := n! i!j!k! r i s j t k b 003 b 101 b 011 b 110 b 200 b 020 b 201 b 102 b 111 b 012 b 021 210 120 b 030 Triangular control net n = 2 Triangular control net n = 3 FSP-Seminar, Graz, November 2005 14
Properties of Bernstein Polynomials Nonnegativity: B ijk 0 U Partition of unity: i+j+k=n Bijk n (r, s, t) 1 i,j,k 0 Recursion: B n ijk = rbn 1 i 1,j,k + sbn 1 i,j 1,k + tbn 1 i,j,k 1 s 4 4s 3 t 4rs 3 6s 2 t 2 12rs 2 t 6r 2 s 2 4st 3 12rst 2 12r 2 st 4r 3 s t 4 4rt 3 6r 2 t 2 4r 3 t r 4 Quartic Bernstein polynomials arranged in a triangular scheme FSP-Seminar, Graz, November 2005 15
Polar Forms Affine maps: F : R 2 R d is called affine, if for all a 1,..., a m R with m 1 a i = 1 and all U 1,..., U m R 2 F( m i=1 a iu i ) = m i=1 a if(u i ) holds. F is a symmetric map if if it is independent of the order of its arguments. Polar form of a polynomial: To each polynomial f : R 2 R d of degree n there exists a unique symmetric n affine map F : (R 2 ) n R d with F(U,..., U) = f(u). }{{} n Example: f : R 2 R: (x, y) a 0 x 2 + a 1 xy + a 2 y 2 + a 3 x + a 4 y + a 5 Polar form: F : R 2 R 2 R: ((x 1, y 1 ), (x 2, y 2 )) a 0 x 1 x 2 + a 1 2 (x 1 y 2 + x 2 y 1 ) + a 2 y 1 y 2 + a 3 2 (x 1 + x 2 ) + a 4 2 (y 1 + y 2 ) + a 5. FSP-Seminar, Graz, November 2005 16
Main Theorem Connection between control points and polar form: Given a triangular Bézier patch f = i+j+k=n Bijk n (r, s, t)b ijk i,j,k 0 Also given the polar form F of f Then, the Bézier points of f( ) are b ijk = F(R,..., R, S,..., S, T,..., T) }{{}}{{}}{{} i j k f b 002 = f(t) T = (0, 1) b 200 = f(r) b R = (0, 0) S = (1, 0) 020 = f(s) Bézier points of a quadratic function FSP-Seminar, Graz, November 2005 17
Shape Properties Affine invariance Convex hull property: f(u) convex hull of b ijk for all U (R, S, T) Endpoint interpolation: f(r) = b n00, f(s) = b 0n0, f(t) = b 00n The boundary curves are Bézier curves formed by the boundary control points. End point tangency: e.g. the tangent plane at b n00 is T n00 = span(b n00 b n 1,1,0, b n00 b n 1,0,1 ). b 002 b 020 b 200 Quadratic Bézier triangle FSP-Seminar, Graz, November 2005 18
Triangular de Casteljau Algorithm IN: Control net b 0 ijk = b ijk with i + j + k = n and U = rr + ss + tt Iteration: b l ijk = rbl 1 i+1,j,k + sbl 1 i,j+1,k + tbl 1 i,j,k+1, l = 1,..., n, i + j + k = n l OUT: b n 000 = f(u) b 002 b 1 001 b 2 000 b 1 100 b 1 010 b 020 b 200 Surface point computation for (r, s, t) = (1/4, 1/2, 1/4) FSP-Seminar, Graz, November 2005 19
Idea of Subdivision IN: Starting mesh, subdivided meshes OUT: Limit surface Convergence: Given a subdivision scheme and a control polygon/mesh, does the subdivision process converge? Does the subdivision process converge to a smooth curve/surface? FSP-Seminar, Graz, November 2005 20
Chaikin s Subdivision Most popular subdivision scheme In each iteration step (k = 1, 2,...), the same method is applied: Subdivision of the polyline legs: 1/4, 3/4 Convergence: k produces a quadratic B spline curve Approximative (vs. interpolative), local (vs. global) curve scheme FSP-Seminar, Graz, November 2005 21
Chaikin s Subdivision - Computation Scheme Given: control polyline p i = p 0 i, p i R d, d 2, Recursion: p k+1 2i = 3 4 pk i + 1 4 pk i+1 p k+1 2i+1 = 1 4 pk i + 3 4 pk i+1, for k > 0 k = 0 k = 1 k = 2 Computation can be vectorized FSP-Seminar, Graz, November 2005 22
Doo-Sabin s Scheme Subdivision scheme for defining surfaces in R 3 (invented in 1978) IN: mesh (often a quadmesh) OUT: surface Idea: stepwise refinement of the mesh by inserting new vertices and faces Input mesh k = 1 k = 2 k = 3 Limit FSP-Seminar, Graz, November 2005 23
Quadmeshes Quadmeshes consist of quadrangular (not necessarily planar) meshes Regular node: valence = 4; Irregular node valence 4 Doo Sabin algorithm computes polygonal meshes that converge toward a biquadratic B spline surface (except for irregular nodes) FSP-Seminar, Graz, November 2005 24
Doo-Sabin s Scheme for General Meshes During every round of the subdivision process, new vertices and new faces are created. Every vertex v of the current mesh yields a new vertex v F called image of v in F, for every face F having v as a vertex. Image vertices are connected to form three kinds of new faces: F -faces, E-faces, and V -faces. y z x x F y F F z F u F u w w F v F v Vertices and image vertices FSP-Seminar, Graz, November 2005 25
Doo-Sabin s Scheme - Creation of New Faces Creation of faces by connecting the image vertices of F -face: a face E-face: an edge V -face: a vertex y z x x F y F w w F F z F u F v F v u w F1 w F 1 E F 2 v F1 v w F2 v F2 F 2 v F2 F 1 v v F1 v F3 F3 New F -face New E-face New V -face x F,..., w F v F1, v F2, w F2, w F1 v F1, v F2, v F3 FSP-Seminar, Graz, November 2005 26
Doo-Sabin s Scheme - Creation of Image Vertices Centroid c of face F v F = (v + c)/2 with v vertex of F (possible other rules) y z x x F y F w w F F z F u F v F v u w F1 w F 1 E F 2 v F1 v w F2 v F2 F 2 v F2 F 1 v v F1 v F3 F3 Corner cutting: Every vertex of valence k is duplicated in k instances, then the duplications are repositioned. After one round of subdivision, all vertices have valence four. Number of non-rectangular faces remains constant. Non-rectangular faces shrink and tend to a limit which is their common centroid FSP-Seminar, Graz, November 2005 27
Example for Doo-Sabin s Scheme Possibility to model smooth surfaces with arbitrary topology That would only be possible by complicated fitting of several B spline or NURBS patches FSP-Seminar, Graz, November 2005 28
Catmull-Clark s Scheme IN: mesh (often a quadmesh) OUT: surface Method: Subdivide every face into smaller rectangular faces obtained by by connecting new face points, edge points, and vertex points (surface split - Doo Sabins s algorithm: corner split) Computes polygonal meshes that converge toward a bicubic B spline surface (except for irregular nodes) Input mesh k = 1 k = 2 k = 3 Limit FSP-Seminar, Graz, November 2005 29
Creation of New Points For each face F : create new (face) point v F For each edge E: create new (edge) point v E For each vertex v: create (vertex) new point v v 4 v 5 v 6 v F v 1 v 3 v 2 c F2 F 2 w ve E v c F1 F 1 w 3 v F4 w 4 w 2 v F3 e w3 e w2 v v F2 e w1 e w4 v F1 w 1 v F = P n i=1 v i n v E = v+w+c F 1 +c F2 4 v = 1 n f + 2 n e + n 3 n v c F1 centroid of F 1 f = n i=1 v F i /n c F2 centroid of F 2 e = n i=1 e w i /n New face point New edge point New vertex point FSP-Seminar, Graz, November 2005 30
Creation of New Faces Each new face point v F is connected by an edge to the new edge points v E associated with the boundary edges E of the face F. Each new vertex point v is connected by an edge to the new edge points v E associated with all the edges E incident with v. v E4 v E3 v E5 v E6 v F v E1 v E2 E v G v E v F G v v F Connect v F with v E1,..., v En Connect v with v E,v F,v G FSP-Seminar, Graz, November 2005 31
Examples for Catmull-Clark s Scheme Input mesh k = 1 k = 2 Limit After one round of subdivision, all faces are rectangular. The number of extraordinary points (vertices of degree different from four) remains constant. Both subdivision schemes are geometric : they do not need an underlying parametrization (more geometric that TP B spline surfaces). Drawback of subdivision: point evaluation of just one point of the limit surface is not trivial (easy for TP B spline surfaces). FSP-Seminar, Graz, November 2005 32
Comparison Upper two figures: Catmull-Clark s scheme (Cubic B spline surface) Lower two figures: Doo Sabin s scheme (Quadratic B spline surface) FSP-Seminar, Graz, November 2005 33
Loops s Scheme For meshes with triangular faces only Method: Split each face into four triangles, using rules to determine new edge points and new vertex points. v 1 v 1 x 3 x 2 v 2 v 3 v 2 v 3 x 1 New vertex points v 1, v 2, v 3 New edge points x 1, x 2, x 3 FSP-Seminar, Graz, November 2005 34
Creation of New Points Create new edge point x rs for every edge rs Create new vertex point v for every vertex v s p 3 p 2 p F G q o v x rs v r p 4 p 1 New edge point x rs = 1 8 p + 3 8 r + 3 8 s + 1 8 q New vertex point v = (1 α n ) n i=1 1 n p i + α n v (e.g. α n = 5/8) FSP-Seminar, Graz, November 2005 35
Creation of New Faces Subdivide original triangle into four small triangles v 1 v 1 x 3 x 2 v 2 v 3 v 2 v 3 x 1 Vertex points v 1, v 2, v 3, Edge points x 1, x 2, x 3 After one round of subdivision, all vertices have degree six, except for vertices coming from original vertices of degree different from six. The limit surface is C 2 -continuous except at extraordinary - points. FSP-Seminar, Graz, November 2005 36
Example for Loop s Scheme Input mesh k = 1 k = 2 k = 2 Limit FSP-Seminar, Graz, November 2005 37