You are on page 1of 137

Geometric Modelling

2 1 0 -1 1

-1 -1 0 1 2

Lecture in Winter Term by G. Greiner Transscript by J. Kaminski Revision by S. Bergler

ii

iii

Contents

1 General Remarks on Curves and Surfaces 2 Polynomial Curves 2.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Different Basis of . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Lagrange Polynomials . . . . . . . . . . . . . . . . . 2.2.2 Bernstein Polynomials . . . . . . . . . . . . . . . . . 2.2.3 Comparison of Lagrange and Bernstein Representation 2.2.4 Change of Basis . . . . . . . . . . . . . . . . . . . . 2.3 Polar Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Bzier Curves 3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Shape Properties for Bzier Curves . . . . . 3.2 Algorithms for Bzier Curves . . . . . . . . . . . . . 3.2.1 The de Casteljau Algorithm . . . . . . . . . 3.2.2 The de Casteljau Subdivision Algorithm . . . 3.2.3 How to draw a Bzier Curve . . . . . . . . . 3.2.4 Degree Elevation . . . . . . . . . . . . . . . 3.2.5 Degree Reduction . . . . . . . . . . . . . . . 3.3 Bzier Splines . . . . . . . . . . . . . . . . . . . . . 3.3.1 Construction of complex Curves . . . . . . 3.3.2 -Continuity of two Bzier Curves . . . . . 3.3.3 Geometrical Construction of continuous Joins 3.3.4 Interpolation with Bzier Splines . . . . . . .

1 3 3 4 4 5 7 7 8 11 11 13 15 15 17 18 19 21 23 23 24 26 28 31 31 34 35 36 37 38 41 41 45 45 47 48

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

4 B-splines 4.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 B-spline Curves . . . . . . . . . . . . . . . . . . . . . . . 4.2.1 Shape Properties of B-spline Curves . . . . . . . . 4.2.2 Comparison of B-Spline and Bzier Curves . . . . 4.3 Control Points and Polar Forms . . . . . . . . . . . . . . . 4.4 Multiple Knots . . . . . . . . . . . . . . . . . . . . . . . 4.5 Algorithms for B-spline Curves . . . . . . . . . . . . . . . 4.5.1 The de Boor Algorithm . . . . . . . . . . . . . . . 4.5.2 Conversion of B-spline Curves into Bzier Splines 4.5.3 The Boehm Algorithm . . . . . . . . . . . . . . . 4.5.4 Knot Deletion . . . . . . . . . . . . . . . . . . . . 4.5.5 Subdivision for uniform B-spline curves . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

Contents
4.6 Interpolation and Approximation . . . . . . . . . . . . . . . 4.6.1 B-spline Interpolation . . . . . . . . . . . . . . . . 4.6.2 Special case: Cubic spline interpolation at the knots 4.6.3 B-spline approximation . . . . . . . . . . . . . . . . 4.6.4 Parametrization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

iv 51 51 52 54 55 57 57 58 59 59 61 62 64 65 67 67 68 70 72 74 77 77 78 79 79 80 82 83 83 83 84 84 84 85 87 91 91 92 95 96 96

5 Rational Curves 5.1 Rational Bzier Curves . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1.1 Properties of rational Bzier curves . . . . . . . . . . . . . . . 5.1.2 Evaluation of rational Bziercurves . . . . . . . . . . . . . . . 5.1.3 Inuence and properties of the weights . . . . . . . . . . . . . 5.1.4 Quadratic rational Bzier Curves as Conic Sections . . . . . . . 5.1.5 Segments of Conic Sections as quadratic rational Bzier Curves 5.1.6 Rational Bzier-Spline Curves . . . . . . . . . . . . . . . . . . 5.2 Rational B-Spline Curves (NURBS) . . . . . . . . . . . . . . . . . . . 6 Elementary Differential Geometry for Curves 6.1 Reparametrization . . . . . . . . . . . . . . . . 6.2 Planar Curves . . . . . . . . . . . . . . . . . . 6.3 Space Curves . . . . . . . . . . . . . . . . . . 6.4 Geometric and Parametric Continuity . . . . . 6.4.1 Geometric Continuity of Bzier Curves 7 Tensor Product Surfaces 7.1 General Approach . . . . . . . . . . . . . . . . 7.2 Tensor Product Bzier Surfaces . . . . . . . . . 7.3 Algorithms for TP Bzier Surfaces . . . . . . . 7.3.1 Evaluation with the TP Approach . . . 7.3.2 The direct de Casteljau Algorithm . . 7.4 Tensor Product B-Spline Surfaces . . . . . . . 7.5 Algorithms for TP B-Spline Surfaces . . . . . . 7.5.1 Evaluation of TP B-Spline Surfaces . . 7.5.2 Knot insertion . . . . . . . . . . . . . 7.6 Interpolation and Approximation . . . . . . . . 7.6.1 General interpolation . . . . . . . . . . 7.6.2 Special case: Interpolation at the knots 7.7 Trimming of parametric Patches . . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

8 Ray Tracing of TP-Bzier Surfaces (Bzier Clipping) 9 Triangular Bzier Patches 9.1 Barycentric Coordinates in . . . . . . 9.2 Bernstein Polynomials over Triangles . . 9.3 Triangular Bzier Patches . . . . . . . . . 9.4 Algorithms for Triangular Bzier Patches 9.4.1 The de Casteljau Algorithm . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

v 9.4.2 Degree Elevation . . . . . . . . . . . . . . . . . . . . 9.4.3 Subdivision . . . . . . . . . . . . . . . . . . . . . . . -Continuity of Triangular Bzier Patches . . . . . . . . . . Interpolation with piecewise Bzier Triangles (Split Surfaces) 9.6.1 Clough-Tocher . . . . . . . . . . . . . . . . . . . . . 9.6.2 Powell-Sabin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents
. . . . . . . . . . . . 96 97 100 102 102 103 105 105 109 111 111 112 112 115 117 120 121 121 124

9.5 9.6

10 Triangle meshes 10.1 Basics . . . . . . . . . . . . . . . . . . . . . 10.2 Computer representation of triangle meshes . 10.3 Parametrization of triangle meshes . . . . . . 10.3.1 The spring modell . . . . . . . . . . 10.3.2 Parametrization of the border vertices 10.3.3 Parametrization of the inner vertices .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

11 Subdivision Surfaces 11.1 Approximative schemes: Loop-Subdivision . . . . . . . . . . . . 11.2 Interpolatory schemes: Modied Buttery-Subdivision . . . . . . 11.3 Limit points for approximative subdivision . . . . . . . . . . . . . 11.3.1 Limit points for the subdivision of cubic splines . . . . . . 11.3.2 Limit points for the subdivision of regular triangle meshes

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

Contents

vi

vii

List of Figures
1.1 1.2 2.1 2.2 2.3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 4.12 4.13 Curves in the plane and in space . . . . . . . . . . . . . . . . . . . . . . . . . A torus and a free form surface . . . . . . . . . . . . . . . . . . . . . . . . . .
Quadratic Lagrange polynomials with respect to paramter values and . . Bernstein polynomials for , and . . . . . . . . . . . . . . . Polar Form of a Curve of degree . . . . . . . . . . . . . . . . . . . . . .

1 1 5 6 10 12 13 14 15 15 16 18 19 19 19 20 22 24 25 26 27 27 29 31 32 32 33 35 35 35 36 39 42 42 43 43

A Bzier curve . . . . . . . . . . . . . . . . . . . . . Convex hull . . . . . . . . . . . . . . . . . . . . . . . Variation diminishing property . . . . . . . . . . . . . de Casteljau schemas for and . . . . . . . Graphical representation of the de Casteljau algorithm Evaluation of with de Casteljau . . . . . . . . . . Left partial curve after de Casteljau subdivision . . . . Multiple subdivision . . . . . . . . . . . . . . . . . . Recursive subdivision . . . . . . . . . . . . . . . . . . ........... Degree elevation . . . . . . . . . . . Degree elevation ........... Degree reduction Joins of Bzier curves . . . . . . . . . . . . . . . . . . Join conditions in the de Casteljau algorithm . . . . . . de Casteljau conditions for - and -continuity . . . -continuation of the standard parabola . . . . . . . . -join of several cubic Bzier segments . . . . . . . . Interpolation with Catmull-Rom Splines . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A knot vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-splines for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-splines for The B-spline . . . . . . . . . . . . . . . . . . . . . . . . . . Local convex hull . . . . . . . . . . . . . . . . . . . . . . . . . . . control points coincide . . . . . . . . . . . . . . . . . . . . . control points on a line . . . . . . . . . . . . . . . . . . . . . control points on a line . . . . . . . . . . . . . . . . . . B-splines over a knot vector with multiplicities (emphasized: ) . Bzier representation of a B-spline curve with endpoint interpolation Evaluation schema of the de Boor algorithm for . . . . . . . Visualization of the coefcients for the de Boor algorithm ( ) . Example for the de Boor algorithm (1): coefcients . . . . . . . . .

List of Figures
4.14 4.15 4.16 4.17 4.18 4.19 4.20 4.21 4.22 5.1 5.2 5.3 5.4 5.5 5.6 6.1 6.2 6.3 6.4 6.5 6.6 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 8.1 8.2 8.3 8.4 8.5 9.1 9.2 9.3 9.4 9.5 9.6 Example for the de Boor algorithm (2): evaluation . . . . . . . Example for the de Boor algorithm (3): graphical construction Schema for the Boehm algorithm . . . . . . . . . . . . . . . . Example for the Boehm algorithm . . . . . . . . . . . . . . . Knot insertion at . . . . . . . . . . . . . . . . . . Geometrical construction: cutting the corners . . . . . . . . . Subdivision with open knot vector and . . . . . . . . . Illustration of parameter values . . . . . . . . . . . . . . . . . Chordal parametrisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

viii 44 44 46 47 48 49 50 51 56 57 58 59 60 61 64 68 69 71 72 73 75 77 78 80 80 81 83 83 85 85 86 87 88 89 90 90 92 93 93 95 96 97

Homogeneous coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . Interpretation of rat. curves with homogeneous coordinates (proj. ) de Casteljau scheme for rational Bzier curves . . . . . . . . . . . . . . . . Effect of the weights ( ) . . . . . . . . . . . . . . . . . . . . . . . . . Conic sections: ellipsis, parabola und hyperbola . . . . . . . . . . . . . . . Intersection of a cone with a pyramid and projection of the intersection line Arc length . . . . . . . . . . . The 2D Frenet frame . . . . . The 3D Frenet frame . . . . . Spiral . . . . . . . . . . . . . Continuity of Bzier splines . Generalized A-frame property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A tensor product Bzier surface . . . . . . . . . . . . . . . Parameter grid, control net and resulting surface . . . . . . . de Casteljau scheme for tensor product Bzier surfaces . . . Bilinear interpolation . . . . . . . . . . . . . . . . . . . . . Direct de Casteljau scheme . . . . . . . . . . . . . . . . . . Knot insertion with the Boehm algorithm . . . . . . . . . . Building a hierarchical knot grid for B-spline patches . . . . Trimming a patch . . . . . . . . . . . . . . . . . . . . . . . Specifying inner and outer contours in the parameter domain Determining inside and outside of a trimmed patch . . . . . Bzier clipping, step 1 . . . Bzier clipping, step 2 . . . Bzier clipping, step 3 . . . Bzier clipping, steps 5 and 6 Bzier clipping, step 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Barycentric coordinates . . . . . . . . . . . . . . . . . . . . Divide ratios and barycentric coordinates . . . . . . . . . . for Bernstein polynomials Arrangement of indices Triangular control nets for and . . . . . . . . . de Casteljau scheme for triangular Bzier patches . . . . . . . . . . . . . . . . . . . . . Degree elevation

ix 9.7 9.8 9.9 9.10 9.11 9.12 9.13 10.1 10.2 10.3 10.4 10.5 10.6 10.7 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 Splitting triangles: 1-to-2 and 1-to-4 split . . . . A control net and the rst 1-to-4 subdivision step Farin-Prautzsch 1-to-4 subdivision scheme . . . . Attaching two Bzier triangles continuously . . . Diamond condition for . . . . . . . . . . Clough-Tocher split surface scheme . . . . . . . Powell-Sabin split surface scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

List of Figures
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 98 99 100 101 102 103 105 106 107 107 108 108 114 115 117 117 118 119 120 120 121 122 123

1-neighbourhood and 2-neighbourhood of a vertice . . . . . . . . . . . . . . not possible in manifold triangulations . . . . . . . . . . . . . . . . . . . . . . open and closed fan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Moebius Strip and Klein Bottle . . . . . . . . . . . . . . . . . . . . . . . . . . Tetrahedron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Two-torus: surface of genus 2 . . . . . . . . . . . . . . . . . . . . . . . . . . A local part of a triangular mesh (a) is mapped into the plane by expontial mapping (b) and the local weights are determined (c). . . . . . . . . . . . . . . . .

1-to-4 split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . mask for the calculation of odd and even vertices . . . . . . . . . . . . . . . . masks for the calculation of irregular even vertices . . . . . . . . . . . . . . . Loop-Subdivision: top: coarse triangle mesh, bottom: after 1 subdivision step . Loop-Subdivision: top: after 2 steps, bottom: after 3 steps . . . . . . . . . . . Buttery: Mask for the calculation of the odd vertices . . . . . . . . . . . . . . one irregular neighbour vertice with valence 3, 4 and 5 . . . . . . . . . . . . . 4-point-scheme for boarder vertices . . . . . . . . . . . . . . . . . . . . . . . Buttery-Subdivision: top: coarse triangle mesh, bottom: after 1 subdivision step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.10Buttery-Subdivision: top: after 2 steps, bottom: after 3 steps . . . . . . . . .

List of Figures

xi

Bibliography
[1] C. de Boor. A Practical Guide to Splines (Applied Mathematical Sciences Vol. 27). Springer, Heidelberg 1987 [2] M. do Carmo. Differential Geometry of Curves and Surfaces. Prentice Hall, Englewood Cliffs, 1976 [3] J. Hoschek, D. Lasser. Grundlagen der geometrischen Datenverarbeitung. Teubner, Stuttgart, 1992 [4] G. Farin. Curves and Surfaces for Computer-Aided Geometric Design: A Practical Guide. Academic Press, San Diego, edition, 1997 [5] L. Piegel. The NURBS Book. Springer, 1995

Bibliography

xii

1 General Remarks on Curves and Surfaces


A curve is a one-dimensional connected point set in a two-dimensional plane or in threedimensional space. It is at least piecewise smooth. A surface is a two-dimensional point set in three-dimensional space with the same properties.

Figure 1.1: Curves in the plane and in space

Distinguish between regular and free form (= non-regular) curves and surfaces. Regular curves are e. g. lines and line segments, circles and arcs; regular surfaces are e. g. triangles, rectangles, polygons in the plane and spheres, cylinders, cones and parts of them in 3D space. Non-regular curves and surfaces is everything else (e. g. fender or hood of a car).

Figure 1.2: A torus and a free form surface

There are three ways to describe curves and surfaces mathematically.

1 General Remarks on Curves and Surfaces


example circle: implicit

explicit
Graph of

parameterized

example sphere: implicit

explicit

parameterized

Graph von

Proposition: "Reasonable" curves and surfaces can be described (at least piecewise) in each of the tree ways. Note that and are not unique! Change of representation: : : Invert

and dene

Remark: reasonable means here: differentiable and

e. g.

: implicit function theorem. If the following statements are true, : solved to


continuous has continous partial derivations and and

can be

and it holds


All statements are also true for surfaces.
Remark:

regular forms (circles, straight lines, spheres, cones usw.) are mostly described explicitly free form geometries mostly parametric

2 Polynomial Curves
2.1 Basics

Polynomial of th degree:

set of all polynomials

If

, then is the degree of the polynomial

are coefcients of the polynomial


:
degree

Set of all polynomials of degree

Denition 2.1 (Polynomial Curve) A two-dimensional (three-dimensional, -dimensional) polynomial curve is a parameterized : curve

with


(2.1)

The set of all -dimensional polynomial curves of degree is denoted by . Example:

Evaluation with equation 2.1 requires multiplications and additions, thus it is of type . A smarter way to evaluate the equation is to save and reuse the intermediary results of the multiplication of the parameter . In this case we have multiplications and additions (complexity ). An even faster evaluation is possible using Horners Rule: Algorithm 2.1 (Horners Rule)

Complexity: with multiplications and additions. Pseudo code: for

end for

to do

2 Polynomial Curves

2.2

Different Basis of

Note that and are linear spaces (vector spaces).


(polynomial functions)

2D curve 3D curve D curve

Remark: The dimension of a space corresponds to the number of degrees of freedom in this space. These are the coefcients for polynomial functions.

The standard basis for is the monomial basis presented in the next sections. 2.2.1 Lagrange Polynomials

. Other possible basis for are

Denition 2.2 Given parameter values


is called the
th

. The polynomial

with

(2.2)

Lagrange1 polynomial of degree .

Theorem 2.1 The Lagrange polynomials

form a basis of :


Sketch of Proof:

(2.3)

Interpretation: The points are interpolated at parameter values . There is only one polynomial of th degree, that interpolates these points (number of conditions = number of unique solvable system of linear equations), therefore the Lagrange repdegrees of freedom resentation is unique. Example: Given

Joseph Louis de Lagrange (17361813)

2.2 Different Basis of

0.8

0.6

0.4

0.2

0.2

0.4

0.6

0.8

-0.2

Figure 2.1: Quadratic Lagrange polynomials with respect to paramter values

and

2.2.2

Bernstein Polynomials

Denition 2.3 The polynomial


(2.4)

is called the th Bernstein2 polynomial of degree . Additional agreement: , if or .


Remark: Properties of the binomial coefcients:
(1) denition: (2) recursive denition:

(3) Pascal triangle: recursion:

and symmetry:

Theorem 2.2 Properties of Bernstein polynomials: (1) (2) (3)


2

(Binomial Theorem:

(partition of 1)

(positivity)

Serge N. Bernstein, 1912

2 Polynomial Curves
(4) (5) (6)
1 0.8 0.6 0.4 0.2

6 (recursion)

(symmetry) has a maximum in at .



1 0.8 0.6 0.4 0.2

1 0.8 0.6 0.4 0.2

0.2

0.4

0.6

0.8

0.2

0.4

0.6

0.8

0.2

0.4

0.6

0.8

Figure 2.2: Bernstein polynomials for

and

Example:

Denition 2.4 (General Bernstein Polynomial) : Given the parametric interval

th

(2.5)

is called the

Bernstein polynomial for the interval

Theorem 2.2 holds also true. How we get the general Bernstein Polynomial:

Remark: Note that with is represented here in barycentric coordinates with respect to and .

Evaluating formula 2.3 at yields:

Theorem 2.3 The Bernstein polynomials

form a basis of :

(2.6)

7 2.2.3

2.2 Different Basis of


Comparison of Lagrange and Bernstein Representation

Different representations:

will be interpolated

will be interpolated

The location of or determine the shape of the curve somehow intuitively. This is not true for the monomial coefcients . 2.2.4 Change of Basis

How to switch from one representation to another? A general rule from Linear Algebra claims: Theorem 2.4 Given two linear combinations representing one vector

.
. . . . .

.
. . . . .

. . . . .

. . . . .

(2.7)

Proof:


Example:

Supplement: Afne Maps


Denition 2.5 A map

is called afne, if

(2.8)

2 Polynomial Curves

for all with . The linear combination is called afne combination in this holds true for all , then it is called convex combination. case. If additionally An afne map especially preserves afne combinations, i. e.


Denition 2.6 A map

(2.9)

is called multiafne, if for any xed arguments the map

is afne. (Diction: Example:


bi-afne,

(2.10)

tri-afne etc.)

is multiafne. is multiafne. is not multiafne.


exist such that

Theorem 2.5 (Characterization of Afne Maps) is afne a linear map and a translation vector
Remark: afne maps map lines onto lines parallelity is preserved division ratios are preserved angles are not preserved examples for afne maps: rotation, scaling, shearing

2.3

Polar Forms
with the

Theorem 2.6 (Polynomials and Polar Forms) For each polynomial of degree exists a unique map following properties: (1) is n-afne:


if

9 (2) is symmetric in each variable, i. e.


2.3 Polar Forms


(diagonal property) .

(3)

Diction: Example:

is the polar form (blossom) of


1 1


1 1

General formula for polynomials of degree in monomial representation:

:
(2.11)

Example:

Consider a degree 2 polynomial curve: ing way:

. This can be decomposed in the follow-

2 Polynomial Curves

10

Figure 2.3: Polar Form of a Curve of degree

Corollary 2.1 are coefcients with respect to the Bernstein basis. With degree we have coefcients , .

Corollary 2.2 This gives reason to a geometric construction to get the point corresponding to the curve param eter :

This geometric construction is called the de Casteljau algorithm. (see section 3.2.1).

11

3 Bzier Curves
3.1 Basics

Denition 3.1 (Bzier Curve) A polynomial curve

(3.1)

with the gereralized Bernstein polynomial is called Bzier curve1 of degree over . The points are called control points or Bzier points, the polygon formed by the control points is called control polygon.
Theorem 3.1 (Bzier Points and Polar Form) Given a polynomial of degree , the Bzier points with respect to

are (3.2)

Proof: Write as an afne combination of and :

Now we have:

decompose s

Pierre Bzier, 1966

3 Bzier Curves
Example: Given:

12

Figure 3.1: A Bzier curve

Theorem 3.2 (Derivative of a Bzier Curve) a Bzier curve over Let

. Then:

(3.3)

Proof: Consider

(i)

13

3.1 Basics

(ii)

Corollary 3.1


etc. for higher derivatives. 3.1.1

(3.4)

Shape Properties for Bzier Curves

Theorem 3.3 (Lemma of Bzier) For Bzier curve over (1) For curve point

we have:

, is contained in the closed convex hull of the control polygon. (The is a convex combination of the ).
the line .

Remark: A set of points is called convex, if for any two points

Figure 3.2: Convex hull

(2) End-point interpolation: and the last control point.

and

, i. e. the curve runs through the rst

(3) Tangency condition: In the end-points the curve is tangent to the control polygon. und

3 Bzier Curves
(4) Afne invariance: Let

14

an afne map, then

I. e. to transform the curve with the afne transformation , it is sufcient to transform the control points. (5) Variation diminishing property: A Bzier curve does not vary more than its control polygon. More precisely: For any hyperplane in (line in , plane in etc.), then

control polygon

Figure 3.3: Variation diminishing property

Proof: (1) convex hull: For

(2)

set

und

(Theorem 3.1, diagonal property of the polar form) (3)

because

sonst

The same for (4) Let

.
an afne map

(5) see [4].

15

3.2 Algorithms for Bzier Curves

3.2
3.2.1

Algorithms for Bzier Curves


The de Casteljau Algorithm

The de Casteljau algorithm is a method for evaluating Bzier curves. Given: control points . of a Bzier curve Algorithm 3.1 (de Casteljau)

Then:

is a point on the Bzier curve.


depend on parameter for

(3.5)

Remark: The points

Figure 3.4: de Casteljau schemas for

and

Sketch of Proof: The proof of theorem 3.1 on page 11 is just the application of de Casteljaus algorithm. Only the intermediate results are renamed:

Graphical representation of the de Casteljau algorithm for


and

Figure 3.5: Graphical representation of the de Casteljau algorithm

3 Bzier Curves

16

Example:

Bzier representation with respect to

Evaluation of

with de Casteljau at

Figure 3.6: Evaluation of

with de Casteljau

We can compute the polar form of any value using the de Casteljau algorithm. Note that due to the symmetry of the polar form, there are two possibilities. Find: (1)

de Casteljau: evaluate rst , then :


(2) symmetric variation: rst , then

17

3.2 Algorithms for Bzier Curves

Remark: The de Casteljau algorithm is stable (only evaluation of convex combinations). Complexity is (in contrast to with Horners rule). Improvement is possible by recursive subdivision.

3.2.2

The de Casteljau Subdivision Algorithm


Theorem 3.4 Let Dene:

a Bzier curve over

and

Bzier curve over Bzier curve over

where are points of the de Casteljau algorithm evaluated at . Then:

(3.6) is:

Proof: According to the proof of theorem 3.1 the left part of



3 Bzier Curves
( are Bzier points with respect to

18

). Similar for the right part.

. See gure 3.7 for evaluation of the Example: According to gure 3.5 set and de Casteljau algorithm. The control points of the Bzier curve over are .

Figure 3.7: Left partial curve after de Casteljau subdivision

By repeated subdivision (e. g. uniform subdivision at the midpoints) we get a sequence of polygons that converges fast to the Bzier curve. Lemma 3.1 Let Let

a -continuous curve (i. e. two times differentiable). a line dened by . Then:

(3.7)

(Proof follows from Taylor expansion.) Consequence: The uniform subdivision for Bzier curves converges (at least) quadratically.
Remark: The evaluation of Bzier curves at equidistant parameter values converges quadratically, too.

3.2.3

How to draw a Bzier Curve


.

Given: degree , , Find: polygon for piecewise linear approximation of

Algorithm 3.2 (1) Evaluate at parameter values with evaluation of Berstein polynomials). (2) Draw the polygon Example:

(e. g. with de Casteljau or by


Algorithm 3.3 (1) Subdivide Casteljau.

at the parametrical midpoint

in

and

using de

19

3.2 Algorithms for Bzier Curves

Figure 3.8: Multiple subdivision

(2) Continue recursively until a certain recursion depth . (3) Draw the control polygon of the last recursion step of (2).

Figure 3.9: Recursive subdivision

3.2.4

Degree Elevation

Theorem 3.5 Let Assume

a Bzier curve of degree over

as Bzier curve of degree over

. Then:
(3.8)

(where

Figure 3.10: Degree elevation

Proof: (i) Let

the -afne polar form of

(as polynomial of degree ).

3 Bzier Curves
Denition 3.2

20

(3.9)

(ii)

(a) afne in every (b) symmetric (c) diagonal

is the polar form of (as polynomial of degree ).


Example:

Figure 3.11: Degree elevation

Remark: The repeated degree elevation yields a sequence of polygons then converge slowly to the Bzier curve. One can use this fact to prove the variation diminishing property of Bzier curves (see [4]).

21 3.2.5 Degree Reduction

3.2 Algorithms for Bzier Curves

Given: a Bzier curve

Find: a representation with reduced degree:

This is not possible in general; therefore nd the best approximation . The degree elevation of . Find control points yields , where in general such that

1st Method of Solution: Evaluation of equation 3.8 yields:

Given: control points The new control points

This leaves a linear system to solve. Example:


are obtained as follows:


To receive the minimum we have to set the gradient of be written as

to zero. The partial derivatives of

can

with Then, the gradient of

is:

grad

We receive two sets of linear equations: one for the x-coordinate and one for the y-coordinate:

3 Bzier Curves
with the solution:

22

The Bzier curve with reduced degree is depicted in gure 3.12.

Figure 3.12: Degree reduction

2nd Method of Solution: Another method is based on the fact that degree elevation is a linear porcess, i. e. the control points of the degree-elevated curve can be obtained by an appropriate matrix multiplication on the initial control points. E. g., the degree elevation with the initial points of the degree elevated curve can be described by and the control points the following matrix:

To nd the degree reduction of a curve, one has to solve the linear system . In general, this is not possible (over-determined linear system). Therefore nd the best possible solution satisfying the condition .

Theorem 3.6 (Gauss Normal Equation) The best approximation for the unsolvable linear system

can be obtained by (3.10)

Proof:

min

min

23 To receive the minimum set the derivation to zero:

3.3 Bzier Splines

Remark: Due to the structure of can be solved very efciently. , the square matrix is tri-diagonal. Therefore, the linear system

Example:

(see gure 3.12)

Given: control points The following matrix

describes the degree elevation

To calculate the new control points use Gauss Normal Equation


with the result

3.3
3.3.1

Bzier Splines
Construction of complex Curves

To model more complex shapes with Bzier curves, there are two possibilities: Method 1: use a Bzier curve of high degree. This method may cause numerical problems. Method 2: split curve into several simple parts and represent every segment as a low degree Bzier curve. Denition 3.3 A Bzier spline is a piecewise polynomial curve. The segments are represented by Bzier curves.

3 Bzier Curves

24

Figure 3.13: Joins of Bzier curves

Problem: continuity of the joins? Discontinuities or non-differentiable joins cause nonsmoothness of the curve. Denition 3.4 Given two polynomial curves continuous at if Interpretation: 3.3.2

and

. Then the curves are


-continuous = continuous, no jumps -continuous = -continuous =


-continuous + same tangent vector -continuous + same osculating circle.

-Continuity of two Bzier Curves

Theorem 3.7 Let ,

. Then:
are

and

Bzier curves over


and

-continuous at

(3.11)

Proof: Any Bzier curve has a unique representation over every interval. (In this case we only .) Therefore consider over the interval , but in fact the curve has the domain we can dene curve over the interval without changing it:


. . .

25

3.3 Bzier Splines

. . .

are

-continuous at

for all

Remark:

Figure 3.14: Join conditions in the de Casteljau algorithm

3 Bzier Curves
3.3.3 Let (1) (2) Geometrical Construction of continuous Joins and like above and are are

26

-continuous
-continuous -continuous

. Then:
.

(3)

are

A-frame property:

Example: Given: standard parabola Find: continuation


? over

over

-continuity: -continuity:

Result: see gure 3.16


Figure 3.15: de Casteljau conditions for

and

-continuity

Remark: The gure 3.17 is fully described by the location of are B-Spline control points (see chapter 4). Note: The points

the endpoints and the intervals .

27

3.3 Bzier Splines

Figure 3.16:

-continuation

of the standard parabola


Figure 3.17:


-join

of several cubic Bzier segments

3 Bzier Curves
3.3.4 Interpolation with Bzier Splines

28

Given: Points

and parameter values

Find: A curve that interpolates the points at the corresponding parameter values, i. e. all must be on this curve. A simple idea are Catmull-Rom Splines 2 : nd a (e. g. cubic) Bzier curve between two neighbour points , specify the tangents (= derivatives) at the end points as follows:

(3.12)

(3.13) Theorem 3.8 If

, you get the control points of an interpolating Bzier curve as follows:


(3.14)

(3.15) Sketch of Proof:

Remark: Problem: What happens at the end points? 1st case: closed curve (i. e. 2
nd

).

case: open curve ( hold true.

). In this case the natural end conditions

and

29

3.3 Bzier Splines



Figure 3.18: Interpolation with Catmull-Rom Splines

When interpolating points, you have to consider the order (or topology = neighbourhood relation) of the points. Only if the points are uniformly distributed, you can assume that all parameter intervals have the ). In general, this is not true. length 1 (e. g.

E. Catmull, R. Rom. A Class of interpolating Splines, 1974

3 Bzier Curves

30

31

4 B-splines
4.1 Basics

B-spline curves are piecewise polynomial curves with built-in -continuity at the joins. Mainly we deal with curves of degree that are -continuous, e. g. a B-spline curve of degree 1 is piecewise linear and -continuous. Given: degree and a sequence of knots of control points of the curve. Thus, the knot vector .

where is the number denes parameter intervals


Figure 4.1: A knot vector

The B-spline basis functions are dened recursively by degree :


General recursion formula:

otherwise

Denition 4.1 (Normalized B-spline Basis Functions)



. . .

The are computed according to the follwing scheme:


. . .

otherwise

(4.1)

(4.2)


. . .


. . .

. . .

4 B-splines
Example: We choose the knot vector

32 ), i. e.

Figure 4.2: B-splines for

Figure 4.3: B-splines for

Remark: The B-spline is tangent-continuous at the joins.

33

4.1 Basics

Figure 4.4: The B-spline

Properties of B-splines (1)

is piecewise polynomial of degree .

(2) The support of : of intervals per section. (3) Positivity: (4) Partition of 1:

, i. e. the support consists

for

. for .

(5) The derivative of a basis function is given by


(4.3)

Proof by induction on k: initial condition: and are either or (see g. 4.2), and thus is either

or

(see g. 4.3). induction step: Inductional assumption: Equation 4.3 is true for Use the product rule to differentiate the basis function:

Substitute equation 4.3:


4 B-splines
Because of

34

, we obtain:

Example: Support for cubic B-splines:


. . .

. . .


. . .

4.2

B-spline Curves

Denition 4.2 Given: degree knot vector control points

or .

(4.4)

is called B-spline curve. The points control polygon.


1

are called control points or de Boor points 1. They form a

Carl de Boor, 1972

35 4.2.1 Shape Properties of B-spline Curves

4.2 B-spline Curves

Theorem 4.1 (Shape properties of B-spline curves) a B-spline curve of degree Let following properties hold true: (1) In general there is no endpoint interpolation.

over the knot vector .

Then the

(2) For , lies in the convex hull of the control points (local convex hull).

Figure 4.5: Local convex hull

(3) Local control: For

(4) If control points coincide, then the curve goes through this point and is tangent to the control polygon (Fig. 4.6).

the curve is independent of

for

and

Figure 4.6:

control points coincide

(5) If control points are on a line, then the curve touches this line (Fig. 4.7).

Figure 4.7:

control points on a line

4 B-splines
(6) If control points are on a line , then for segment of the curve coincides with (Fig. 4.8).

36

, i. e. a whole

Figure 4.8:

control points on a line

(7) Derivative:

mit

(4.5)

(8) If knots coincide, then a control point and is tangent to the control polygon. (9) If is an afne map, then:

, i. e. the curve goes through

(afne invariance).

(10) Variation diminishing property: If is a hyper plane in , then

control polygon

4.2.2

Comparison of B-Spline and Bzier Curves

Bzier Curves + control polygon gives an impression of the possible run of the curve + the run of the Bzier curve can be changed by the translation of control points but: control points have global inuence on the run of the Bzier curve more control number of control points depends on the degree of the Bzier curve points, i. e. more possibilities to inuence the run of the curve, only possible by degree elevation

37 B-Spline Curves

4.3 Control Points and Polar Forms

B-Spline curves do not have the disadvantages of Bzier curves. Geometric properties of Bzier curves like "convex hull" or "variation diminishing" are also valid for B-Spline curves. Additional advantages are: + B-Spline functions are dened locally + Translation of a control point has only local inuence on the run of the curve + Insertion of additional control points without degree elevation + Smoothness of the junction of adjoining segments can be inuenced "easily"

Basis Functions polynomial piecewise polynomial Bernstein polynomials

Curves Bzier curves B-spline curves

(normalized) B-splines over knots

Table 4.1: Review: curve schemes mentioned so far

4.3

Control Points and Polar Forms

Theorem 4.2 (Control points and forms) polar of degree over a knot vector Given: a B-spline curve . restricted to the interval is a polynomial curve and has a unique polar form . Then:

for

(4.6)

e. g. for

this means:

Special case: The Bzier representation of the curve segment over the interval can be obtained as usual by inserting the interval borders und into the polar form:

An application of this property is the conversion of a B-spline curve into a Bzier spline curve.

4 B-splines
Example: . In this segment,

38
. Consider the curve segment where is the polar form of the B-spline curve . Control points:


Bzier points of

Given: Find:

The Bzier points are obtained by construction of suitable afne combinations, e. g.


Similar computation for the other control points.

4.4

Multiple Knots

Multiple Knots are allowed, if the multiplicity of the knots is less or equal to the degree. Generalized knot vector:

(4.7)

Exception: The rst and last knot may have the multiplicity . We have to extend the denition of the B-spline basis functions to the case of multiplicities:


otherwise

(4.8)

The recursion formula reduces B-splines of degree

to B-splines of degree

39 (1) case

4.4 Multiple Knots

, i. e. the multiplicity of ist greater or equal to


(2) case

(4.9)
.

, i. e. the multiplicity of is greater or equal to


(3) case

(4.10)

, i. e. the multiplicity of is greater or equal to


Example:

(4.11)

Figure 4.9: B-splines over a knot vector with multiplicities (emphasized:

Using a knot vector with multiple knots, some B-spline basis functions can vanish: Example: Quadratic B-spline basis functions over does not exist!

Remark: The higher the multiplicity of the knots the smaller is the continuity (see Theorem 4.3).

Theorem 4.3 (Curry-Schoenberg) . These knots have multiplicities Given: a sequence of knots and the border knots , where the inner knots have the multiplicity

4 B-splines
have the multiplicity knots

40

The normalized B-splines of degree with respect to this knot vector make a basis of the follow -continuous ing space: is a polynomial of degree and is at the value , .

. Now consider this knot vector as a sequence of single

with the corresponding multiplicities

Remark: The most important special case are the proper splines, where

If we insert a new knot , the dimension of the space increases by 1, i. e. the space of all piecewise polynomial functions over the old knot vector is a linear subspace of that over the new knot vector.

Multiple Knots and Endpoint Interpolation The curves are to be at least -continious. So from Theorem 4.3 follows, that the maximal multiplicity of the knots may be . At the end points we can equate , because the curve does not depend on (see scheme on page 34: For , does not contribute to the computation of , but does). Therefore the maximum multiplicity allowed at the endpoints is . Theorem 4.4 (Endpoint interpolation) If an end knot has multiplicity , then the B-spline curve interpolates the corresponding control point and is tangent to the control polygon. Sketch of Proof: Consider a B-spline curve of th degree over the knot vector

Similar, it can be shown that Because of and Tangential property:

For the basis function for we obtain: This is the rst Bernstein polynomial of th degree with respect to the interval with .

with . the end points are interpolated.

since does not exist and . All the other basis functions must be zero at the parameter value (afne combination). So the line is the tangent to the Bzier curve at control point . Similar for .

41 Example:

4.5 Algorithms for B-spline Curves

. over this knot vector that lives on three not

We construct a piecewise polynomial curve vanishing parameter intervals:

control points: control points: control points:

Consider the interval

. B-spline control points that affect

are:

The Bzier representation of

is obtained as follows:

4.5

Algorithms for B-spline Curves

In this section,

is a B-spline curve of degree , where multiple knots are allowed.

over a knot vector

4.5.1

The de Boor Algorithm

The de Boor algorithm is a method for evaluating B-spline curves. Given: control points of a B-spline curve and knot vector and a parameter intervall . Find: value of at

4 B-splines

42

Figure 4.10: Bzier representation of a B-spline curve with endpoint interpolation

Algorithm 4.1 (de Boor)


with Then:

and

(4.12)

The evaluation scheme for the de Boor algorithm is depicted in Figure 4.12.The coefcients can be visualized as divide ratios of line segments (see Figure 4.11).

Figure 4.11: Evaluation schema of the de Boor algorithm for

Remark: The de Boor algorithm is the analogue to the de Casteljau algorithm for Bzier curves.

43

4.5 Algorithms for B-spline Curves


Figure 4.12: Visualization of the coefcients for the de Boor algorithm (

Example: (see g. 4.13, 4.14 and 4.15).


Figure 4.13: Example for the de Boor algorithm (1): coefcients

Now consider the following knot vector:

Here:

, and have all the multiplicity . Then:

This is the de Casteljau algorithm! Corollary 4.1 As we only consider afne transformations, assumption of the interval loss of generality.

is not a

4 B-splines

44

Figure 4.14: Example for the de Boor algorithm (2): evaluation

Figure 4.15: Example for the de Boor algorithm (3): graphical construction

45

4.5 Algorithms for B-spline Curves


If two neighbouring knots have the multiplicity , then the corresponding B-spline curve is a Bzier curve between these knots. By insertion of all knots until multiplicity we can construct the Bzier polygon.

4.5.2

Conversion of B-spline Curves into Bzier Splines

Given: B-spline curve

over a knot vector


Find: Bzier representation for each polynomial segment There are two possibilities: (1) Insert knots and (2) Use the polar form. Example: Knot vector: The control points
,

until both have the multiplicity .

. Consider interval .

are given.

To nd the Bzier points combinations, e. g.

and , construct suitable afne

4.5.3

The Boehm Algorithm

How can we insert a new knot into a knot vector without changing the curve? Insertion of knots is useful for: adding local detail as basis of other algorithms (e. g. de Boors algorithm for curve evaluation) to convert B-splines into Bzier splines. Insertion of an additional knot , lets say at .

, gives a new knot vector

With the theorem of Curry-Schoenberg (theorem 4.3) we get: every B-spline curve knot vector has also a unique representation over the knot vector .

over the

4 B-splines
How to compute the new control points algorithm. With theorem 4.2, we get from the given

46 ? An answer is given by the Boehm2

and also

. Then:

By construction of suitable afne combinations we get e. g.

The other control points are obtained similar. More general: Algorithm 4.2 (Boehm)

(4.13)

The coefcients can be visualized as divide ratios of line segments. In the following schema, there is , and .

Figure 4.16: Schema for the Boehm algorithm

Wolfgang Boehm, 1980

47 Example:

4.5 Algorithms for B-spline Curves

Figure 4.17: Example for the Boehm algorithm

Remark: According to Theorem 4.3 we can insert inner knots up to multiplicity to mulitplicity .

and at the end points up

Insertion of an existing knot (i. e. increasing the multiplicity of the knot to ) gives only new control points.

Insertion of knots until multiplicity makes the B-spline curve interpolate control points. This gives the de Boor algorithm to evaluate B-spline curves.

4.5.4

Knot Deletion

Knot deletion is the inverse process to knot insertion. In general, it is not possible to remove a knot without changing the curve. Therefore, try to remove a knot and nd a curve that is as close as possible to the original curve (see degree elevation degree reduction for Bzier curves). Knot insertion is a linear process:


such that

(4.14)

. Find control points Short: have to solve the linear system

is minimal. With theorem 3.6 we (4.15)

4 B-splines
and get

48

4.5.5

Subdivision for uniform B-spline curves

Intention: Create a series of polygons that converge fast to the curve. The subdivison of Bspline curves is achieved by insertion of many additional knots or by doubling the number of knots. Let

is called uniform knot vector. Insert new knots at

with

a B-spline curve of degree over the knot vector for every or simply . A knot vector with this property

Then:

Repeating this process gives a sequence of polygons that coverges fast to (compared with subdivision for Bzier curves). are obtained again with suitable afne combinations. For this gives Chaikins 3 The algorithm. Example 1: and knot vector with multiplicity at the endpoints Knots are inserted where the curve has full support, in this example at

over the new knot vector .

Figure 4.18: Knot insertion at


3

G. Chaikin, 1995

49

4.5 Algorithms for B-spline Curves

According to Figure 4.18 we obtain the following new control points:


Therefore we can calculate the new control points from old control points as follows:

for for

The graphical evaluation is also called "Corner Cutting". You can see the result after two steps of iteration in Figure 4.19.

Figure 4.19: Geometrical construction: cutting the corners

Example 2: and open knot vector e.g. Evaluation according to the following scheme (see Figure 4.20):

for for

4 B-splines

50

Figure 4.20: Subdivision with open knot vector and

For the algorithm is more complicated, as new control points can depend on up to three old control points: Example 3: and knot vector with multiplicity at the endpoints, control points Evaluation according to the following scheme:

for for

Example 4: and open knot vector, control points Evaluation according to the following scheme:

for

for

51

4.6 Interpolation and Approximation

4.6
Given:

Interpolation and Approximation

Remark: The given points are to be interpolated / approximated at the parameter values . Imagine the knot vector is the time axis and the parameter the time: The curve we want to nd, should run through the point at time (see Figure 4.21).

data points with corresponding parameter values an -dimensional space with basis functions over a knot vector Find: Curve that interpolates / approximates the data points

Figure 4.21: Illustration of parameter values

There are three cases to distinguish: (1) (2) (3)

tion/approximation 4.6.1 Given:

: number of conditions = number of degrees of freedom interpolation : overdetermined system of equations approximation : underdetermined system of equations "constrained" interpola-

B-spline Interpolation

In matrix notation:

points with parameter values an -dimensional space: with knot vector Find: control points such that the curve , i. e. the given points at the parameter values

interpolates .


. . .

. . .

. . .

. . .

(4.16)

4 B-splines
Therefore, the interpolation problem is always solvable in case the matrix ible.
Remark: Matrix has at most non-zero entries per row (support of :

52 is invert-

).

Matrix is a band diagonal matrix. There are efcent numerical methods to solve a linear system consisting of a band diagonal matrix and a vector.

Theorem 4.5 (Schoenberg-Whitney)

Matrix A is invertible

Proof: See [1]. A choice of the parameter values Theorem 4.5 are the Greville abscissas. Denition 4.3 The parameter values
Remark: For the Greville abscissas holds:

that always fullls the requirements of

are called Greville abscissas.


have multiplicity

fullls , if all inner knots in .

. Reason for this:

Applications typically only give the , but no parameterization. In this case, choose a parameterization that is suitable for the application.

4.6.2 Given:

Special case: Cubic spline interpolation at the knots

degree

a -dimensional space

data points knot vector

Find: cubic B-spline curve That means: we choose those knots as parameter values that lie in the area where the curve has full support. Then the conditions of Theorem 4.5 are fullled. But the number of conditions is smaller than the number of degrees of freedom. Hence for the uniqueness of the curve we need additional conditions.

over with

53 Possible additional conditions: (1) Specication of tangents at the end points: (2) Natural end condition:

4.6 Interpolation and Approximation


):

(3) In the case of closed curves (i. e. The degrees of freedom are used to create

-continuity at the point

Example 1: Interpolation at the knots of an arbitrary knot vector by a cubic spline with additional condition 2

Linear system to solve:


.. .


.. .

..

. . .

. . .

Example 2: Interpolation at the knots of an end point interpolating knot vector

by a cubic spline with additional condition 2


4 B-splines

54

analogue:

The linear system that we have to solve is derived by modication of the linear system of Example 1:


.. .

..

. . .

. . .

Example 3: Interpolation at the knots of an end point interpolating and uniform knot vector by a cubic spline with additional condition 2 The linear system is:

with

..

..

. . . . . . . . .

. . . . . . . . .

Remark: In the case of end point interpolating splines the matrix

is tridiagonal (see Example 2 and 3).

4.6.3

B-spline approximation

If there are given more data points than control points available in the -dimensional space, is overdethen interpolation of the data points is usually impossible. The linear system termined and therefore not solvable.

55

4.6 Interpolation and Approximation

We can use the Gauss Normal Equation (Theorem 3.6) to minimize the error it, to approximate the data points at the best:

and with

derivation

is minimal

Thus, the approximation has exactly one solution if and only if the matrix
exists

is invertible:

Theorem of Schoenberg-Whitney is fullled columns of are linear independent

4.6.4

Parametrization

An important item of interpolation and approximation of data points is the choice of the parameter values (parametrization). By choosing a proper parametrization great deections and loops of the curve can be avoided in some degree. The easiest way to determine the is to set . This is called the uniform or equidistant parametrization. The disadvantage is the disregard of the position of the data points. For this reason the interpolating curve will have unwanted loops and deections in most cases. Interpretation: Imagine the parameter value is the time. Because of the -continuity the speed and the acceleration is continuous. On account of the uniform parametrization large distances between data points must be managed in the same time as distances between data points that are close to each other. Therefore the speed is higher between points with large distance, but speed and acceleration are continuous and we receive loops and deections of the curve between data points with short distance. One way to take the positions of the data points into account is to choose the distance of the parameters proportional to the distance of the data points:

with

uniform for This parametrization is called

centripetal for chordal for

The chordal parametrization is depicted in Figure 4.22: The distances between the parameter values and are equal to the distances between the data points und . Afne transformation does not change the parametrization. Hence, the parameter values can determined as follows for a given interval :

for

4 B-splines

56

Figure 4.22: Chordal parametrisation Remark: It is also possible to choose the knot vector case:

depending on the parameter values . Cubic

57

5 Rational Curves
A more general approach are rational curves. Using the polynomial curves we have examined so far it is not possible to represent conic sections (e. g. circle arcs). This becomes possible if we extend the schemes to rational curves. Of special interest in this chapter are rational Bzier curves and rational B-spline curves (NURBS). A rational curve can be described in two ways: as a quotient of polynomials as central projection of a -dimensional curve onto a -dimensional plane. Example: A two-dimensional point is extended by another dimension to and can be represented by a line through the origin:

Figure 5.1: Homogeneous coordinates

By projection onto the plane

(division by ) we get back the 2D point.

Remark: This representation is called homogeneous coordinates. The aim is to represent -dimensional afne maps as linear homogeneous transformations (i. e. matrices) in the -dimensional space.

5.1

Rational Bzier Curves

Denition 5.1 (Rational Bzier curve) is the projection of a polynomial Bzier curve in A rational Bzier curve in Denition 5.2 (Rational Bzier curve, analytic denition) Given: control points

(e. g. )

(projections of the -dimensional control points

5 Rational Curves

58

Figure 5.2: Interpretation of rat. curves with homogeneous coordinates (proj.

weights

(homogeneous component of the control points) We can assume without loss of generality: Then:

(5.1)

is called rational Bzier curve over the interval . 5.1.1 Let Properties of rational Bzier curves
a rational Bzier curve and

(1) If all (2) (3)

, then we get the well known polynomial Bzier curves.

(convex hull property)

(endpoint interpolation)

(4) The curve is tangent to the control polygon in the endpoints. (5) Afne (even projective) invariance afne yields:


I. e. (6)

shows the variation diminishing property with respect to

59 5.1.2 Evaluation of rational Bziercurves

5.1 Rational Bzier Curves

The de Casteljau algorithm in homogeneous coordinates can be used to evaluate and subdivide the curve. 1st possibility: Evaluate de Casteljau in the next higher dimension and project the result onto the -plane. The computation is done according to the scheme in Figure 5.3.

(5.2)

Figure 5.3: de Casteljau scheme for rational Bzier curves

Problem: The Algorithm is numerically unstable if the weight differ very much. 2nd possibility: Rational de Casteljau algorithm

with 5.1.3

for

(5.3)

Inuence and properties of the weights

Theorem 5.1 (Effect and properties of the weights) the rational Bzier curve is equal to a polynomial Bzier (1) For curve. (2) Multiplication of all weights with a common factor does not change the curve. (3) More general: If for all ratios

const.

then the curve has the same shape but another parametrization. (4) Increasing the weight pulls the curve to the control point . Decreasing the weight pushes the curve away from the control point (see Figure 5.4).

5 Rational Curves
(5) In the limit case:

60

(5.4)

Remark: From the properties (2) and (3) follows that we can assume without loss of generality that (proof given in the exercices).

Figure 5.4: Effect of the weights (

Supplement: Conic Sections Denition 5.3 (Conic section) analytic: given a quadratic polynomial


quadratisch linear

konstant

then a conic section is dened as the point set


i. e. a conic section is the geometric: section of a plane with a double cone. The coefcients determine the type of the conic section.

The type of the conic section can be seen directly from the determinant of this matrix. Graph ellipsis parabola hyperbola Angle between cone axis and plane greater than cone opening equals cone opening less that cone opening determinant of

greater than 0 equals 0 less than 0

61

5.1 Rational Bzier Curves

Figure 5.5: Conic sections: ellipsis, parabola und hyperbola

Example:

unit circle standard parabola hyperbola

Conic sections can not be represented as polynomials but as rational functions. Theorem 5.2 Each rational quadratic Bzier curve is part of a conic section. For we have: ellipsis parabola hyperbola

and

Each part of a conic section can be represented as a rational quadratic Bzier curve. 5.1.4 Quadratic rational Bzier Curves as Conic Sections
over with

Theorem 5.3 Given: a rational quadratic Bzier curve


(5.5)

Choose coordinate system

such that

5 Rational Curves
Then:
is part of a conic section with the dening equation

62

Proof: Let

(5.6)

Thus, in the coordinate system

we have

and additionally:

(2) From equation 5.6 follows


and therefore

ellipsis parabola hyperbola

5.1.5 Given:

Segments of Conic Sections as quadratic rational Bzier Curves

conic section

63

5.1 Rational Bzier Curves


two points on the same component of branch of a hyperbola) with intersecting tangents. (e. g. on the same

Find: Representation of the corresponding segment of a conic section as a rational quadratic Bzier curve . Procedure: (1) Choose (2) Choose

as given.

as intersection point of the tangents and :

Intersection point: solve

(3) Express the given polynomial

in the coordinate system

with

Inserting this into gives a new polynomial (also of degree 2) with . describes the conic section in the coordinate system . (4) Determine the weight using equation 5.6

solutions

These are two equations for two variables comparison of the coefcients gives the

Example: Unit circle:

(1)

5 Rational Curves

64

(3)
(2)

(4) Comparison of coefcients to determine and :

Remark: For a circle arc of an arbitrary opening angle

we get

5.1.6

Rational Bzier-Spline Curves

A rational Bzier-spline curve is a curve that is composed of single rational Bzier curves. Example: Representation of the circle with four segments. Control points:

The weights are and (see example in the previous section). The corresponding 3D curve is the intersection curve of a cone (opened at top) with a pyramid (opened at bottom).

Figure 5.6: Intersection of a cone with a pyramid and projection of the intersection line Remark: The higher dimensional curve is not smooth while the projected curve is smooth. This is quite typical for rational spline curves. By projection one can gain differentiability!

65

5.2 Rational B-Spline Curves (NURBS)

Theorem 5.4 and with control points Given: Rational Bzier curves , and weights , . Additionally, set . The curve composed from and is continuously differentiable

(5.7)

Geometric interpretation: . Proof: We have can summarize:

divides the line segment from to

by the ratio

and

Because

, we

5.2 Rational B-Spline Curves (NURBS)

no local support rational polynomial rational Bzier curves Bzier curves

local support NURBS B-splines

Table 5.1: Summary: polynomial and rational curve schemes

NURBS = non-uniform rational B-spline. Denition 5.4 (Rational B-spline curve) A rational B-spline curve in is the projection of a B-spline curve in Denition 5.5 (Rational B-spline curve, analytic denition) Given: degree , knot vector , control points weights

with

5 Rational Curves
Then:

66

(5.8)

is called rational B-spline curve. Advantages: compared with rational Bzier-spline curves: of th degree

-continuity of rational B-spline curves

compared with B-spline curves: more degrees of freedom Disadvantages: is linearly dependent of the , but not of the . For tasks of approximation and interpolation NURBS are improper, because you cant build a linear system of equations.

67

6 Elementary Differential Geometry for Curves


We are not (really) interested in the parametric representation of curves but in the shape of a curve. What characterizes shape?

6.1

Reparametrization

Denition 6.1 (Regular curve) a differentiable curve . Then: is called regular Let is the (unique) tangent direction at the point . all .

for

Now we consider a reparametrization or parameter transformation of a regular curve:

Denition 6.2 (Equivalence of curves) Let and regular curves. Then: ) there exists a differentiable mapping (notation: all such that .

and

are called equivalent with for

Example:

Example: Arc length

Let

with , then:

a regular curve. If we denote the length of the curve segment

(6.1)

This leads to a nice parametrization (arc length parametrization). In this special case we have for all and therefore

for all

6 Elementary Differential Geometry for Curves

68

Figure 6.1: Arc length

Example: Circle:

Parameter transformation:

yields

Theorem 6.1 Every regular curve can be reparametrized by arc length parametrization. This can be achieved by the following parameter transformation: Let

then

(6.2)

is a reparametrization according to the arc length. Example: In the previous example we had

, thus

Remark: Bzier curves are rarely arc length parametrized.

6.2

Planar Curves

Denition 6.3 (2D Frenet frame) a regular parametric curve. Given: Let The local coordinate system

with

(6.3)

rotated by

(6.4)

is called 2D Frenet frame1 of


1

Jean Frdric Frenet (1816-1900)

69

6.2 Planar Curves

Figure 6.2: The 2D Frenet frame

Theorem 6.2 (Frenet) For the derivatives of and

the following holds:




The quantity

is called curvature of the curve.

For arc length parametrized curves:


curve bends to the left curve bends to the right

Sketch of Proof: The theorem states that and (respectively und ) are perpendicular; const., because from this is the case if and only if follows and const. This is true by the normalization of .
Remark:

is the radius of the osculating circle with the midpoint

Theorem 6.3 For a curve point

it holds true that

(6.5)

Example: Ellipsis:

6 Elementary Differential Geometry for Curves

70

Theorem 6.4 The curvature characterizes the curve uniquely short of rotation and translation. Additionally:

is a line segment. const.

is a circle arc (with radius

).

Remark: Distinguish between geometric and parametric properties of a curve. Geometric means independent of the parametrization. Example: geometric unit tangent vector Frenet frame curvature

curvature vector
tangent vector all derivatives

parametric

6.3

Space Curves

Denition 6.4 (3D Frenet frame) Given: curve . The local coordinate system

with

unit tangent vector main normal vector binormal vector (6.6)

shows the following properties:

is orthonormal

with the same orientation

is positively oriented (right handed system)

Theorem 6.5 (Frenet-Serret) For the derivatives the following holds:

(6.7)

71

6.3 Space Curves

Figure 6.3: The 3D Frenet frame

In matrix notation:

Denition 6.5 (Curvature and torsion)

curvature: torsion: Theorem 6.6 Formulas to compute

(6.8) (6.9)

and :

quantity

arc length parameter

arbitrary parameter

Example: Spiral: Derivatives:

(6.10)

6 Elementary Differential Geometry for Curves

72

Figure 6.4: Spiral

Remark: The osculating plane is curves). The normal plane is


(see osculating circle for planar

We have assumed throughout that )

are linearly independent! (i. e.

Theorem 6.7 (Base theorem for space curves) Curvature and torsion characterize a space curve uniquely short of rotation und translation. Additionally:

is a planar curve.

6.4

Geometric and Parametric Continuity


and are called (parametric)
.

Remember: continuity of composed Bzier splines Two polynomial curves at , if

-continuous

73

6.4 Geometric and Parametric Continuity

Figure 6.5: Continuity of Bzier splines

Denition 6.6 (Geometric continuity) Two polynomial curves and at , if the arc length parametrizations and
Remark:

are called (geometric)


are -continuous.
-continuity does not!

-continuous

-continuity depends on parametrisierung ab,

Theorem 6.8 (Charakterization of geometric continuity) The following statements are equivalent: (1) and are or -continuous can be reparametrized such that and (or and ) are -continuous.

(2) either

(3) There exist constants


(Beta-constraints) such that

(6.11)

Proof: Let and parameter transformations such that


: continuous.

and : Assume:

are and

-continuous

F and

und

. are


. . .

are

-continuous at .

Note that

In matrix notation:


. . .


. . .

..

6 Elementary Differential Geometry for Curves


(3)

74

(2): Dene locally by


Remark: Normally, of interest are only:


fr

6.4.1

Geometric Continuity of Bzier Curves and the interval lengths

Given: Bzier curves

and

with
and

and

Theorem 6.9 (Characterization of Equivalent are: (1) (2) and and are

-continuity (tangent continuity))

-continuous

have the same tangent direction (i. e. the same tangent unit vector) at

(3) divide ratio:

Sketch of Proof: (1) (1)

(3): use equation for -constraints and

(2): follows from

Theorem 6.10 (Characterization of Equivalent are: (1) (2)

-continuity (curvature continuity))

and and

are

-continuous (

have the same unit tangent vector and the same curvature vector at )

(3) There exist constants holds.

with

such that the generalized A-frame property

75

6.4 Geometric and Parametric Continuity

Figure 6.6: Generalized A-frame property

Sketch of Proof: (1)

and and for the control points


(3): Use -constraints:

generalized A-frame condition:


respectively

6 Elementary Differential Geometry for Curves

76

77

7 Tensor Product Surfaces


7.1 General Approach

Given: two curve schemes in 3D space:

and

with scalar basis functions and . The tensor product of these schemes is:


2 1 0 -1 1

(7.1)

-1 -1 0 1 2

Figure 7.1: A tensor product Bzier surface

Of special interest are: Denition 7.1 (Tensor Product Bzier Surface)

(7.2)

Denition 7.2 (Tensor Product B-Spline Surface)


(7.3)

with knot vectors

and

7 Tensor Product Surfaces


Remark: We can factorize:

78

Each xed gives a control point of the curve

The tensor product surface is a curve of curves!

With the same approach we get rational tensor product Bzier and B-spline surfaces: consider a TP Bzier or a TP B-spline surface in 4D space (homogeneous coordinates) and divide by the component. This gives:

Denition 7.3 of a tensor product surface is called the control net of the surface The array of control points (analogon of control polygon for curves).

Figure 7.2: Parameter grid, control net and resulting surface

7.2

Tensor Product Bzier Surfaces

Given: a tensor product (TP) Bzier surface

Theorem 7.1 (Shape properties of TP Bzier surfaces) (a) Convex hull property: convex hull for

(b) Interpolation of the four corners of the control net:

79

7.3 Algorithms for TP Bzier Surfaces

(c) Tangency in the corner points, e. g. the tangent plane at and .

is spanned by

(d) The boundary curves are Bzier curves, their control points are the boundary points of the is Bzier curve). control net (e. g. (e) Afnce invariance (f) Variation diminishing property does not hold! Sketch of Proof: afne invariance: combination:

must be a barycentric (afne)

convex hull:

and

is a convex combination.

7.3
7.3.1 Given:

Algorithms for TP Bzier Surfaces


Evaluation with the TP Approach

TP Bzier surface parameter values , Proceeding:

(1) Apply the univariate de Casteljau algorithm in -direction times:


(2) Apply the univariate de Casteljau algorithm in -direction once:

or rst in -direction, afterwards in -direction. The evaluation with the TP approach rst in -direction, then in -direction is depicted in Figure 7.3. Choice of the best order of evaluation (smallest number of needed arithmetic operations): If

: rst in -, afterwards in -Richtung If : rst in -, afterwards in -Richtung

7 Tensor Product Surfaces

80

Figure 7.3: de Casteljau scheme for tensor product Bzier surfaces

7.3.2

The direct de Casteljau Algorithm

Idea: use bilinear interpolation instead of linear interpolation. Theorem 7.2 (Bilinear interpolation formula)

(7.4)

Figure 7.4: Bilinear interpolation

The bilinear interpolation formula (see Figure 7.4) is applied to the whole control net in the direct de Casteljau Algorithm (see Figure7.5). Therefore the evaluation scheme looks like a three-dimensional pyramid.

81 Algorithm 7.1 (Direct de Casteljau)

7.3 Algorithms for TP Bzier Surfaces

(7.5)

Then:

Figure 7.5: Direct de Casteljau scheme

Problem: If you have to use the univariate de Casteljau algorithm on from a certain step. This makes the implementation considerably more difcult. Comparison of direct de Casteljau and TP approach according to the number of convex combinations (CC): TP approach CC CC

direct de Castejau CC CC

In practice the TP approach is used, because it is more efcient and you dont have to do any distinction of cases.
Remark: Other algorithms like degree elevation or subdivision can be derived from the corresponding algorithms for curves.

7 Tensor Product Surfaces

82

7.4
Given:

Tensor Product B-Spline Surfaces

knot vector knot vector

array of control points

surface


Theorem 7.3 (Shape properties of TP B-spline surfaces) (a) Local convex hull property:

convex hull

(b) Afne invariance (c) Endpoint interpolation: if

then

and

In this case: tangency in the corner points, and the boundary curves are B-spline curves with the boundary points of the control net as curve control points. The tangential plane at the corners is spanned by the control points, e. g. .

(d) Local control: a control point has inuence only on a part of the surface. Changing will change
only for

(e) Variation diminishing property does not hold!


Remark: Remember from curves: a Bzier curve is a special case of a B-spline curve. A Bzier curve over the interval with the control points is a B-spline curve over the knot vector with the same control points. The same property holds true for tensor product surfaces.

83

7.5 Algorithms for TP B-Spline Surfaces

7.5
7.5.1

Algorithms for TP B-Spline Surfaces


Evaluation of TP B-Spline Surfaces

with knot vectors and . Given: The proceeding is similar to the TP approach of TP Bziersurfaces:

(1) Evaluate B-Spline curves of degree with de Boor in -direction. (2) Evaluate one B-Spline curve of degree with de Boor in -direction. 7.5.2 Knot insertion

The Boehm knot insertion algorithm for increasing modelling parameters (i. e. control points) in a local area will produce overhead, because the renement of the control net can only be done by adding new rows and columns.

Figure 7.6: Knot insertion with the Boehm algorithm

One alternative are hierarchical B-splines (by Forsey and Bartels, Siggraph88). In this solution, a B-spline surface is composed of a patch over a coarse parameter grid and, local detail dened over a locally rened parameter grid. You can see in Figure 7.7 that the grid is rened only where needed.

Figure 7.7: Building a hierarchical knot grid for B-spline patches

7 Tensor Product Surfaces

84

7.6
7.6.1 Be

Interpolation and Approximation


General interpolation

. Consider

as basis functions

Task: Interpolation/approximation of data points

with parameter values

Interpolation and approximation are exactly the same as for Bzier and B-Spline curves. Problem: For curves we have the Theorem of Schoenberg-Whitney, that says if the interpolation/approximation matrix is invertable. But there is no comparable theorem for surfaces.

7.6.2

Special case: Interpolation at the knots

Interpolation over grids: Given: data points with parameter values Find: surface

for with

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

The resulting matrix system is very large. For for example you have to do operations. Therefore the following proceeding is better:

(1) Solve (2) Solve

Tasks (1) and (2) are interpolation problems of curves, for whom the corresponding algorithms can be applied. Interpolation at the knots: If , then tasks (1) and (2) are tridiagonal matrices and therefore solvable in a fast way.

85

7.7 Trimming of parametric Patches

7.7

Trimming of parametric Patches

One disadvantage of tensor product Bzier and B-spline surfaces is that all patches are squarelike; it is not possible to model surfaces that does not have a well-dened tangent plane (i. e. if ).

Figure 7.8: Trimming a patch

A solution are trimmed patches. Specify a set of closed contours in the parameter are inner contours (see Figure 7.9). By domain, where is the outer contour and denition: shall belong to the trimmed surface if is inside with respect to and is outside with respect to
.

Figure 7.9: Specifying inner and outer contours in the parameter domain

How to determine if a point is inside or outside the trimmed surface (see Figure 7.10)? Theorem 7.4 Given: a closed contour is inside even.

a ray emanating from intersects the contour times with being odd. is outside a ray emanating from intersects the contour times with being

with

7 Tensor Product Surfaces

86

Figure 7.10: Determining inside and outside of a trimmed patch

87

8 Ray Tracing of TP-Bzier Surfaces (Bzier Clipping)


In this chapter, we want to discuss an algorithm to compute intersections between rational tensor product Bzier surfaces and rays. In particular, this is important for rendering Bzier patches using the ray tracing approach. For more information see Nishita et al., Siggraph90. Given: rational TP Bzier patch

(8.1)

Find: intersection, i. e. nd and such that

ray

Remark: This problem is analytically solvable only for low polynomial degrees. Therefore an iterative approximation algorithm as presented here is normally a better approach.

1st step: Represent the ray as an intersection of two planes:

Figure 8.1: Bzier clipping, step 1

Example: Select plane normal vectors that are perpendicular to and . Then determine :

, e. g. and by applying

8 Ray Tracing of TP-Bzier Surfaces (Bzier Clipping)


2nd step: Find intersection of

88

We get

with the two planes:



with

and


Remark: This is a projection of

and

along onto a plane that is perpendicular to .

Figure 8.2: Bzier clipping, step 2

3rd step:

89 Choose two directions in space:

direction direction

perpendicular to direction, perpendicular to direction,


const. const.

In case of a biquadratic patch:

Figure 8.3: Bzier clipping, step 3

Alternate the directions and and iterate on the following steps: 4th step: Determine the (signed) distances of the projected control points to . This gives a Bzier representation of the distance-to- -function that can be used to determine the distance of an arbitrary point to :

5th step: Plot the values 6th step: Determine the convex hull of the points in this diagram (by connecting maxima and minima of the columns) and intersect it with the -axis. This gives an interval .

in a - -diagram (see gure 8.4)

8 Ray Tracing of TP-Bzier Surfaces (Bzier Clipping)

90

Figure 8.4: Bzier clipping, steps 5 and 6

7th step: Clip away the parametric domain and Casteljau algorithm for Bzier patches).

by two subdivision steps (using the de

Switch direction and repeat steps 4 to 7. The parameter values of the . intersection point must be within the box

Stop when the size of the box is smaller than a threshold value or the convex hull in step 6 does not intersect with the axis; this indicates that there is no intersection of and .

Figure 8.5: Bzier clipping, step 7

91

9 Triangular Bzier Patches


The tensor product surfaces discussed in the previous chapter have been dened over rectangular parameter domains. Now we will consider Bzier patches dened over triangular parameter domains. There are two major advantages: triangles give more topological exibility tensor product surfaces have high polynomial degree, e. g. a biquadratic TP patch has actually degree 4 (see table below for all monomials occurring in a biquadratic TP patch).


9.1 Barycentric Coordinates in

Normally, a point is given by an origin and two directions and such that . We call and the standard coordinates of with respect to the coordinate system . Now we introduce another type of 2D coordinates based on three points: Denition 9.1 (Barycentric coordinates) Given: Three points , and that are not on a line. An arbitrary point can be represented as an afne combination

The coefcients .

(9.1)

are called barycentric coordinates of with respect to the triangle

Theorem 9.1 Given: Triangle and point . The barycentric coordinates to are unique and can be determined by

of with respect

(9.2)

where

9 Triangular Bzier Patches


Sketch of Proof: Equation 9.1 can be rewritten as a linear system with tree variables:

92

So we have

and are linear dependent.


The formulas for and follow from Cramers rule.

Figure 9.1: Barycentric coordinates Remark: Because of coordinates also as ratios of areas, i. e.

we can represent the barycentric


is inside

and

If

then is the barycenter of

9.2

Bernstein Polynomials over Triangles

A 1-dimensional analogon to barycentric coordinates: if divides the interval such that then and . th The Bernstein polynomial of degree over the interval is dened as follows:

93

9.2 Bernstein Polynomials over Triangles

Figure 9.2: Divide ratios and barycentric coordinates

Denition 9.2 (Bernstein polynomial over triangles) Given: Point having barycentric coordinates with respect to a triangle , a triple of indices with degree and . Then:

(9.3)

is called a Bernstein polynomial over the triangle . Example:


Figure 9.3: Arrangement of indices

for

Bernstein polynomials

Theorem 9.2 The Bernstein polynomials of degree ).

form a basis of (= bivariate polynomials

Sketch of Proof: The number of Bernstein polynomials is , which is the dimension of bivariate polynomials of degree . Example: for we have 10 linear independent polynomials: . Theorem 9.3 (Properties of triangular Bernstein Polynomials) . (1) If is inside , then

9 Triangular Bzier Patches


(2) Partition of 1:

94

(9.4)

(3) Recursion:

(9.5)

Sketch of Proof: (1) follows from denition; (2)

if is inside

(3)

Similar for

and

Theorem 9.4 (Polar Forms in 2D) of degree there exists a unique polar form For each polynomial with is symmetric is multiafne, i. e.

is diagonal, i. e.

Example:

95

9.3 Triangular Bzier Patches

9.3

Triangular Bzier Patches


with

Denition 9.3 (Triangular Bzier Patch) Given: degree , parameter domain , points

. Then:
(9.6)

is called triangular Bzier patch over the triangle . The points are called control points or Bzier points. They form the control net.

Figure 9.4: Triangular control nets for

and

Theorem 9.5 (Control Points and Polar Form) Given: triangular Bzier patch

. Then: (9.7)

Sketch of Proof: Let Assume that , then

the barycentric coordinates of such that


Theorem 9.6 (Shape Properties of Triangular Bzier Patches) for (a) convex hull property: convex hull of (b) end point interpolation:

,

.
.

(c) end point tangency: e. g. the tangent plane at is

(d) The boundary curves are Bzier curves formed by the boundary control points. (e) afne invariance

9 Triangular Bzier Patches

96

9.4
9.4.1

Algorithms for Triangular Bzier Patches


The de Casteljau Algorithm
, we need the barycentric coordinates

To evaluate

of .

Algorithm 9.1 (de Casteljau for Bzier triangles)

(9.8)

Then:

with

Sketch of Proof: According to theorem 9.5, we have

This is a solution for the recursion formula, it leads to

Figure 9.5: de Casteljau scheme for triangular Bzier patches

9.4.2

Degree Elevation

As an example, we rst consider here the degree elevation from quadratic to cubic triangular Bzier patches:

To nd the

, we need a mapping for the polar forms


:
(9.9)

97

9.4 Algorithms for Triangular Bzier Patches

It is easy to see that this is symmetric, multiafne and diagonal, so Example:


is a polar form.

Figure 9.6: Degree elevation

Algorithm 9.2 (Degree elevation) Given: Bzier triangle


Find: control points

such that

(9.10)

9.4.3

Subdivision
into two triangles (1-to-2 split).

There are two possibilities to perform a subdivision for triangular Bzier patches: 1st possibility: divide E. g. dividing the line segment with gives

9 Triangular Bzier Patches


2nd possibility: divide
into four triangles (1-to-4 split, see gure 9.7).

98

Figure 9.7: Splitting triangles: 1-to-2 and 1-to-4 split

Figure 9.8: A control net and the rst 1-to-4 subdivision step

Algorithm 9.3 (1-to-2 split) Perform de Casteljau algorithm:

for . Then: the outer faces of the resulting tetrahedron are control points of the two subdivided triangles (see gure 9.5). Algorithm 9.4 (1-to-4 split, Farin-Prautzsch method) Perform four 1-to-2 splits with de Casteljau (see gure 9.9). Instead of subsequently using the de Casteljau algorithm for subdivision, it is also possible to pre-calculate the split points using polar forms:

99

9.4 Algorithms for Triangular Bzier Patches


Figure 9.9: Farin-Prautzsch 1-to-4 subdivision scheme

Example: If we want to split at

and

we get:

Supplement: Derivatives of Multivariate Functions


Considering multivariate (here: bivariate) functions, there are three types of derivatives: partial derivatives are and directional derivative: the derivative of is
at a certain point in direction

total derivative: the Jacobian matrix

For bivariate functions, the Jacobian matrix is a matrix with the dimension of the . space

9 Triangular Bzier Patches

100

9.5

-Continuity of Triangular Bzier Patches


and which have the parameter domains
and

Given: two Bzier triangles .

Figure 9.10: Attaching two Bzier triangles continuously

How to determine that and are -continuous along the edge ? Assume a point (and assume that and are also given in on the edge in cartesian coordinates cartesian representation).
: : :

and and

and

for all

and .

In general:

-continuity can be characterized using polar forms. Assume .


: :

and are polar forms of

and

. . .

. . .

101

9.5

-Continuity of Triangular Bzier Patches

for all . An equivalent condition for tions hold for .


:

-continuity:

holds and the above equa-

and .

for all In general:

. Equivalent:

holds and

Theorem 9.7 and with the parameter domains The Bzier triangles are -continuous if

and

(9.11)

for all

and

.
):

Geometric interpretation (for

is a representation of in barycentric coordinates with respect to . Then:


Figure 9.11: Diamond condition for

These quadrilaterals (highlighted in gure 9.11) are afne images of the parameter quadrilateral , therefore they have to be planar (diamond condition).

9 Triangular Bzier Patches

102

9.6

Interpolation with piecewise Bzier Triangles (Split Surfaces)

One application of triangular Bzier patches is the interpolation of scattered data points using smooth triangular surfaces. and corresponding data values . Given: data points Find: a smooth (i. e. . General procedure: 1st step: triangulate the set of data points, e. g. using Delaunay triangulation (see lecture on Graphical Algorithms for details). 2nd step: split each triangle. We want to discuss here two methods of splitting, the Clough-Tocher method that gives three cubic Bzier patches and the Powell-Sabin method that gives six quadratic Bzier patches. 3rd step: estimate the normal vectors (or partial derivatives) at each data point. These are used to determine the control points. 9.6.1 Clough-Tocher

) scalar function

that interpolates the given data, i. e.

Note that there exist many approaches to solve this problem.

Figure 9.12: Clough-Tocher split surface scheme

This is how the control points in gure 9.12 are obtained:

: Assume that the orthogonal derivative along an edge is linear and linearly interpolate
: specied by the directional derivatives obtained in 3 rd step. the orthogonal derivative at the end points.

: given data points .

103

9.6 Interpolation with piecewise Bzier Triangles (Split Surfaces)

: diamond condition at the interior edges for

: choose the barycenter of the triangle. 9.6.2 Powell-Sabin

-continuity

Figure 9.13: Powell-Sabin split surface scheme

Here, the control points according to gure 9.13 are obtained as follows:

: diamond condition at the outer edges for

: given data points .

: specied by the directional derivatives obtained in 3 rd step.

-continuity

: diamond condition at the interior edges for

: barycenters of the given triangles (incenters can also be used; the only condition is that has always the same barycentric coordinates with respect to its corresponding triangle).

-continuity

9 Triangular Bzier Patches

104

105

10 Triangle meshes
Triangle meshes are used for modelling geometric objects. The representation of triangles is supported by the graphics hardware and there are efcient algorithms. Triangle meshes consist of: a set of vertices a set of edges a set of triangles

with

10.1

Basics

Notations: For vertices the edges and triangles with For edges all triangles with

resp.

are called adjacent.

are called adjacent.

(1-)neighbourhood of a vertice: all adjacent triangles and the edges and vertices they consist of (see Figure 10.1) 2-neighbourhood of a vertice: neighbourhood of the neighbourhood (see Figure 10.1) n-neighbourhood: neighbourhood of the (

)-neighbourhood

valence of a vertice : number of adjacent edges resp. number of neighbour vertices

Figure 10.1: 1-neighbourhood and 2-neighbourhood of a vertice

We only consider manifold triangulation, i. e. triangle meshes with the following properties:

10 Triangle meshes
(1) The intersection of two different triangles is a common edge, a common vertice or empty. (see Figure 10.2)

106

Figure 10.2: not possible in manifold triangulations

107 (2) Edges have

10.1 Basics

one adjacent triangle

border edge oder two adjacent triangles inner edge.

(3) If the adjacent triangles of a vertice build a open fan (see Figure 10.3), the vertice is a vertice at the border: adjacent triangles closed fan (see Figure 10.3), the vertice is a inner vertice: adjacent triangles

Figure 10.3: open and closed fan

(4) orientable surfaces, i.e. the normals can be oriented constantly no Moebius Strips and Klein Bottles (see Figure 10.4)

Figure 10.4: Moebius Strip and Klein Bottle

(5) The triangle is connected

the border edges build a close polygon.


Example: Tetrahedron

10 Triangle meshes

108

Figure 10.5: Tetrahedron

Theorem 10.1 (EULER formula for general polyhedrons) If is the number of vertices, the number of edges, the number of faces, the genus of the surface (number of holes (see Figure 10.6)) and the number of border polygons die Anzahl der Randpolygone, we have:

Figure 10.6: Two-torus: surface of genus 2

Example: sphere: tetrahedron: torus:


109

10.2 Computer representation of triangle meshes

For the estimation of the required memory of a triangle mesh the following theorem is important. Theorem 10.2 For large triangle meshes holds: Proof: i) Each triangle has 3 edges, each inner edge belongs to 2 triangles. ii)

(because the genus and the number of border polygons is vanishing in large triangle meshes)

10.2

Computer representation of triangle meshes

The information of triangle meshes consists of geometry: where are the vertices, edges and triangles? topology: how are the vertices connected to edges and triangles? This information should be suitably stored for the application and as efcient as possible.
Remark: In the following holds:

Below there are presented three possible representations of triangle meshes in the computer: (1) explicit representation For all triangles the vertices oats

are stored.

Remark: Maximal redundant, because the geometry is multiply stored.

(2) "shared vertex" or "indexed face set" list of coordinates of all vertices

list of all triangles by referencing the vertex list, i. e. for integers


Remark:

oats

we store

Efcient because geometry and topology is separated. Therefore it is suitable for archiving the data. Edges are only stored implicitly. Explicit access is difcult.

10 Triangle meshes
Frequent operations are expensive (e. g. access to the neighbour of a vertex). Vertices of the triangles are normally stored counter clockwise.

110

(3) extended shared vertex list of vertices with reference to one adjacent triangle. (convention for border vertices: right border triangle) oats integers list of triangles with reference to adjacent triangles (at the border: integers

Remark: The extended shared vertex structure is suitable especially for the processing triangle meshes. E. g. neighbour vertices can be found easily because of the stored lists.

Example: tetrahedron (1) explicit data structure

0 1 2 3 (2) shared vertex structure

1.0, 1.0, 1.0 1.0, 1.0, 1.0 1.0, 1.0, 1.0 1.0, -1.0, -1.0

-1.0, 1.0, -1.0 -1.0, -1.0, 1.0 1.0, -1.0, -1.0 -1.0, -1.0, 1.0

-1.0, -1.0, 1.0 1.0, -1.0, -1.0 -1.0, 1.0, -1.0 -1.0, 1.0, -1.0

0 1 2 3

1.0 -1.0 -1.0 1.0

1.0 1.0 -1.0 -1.0

1.0 -1.0 1.0 -1.0

0 1 2 3 0 0 0 3 1 2 3 2 2 3 1 1

111 (3) extended shared vertex structure

10.3 Parametrization of triangle meshes

0 1 2 3

1.0 -1.0 -1.0 1.0

1.0 1.0 -1.0 -1.0

1.0 -1.0 1.0 -1.0

0 0 0 1

0 1 2 3 0 0 0 3 1 2 3 2 2 3 1 1


3 3 3 0 1 2 0 2 2 0 1 1

10.3

Parametrization of triangle meshes

Given: data points Find: parameter values for which the angles and splitting ratios of the triangle mesh are preserved. Notations:

border points:

(indices of) neighbour of : 10.3.1 The spring modell

In order to parameterize the inner points we use the spring modell from physics. Interpretation: Springs are attached to the inner points and xed along the edges at the neighbour points. The springs are idealised and have the minimum size 0. The mesh is getting at and the springs are as minimal tensed as possible. Parameterization of data points by spring modells requires the minimization of a quadratic functional. That corresponds to solving a linear system of equations. The spring equation is:

Minimization:


sonst

10 Triangle meshes

112


with

Remark:


sonst

. . .

. .

is invertible because it is diagonal dominant.

Proceeding of parameterization: (1) parameterization of the border vertices (2) parameterization of the inner vertices 10.3.2 Parametrization of the border vertices

First the border vertices of the triangle mesh have to be parameterized by one of the following possibilities. i) method for curves over a circle ii) specify corners and parameterize over a polygon with corners iii) projection of the border vertices onto the least squares plane
Remark: It is possible that method iii) leads to convolutions of the border polygon. The projected border polygon is not convex necessariliy.

10.3.3

Parametrization of the inner vertices

Given: vertices Find: parameter values

, which fulll the following:

(1) identity property: parameterization is identical with the triangle mesh, that has been pressed into the plane. (2) regularity resp. no convolutions

113 Choice of the a) :

10.3 Parametrization of triangle meshes

are called

uniform parametrization zentripetal parametrization chordal parametrization

Disadvantage: If the given triangle mesh lies in a plane, the mesh is getting deformed. The parameterization does not fulll (1), but (2). b) discret harmonic parameterization

Disadvantage: parameterized triangle mesh might be convoluted. The parameterization fullls (1), but not (2). c) shape preserving parameterization: fullls (1) and (2) i) Flattening of the 1-neighbourhood of a inner point v by exponential map (see Figure 10.3.3 (a) and (b)):

and

and

with

ii) determine by averaging the barycentric coordinates (see Section 9.1) For each we nd one , so that , with i. e. all other (see Figure 10.3.3 (c)) Finally: Dieses ist das zwischen den Punkten und . Es ist klar, dass i)

denn f"ur alle gilt

10 Triangle meshes
ii)

114

ist damit Konvexkombination der


Remark: Diese sind i. d. R. nicht symmetrisch, d. h.

(a)

(b)

(c)

Figure 10.7: A local part of a triangular mesh (a) is mapped into the plane by expontial mapping (b) and the local weights are determined (c).

115

11 Subdivision Surfaces
Motivation: Comparison TP-Surfaces - Triangle Meshes TP-Surfaces memory requirements smooth surface display on screen free forms complex forms + + Triangle Meshes + + +

Subdivision surfaces are a compromise between TP-surfaces and triangle meshes. In the following, we learn that Subdivision Surfaces offer a good possibility for surface modelling (e. g. in movies). The modelling process consists of two steps: First build a coarse triangle mesh of the object, then apply several subdivision steps. We receive a smooth surface, which is - or -continuous in the limit and interpolates or approximates the original mesh. Basic idea: 1-to-4 split (see Figure 11.1)

Figure 11.1: 1-to-4 split

Analogously: subdivision of curves useful terms: "old" points: even vertices "new" points: odd vertices There are two kinds of subdivision schemes: (1) interpolative subdivision: Even vertices are kept, odd vertices are added. (2) approximative subdivision: Also the position of the even vertices changes.

11 Subdivision Surfaces
Remark: The more subdivision steps, the smaller the triangles (and the smoother the surface). In the limit (after subdivision steps): smooth surface

116

Advantages and disadvantages of subdivision surfaces: + arbitrary topology + scalability + compromise between triangle meshes and TP-surfaces + numerical stability + code simplicity + adaptivity no simple method with global

-continuity in the limit

artifacts at vertices with high valence Objectives for the development of subdivision schemes: efcient calculation of even and odd vertices simplicity and locality of this rules afne invariance

convex combinations

continuity of the limit surface

117

11.1 Approximative schemes: Loop-Subdivision

11.1

Approximative schemes: Loop-Subdivision

The Loop-Subdivision scheme is approximative. It is the most simple subdivision scheme. Even and odd vertices in regular triangle meshes are calculated with the following masks: odd vertices:

even vertices:

odd

even

at the boarder:

at the boarder:

odd

even

Figure 11.2: mask for the calculation of odd and even vertices

For irregular even vertices the Loop-Subdivision uses the scheme in Figure 11.3.

with and

valence of

Figure 11.3: masks for the calculation of irregular even vertices

At regular vertices the limit surface of the Loop-Subdivision scheme is -continuous. At irregular vertices it is -continuous. You can see a triangle mesh and three Loop-Subdivision steps in the Figures 11.4 und 11.5.

11 Subdivision Surfaces

118

Figure 11.4: Loop-Subdivision: top: coarse triangle mesh, bottom: after 1 subdivision step

119

11.1 Approximative schemes: Loop-Subdivision

Figure 11.5: Loop-Subdivision: top: after 2 steps, bottom: after 3 steps

11 Subdivision Surfaces

120

11.2

Interpolatory schemes: Modied Buttery-Subdivision

Buttery-Subdivsion is a interpolatory scheme. It reaches -continuity of the limit surface. It only needs one rule for the calculation of the odd vertices, because the even vertices are interpolated. Inner points:

(1) regular neighbour vertices

Figure 11.6: Buttery: Mask for the calculation of the odd vertices

(2) one irregular neighbour vertice

k = 3:


k 5:

k = 4:

Figure 11.7: one irregular neighbour vertice with valence 3, 4 and 5

(3) two irregular neighbour vertices Use mask from (2) for both neighbours and average the results
Remark: Case 3 is only possible in the rst subdivision step.

121

11.3 Limit points for approximative subdivision

Figure 11.8: 4-point-scheme for boarder vertices

Boarder vertices: At the border the 4-point-scheme for curves is applied (Figure 11.8). You can see a triangle mesh and three Buttery-Subdivision steps in the Figures 11.9 und 11.10.

11.3

Limit points for approximative subdivision

In this section subdivision is written as a linear process. By analysing the so-called subdivision matrix the position of the vertices on the limit surface and propositions about the continuity of the limit surface can be deduced. 11.3.1 Limit points for the subdivision of cubic splines

The formulas for subdividing cubic splines from section 4.5.5 example 4 for open knot vectors are applied. These formulas for the calculation of the shifted vertices can be displayed in matrix form as follows:

By repeated insertion we get:

We have to know the matrix for the calculation of the limit points. Therefore we have to diagonalize the subdivision matrix S:

11 Subdivision Surfaces

122

Figure 11.9: Buttery-Subdivision: top: coarse triangle mesh, bottom: after 1 subdivision step

123

11.3 Limit points for approximative subdivision

Figure 11.10: Buttery-Subdivision: top: after 2 steps, bottom: after 3 steps

11 Subdivision Surfaces
R: matrix consisting of eigenvectors D: eigenvalues of the diagonal matrix

124

Remark: The subdivision matrix of good subdivision schemes for curves has the eigenvalues

11.3.2

Limit points for the subdivision of regular triangle meshes

Analogously to curves:

Subdivision matrix:

. . . . . .

. . . . . .

. . .

..

..

..

125

11.3 Limit points for approximative subdivision

In the same way as for curves we diagonalize the subdivision matrix. The eigenvalues of the matrix are . In the limit we receive the following subdivision matrix and the limit point of :

. . . . . .

. . .

. . .

. . .

. . .

. . .

Remark: Eigenvalue criterias for the determination of the continuity of the limit surface for Eigenvalues of the subdivision matrix

-continuous

-continuous -continuous

The analysis of the Loop scheme for irregular vertices and the Buttery scheme for all vertices only yields -continuity.

You might also like