geometric modelling

137
Geometric Modelling -1 0 1 2 -1 0 1 2 -1 0 1 -1 0 1 2 -1 0 1 2 Lecture in Winter Term by G. Greiner Transscript by J. Kaminski Revision by S. Bergler

Upload: nandyji6062

Post on 20-Nov-2014

313 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Geometric Modelling

Geometric Modelling

-1

0

1

2

-1

0

1

2

-1

0

1

-1

0

1

2

-1

0

1

2

Lecture in Winter Termby G. Greiner

Transscript by J. KaminskiRevision by S. Bergler

Page 2: Geometric Modelling

ii

Page 3: Geometric Modelling

iii

Contents

1 General Remarks on Curves and Surfaces 1

2 Polynomial Curves 32.1 Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Different Basis of�� . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.2.1 Lagrange Polynomials .. . . . . . . . . . . . . . . . . . . . . . . . . 42.2.2 Bernstein Polynomials .. . . . . . . . . . . . . . . . . . . . . . . . . 52.2.3 Comparison of Lagrange and Bernstein Representation . .. . . . . . . 72.2.4 Change of Basis . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 7

2.3 Polar Forms . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 Bézier Curves 113.1 Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.1.1 Shape Properties for Bézier Curves .. . . . . . . . . . . . . . . . . . 133.2 Algorithms for Bézier Curves . .. . . . . . . . . . . . . . . . . . . . . . . . . 15

3.2.1 The de Casteljau Algorithm . . . . .. . . . . . . . . . . . . . . . . . 153.2.2 The de Casteljau Subdivision Algorithm . . .. . . . . . . . . . . . . . 173.2.3 How to draw a Bézier Curve . . . . .. . . . . . . . . . . . . . . . . . 183.2.4 Degree Elevation . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 193.2.5 Degree Reduction . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 21

3.3 Bézier Splines . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.3.1 Construction of “complex” Curves . .. . . . . . . . . . . . . . . . . . 233.3.2 ��-Continuity of two Bézier Curves .. . . . . . . . . . . . . . . . . . 243.3.3 Geometrical Construction of continuous Joins. . . . . . . . . . . . . . 263.3.4 Interpolation with Bézier Splines . . .. . . . . . . . . . . . . . . . . . 28

4 B-splines 314.1 Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314.2 B-spline Curves . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

4.2.1 Shape Properties of B-spline Curves .. . . . . . . . . . . . . . . . . . 354.2.2 Comparison of B-Spline and Bézier Curves .. . . . . . . . . . . . . . 36

4.3 Control Points and Polar Forms .. . . . . . . . . . . . . . . . . . . . . . . . . 374.4 Multiple Knots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.5 Algorithms for B-spline Curves .. . . . . . . . . . . . . . . . . . . . . . . . . 41

4.5.1 The de Boor Algorithm .. . . . . . . . . . . . . . . . . . . . . . . . . 414.5.2 Conversion of B-spline Curves into Bézier Splines . . . .. . . . . . . 454.5.3 The Boehm Algorithm .. . . . . . . . . . . . . . . . . . . . . . . . . 454.5.4 Knot Deletion . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 474.5.5 Subdivision for uniform B-spline curves . .. . . . . . . . . . . . . . 48

Page 4: Geometric Modelling

Contents iv

4.6 Interpolation and Approximation . . .. . . . . . . . . . . . . . . . . . . . . . 514.6.1 B-spline Interpolation . . . .. . . . . . . . . . . . . . . . . . . . . . 514.6.2 Special case: Cubic spline interpolation at the knots . .. . . . . . . . 524.6.3 B-spline approximation . . . .. . . . . . . . . . . . . . . . . . . . . . 544.6.4 Parametrization .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5 Rational Curves 575.1 Rational Bézier Curves .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.1.1 Properties of rational Bézier curves . . . .. . . . . . . . . . . . . . . 585.1.2 Evaluation of rational Béziercurves . . . .. . . . . . . . . . . . . . . 595.1.3 Influence and properties of the weights . .. . . . . . . . . . . . . . . 595.1.4 Quadratic rational Bézier Curves as Conic Sections . . .. . . . . . . . 615.1.5 Segments of Conic Sections as quadratic rational Bézier Curves . . . . 625.1.6 Rational Bézier-Spline Curves. . . . . . . . . . . . . . . . . . . . . . 64

5.2 Rational B-Spline Curves (NURBS) .. . . . . . . . . . . . . . . . . . . . . . 65

6 Elementary Differential Geometry for Curves 676.1 Reparametrization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676.2 Planar Curves . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686.3 Space Curves . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706.4 Geometric and Parametric Continuity. . . . . . . . . . . . . . . . . . . . . . 72

6.4.1 Geometric Continuity of Bézier Curves . .. . . . . . . . . . . . . . . 74

7 Tensor Product Surfaces 777.1 General Approach. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777.2 Tensor Product Bézier Surfaces . . . .. . . . . . . . . . . . . . . . . . . . . . 787.3 Algorithms for TP Bézier Surfaces . .. . . . . . . . . . . . . . . . . . . . . . 79

7.3.1 Evaluation with the TP Approach . . . . .. . . . . . . . . . . . . . . 797.3.2 The “direct” de Casteljau Algorithm . . . .. . . . . . . . . . . . . . . 80

7.4 Tensor Product B-Spline Surfaces . .. . . . . . . . . . . . . . . . . . . . . . 827.5 Algorithms for TP B-Spline Surfaces .. . . . . . . . . . . . . . . . . . . . . . 83

7.5.1 Evaluation of TP B-Spline Surfaces . . . .. . . . . . . . . . . . . . . 837.5.2 Knot insertion .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

7.6 Interpolation and Approximation . . .. . . . . . . . . . . . . . . . . . . . . . 847.6.1 General interpolation . . . . .. . . . . . . . . . . . . . . . . . . . . . 847.6.2 Special case: Interpolation at the knots . .. . . . . . . . . . . . . . . 84

7.7 Trimming of parametric Patches . . .. . . . . . . . . . . . . . . . . . . . . . 85

8 Ray Tracing of TP-Bézier Surfaces (Bézier Clipping) 87

9 Triangular Bézier Patches 919.1 Barycentric Coordinates in�� . . . . . . . . . . . . . . . . . . . . . . . . . . 919.2 Bernstein Polynomials over Triangles. . . . . . . . . . . . . . . . . . . . . . 929.3 Triangular Bézier Patches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959.4 Algorithms for Triangular Bézier Patches . . . . .. . . . . . . . . . . . . . . 96

9.4.1 The de Casteljau Algorithm .. . . . . . . . . . . . . . . . . . . . . . 96

Page 5: Geometric Modelling

v Contents

9.4.2 Degree Elevation . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 969.4.3 Subdivision. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

9.5 ��-Continuity of Triangular Bézier Patches .. . . . . . . . . . . . . . . . . . 1009.6 Interpolation with piecewise Bézier Triangles (Split Surfaces) . .. . . . . . . 102

9.6.1 Clough-Tocher . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 1029.6.2 Powell-Sabin . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 103

10 Triangle meshes 10510.1 Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10510.2 Computer representation of triangle meshes .. . . . . . . . . . . . . . . . . . 10910.3 Parametrization of triangle meshes . . . . . .. . . . . . . . . . . . . . . . . . 111

10.3.1 The spring modell . . .. . . . . . . . . . . . . . . . . . . . . . . . . 11110.3.2 Parametrization of the border vertices. . . . . . . . . . . . . . . . . . 11210.3.3 Parametrization of the inner vertices .. . . . . . . . . . . . . . . . . . 112

11 Subdivision Surfaces 11511.1 Approximative schemes: Loop-Subdivision .. . . . . . . . . . . . . . . . . . 11711.2 Interpolatory schemes: Modified Butterfly-Subdivision . . . . . .. . . . . . . 12011.3 Limit points for approximative subdivision . .. . . . . . . . . . . . . . . . . . 121

11.3.1 Limit points for the subdivision of cubic splines . . . . . .. . . . . . . 12111.3.2 Limit points for the subdivision of regular triangle meshes. . . . . . . 124

Page 6: Geometric Modelling

Contents vi

Page 7: Geometric Modelling

vii

List of Figures

1.1 Curves in the plane and in space. . . . . . . . . . . . . . . . . . . . . . . . . 11.2 A torus and a free form surface .. . . . . . . . . . . . . . . . . . . . . . . . . 1

2.1 Quadratic Lagrange polynomials with respect to paramter values�� ��

and� . . 52.2 Bernstein polynomials for� � �, � � � and� � � . . . . . . . . . . . . . . . 62.3 Polar Form of a Curve of degree� � � . . . . . . . . . . . . . . . . . . . . . . 10

3.1 A Bézier curve . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2 Convex hull . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.3 Variation diminishing property .. . . . . . . . . . . . . . . . . . . . . . . . . 143.4 de Casteljau schemas for� � � and� � � . . . . . . . . . . . . . . . . . . . . 153.5 Graphical representation of the de Casteljau algorithm . . . . . .. . . . . . . 153.6 Evaluation of� ��� with de Casteljau . . . . .. . . . . . . . . . . . . . . . . . 163.7 Left partial curve after de Casteljau subdivision . . .. . . . . . . . . . . . . . 183.8 Multiple subdivision . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 193.9 Recursive subdivision . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 193.10 Degree elevation� � � � � � � . . . . . . . . . . . . . . . . . . . . . . . . 193.11 Degree elevation� � � � � � � . . . . . . . . . . . . . . . . . . . . . . . . 203.12 Degree reduction� � � � � � � . . . . . . . . . . . . . . . . . . . . . . . . 223.13 Joins of Bézier curves . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . 243.14 Join conditions in the de Casteljau algorithm .. . . . . . . . . . . . . . . . . . 253.15 de Casteljau conditions for��- and��-continuity . . . . . . . . . . . . . . . . 263.16 ��-continuation of the standard parabola . . .. . . . . . . . . . . . . . . . . . 273.17 ��-join of several cubic Bézier segments . . .. . . . . . . . . . . . . . . . . . 273.18 Interpolation with Catmull-Rom Splines . . .. . . . . . . . . . . . . . . . . . 29

4.1 A knot vector . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314.2 B-splines for� � � . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.3 B-splines for� � � . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.4 The B-spline� �

� ��� . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.5 Local convex hull .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.6 � � � control points coincide . .. . . . . . . . . . . . . . . . . . . . . . . . . 354.7 � � � control points on a line . .. . . . . . . . . . . . . . . . . . . . . . . . . 354.8 � � � � control points on a line . . . . . .. . . . . . . . . . . . . . . . . . 364.9 B-splines over a knot vector with multiplicities (emphasized:� �

� ) . . . . . . . 394.10 Bézier representation of a B-spline curve with endpoint interpolation . . . . . . 424.11 Evaluation schema of the de Boor algorithm for� � � . . . . . . . . . . . . . 424.12 Visualization of the coefficients for the de Boor algorithm (� � �) . . . . . . . 434.13 Example for the de Boor algorithm (1): coefficients .. . . . . . . . . . . . . . 43

Page 8: Geometric Modelling

List of Figures viii

4.14 Example for the de Boor algorithm (2): evaluation .. . . . . . . . . . . . . . . 444.15 Example for the de Boor algorithm (3): graphical construction .. . . . . . . . 444.16 Schema for the Boehm algorithm . . .. . . . . . . . . . . . . . . . . . . . . . 464.17 Example for the Boehm algorithm . .. . . . . . . . . . . . . . . . . . . . . . 474.18 Knot insertion at� � �

�� ��� ��

. . . . . . . . . . . . . . . . . . . . . . . . . . . 484.19 Geometrical construction: cutting the corners . . .. . . . . . . . . . . . . . . 494.20 Subdivision with open knot vector and� � � . . . . . . . . . . . . . . . . . . 504.21 Illustration of parameter values . . . .. . . . . . . . . . . . . . . . . . . . . . 514.22 Chordal parametrisation .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.1 Homogeneous coordinates . . . . . .. . . . . . . . . . . . . . . . . . . . . . 575.2 Interpretation of rat. curves with homogeneous coordinates (proj.����� ) . . 585.3 de Casteljau scheme for rational Bézier curves . . .. . . . . . . . . . . . . . . 595.4 Effect of the weights (� � �) . . . . . . . . . . . . . . . . . . . . . . . . . . . 605.5 Conic sections: ellipsis, parabola und hyperbola . .. . . . . . . . . . . . . . . 615.6 Intersection of a cone with a pyramid and projection of the intersection line . . 64

6.1 Arc length . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686.2 The 2D Frenet frame . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696.3 The 3D Frenet frame . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716.4 Spiral . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726.5 Continuity of Bézier splines . . . . .. . . . . . . . . . . . . . . . . . . . . . 736.6 Generalized A-frame property . . . .. . . . . . . . . . . . . . . . . . . . . . 75

7.1 A tensor product Bézier surface . . .. . . . . . . . . . . . . . . . . . . . . . 777.2 Parameter grid, control net and resulting surface . .. . . . . . . . . . . . . . . 787.3 de Casteljau scheme for tensor product Bézier surfaces . . . . .. . . . . . . . 807.4 Bilinear interpolation . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807.5 Direct de Casteljau scheme . . . . . .. . . . . . . . . . . . . . . . . . . . . . 817.6 Knot insertion with the Boehm algorithm . . . . .. . . . . . . . . . . . . . . 837.7 Building a hierarchical knot grid for B-spline patches . . . . . .. . . . . . . . 837.8 Trimming a patch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857.9 Specifying inner and outer contours in the parameter domain . .. . . . . . . . 857.10 Determining inside and outside of a trimmed patch. . . . . . . . . . . . . . . 86

8.1 Bézier clipping, step 1 .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878.2 Bézier clipping, step 2 .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888.3 Bézier clipping, step 3 .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898.4 Bézier clipping, steps 5 and 6 . . . . .. . . . . . . . . . . . . . . . . . . . . . 908.5 Bézier clipping, step 7 .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

9.1 Barycentric coordinates .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929.2 Divide ratios and barycentric coordinates . . . . .. . . . . . . . . . . . . . . 939.3 Arrangement of indices�� for � � � Bernstein polynomials . .. . . . . . . . 939.4 Triangular control nets for� � � and� � � . . . . . . . . . . . . . . . . . . . 959.5 de Casteljau scheme for triangular Bézier patches .. . . . . . . . . . . . . . . 969.6 Degree elevation� � � � � � � . . . . . . . . . . . . . . . . . . . . . . . . . 97

Page 9: Geometric Modelling

ix List of Figures

9.7 Splitting triangles: 1-to-2 and 1-to-4 split . .. . . . . . . . . . . . . . . . . . 989.8 A control net and the first 1-to-4 subdivision step . .. . . . . . . . . . . . . . 989.9 Farin-Prautzsch 1-to-4 subdivision scheme . .. . . . . . . . . . . . . . . . . . 999.10 Attaching two Bézier triangles continuously .. . . . . . . . . . . . . . . . . . 1009.11 “Diamond condition” for� � � . . . . . . . . . . . . . . . . . . . . . . . . . . 1019.12 Clough-Tocher split surface scheme . . . . .. . . . . . . . . . . . . . . . . . 1029.13 Powell-Sabin split surface scheme . . . . . .. . . . . . . . . . . . . . . . . . 103

10.1 1-neighbourhood and 2-neighbourhood of a vertice . . . . . . . . . . . . . . 10510.2 not possible in manifold triangulations . . . .. . . . . . . . . . . . . . . . . . 10610.3 open and closed fan. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10710.4 Moebius Strip and Klein Bottle .. . . . . . . . . . . . . . . . . . . . . . . . . 10710.5 Tetrahedron . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10810.6 Two-torus: surface of genus 2 .. . . . . . . . . . . . . . . . . . . . . . . . . 10810.7 A local part of a triangular mesh (a) is mapped into the plane by expontial map-

ping (b) and the local weights are determined (c). . .. . . . . . . . . . . . . . 114

11.1 1-to-4 split . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11511.2 mask for the calculation of odd and even vertices . .. . . . . . . . . . . . . . 11711.3 masks for the calculation of irregular even vertices .. . . . . . . . . . . . . . 11711.4 Loop-Subdivision: top: coarse triangle mesh, bottom: after 1 subdivision step . 11811.5 Loop-Subdivision: top: after 2 steps, bottom: after 3 steps . . . .. . . . . . . 11911.6 Butterfly: Mask for the calculation of the odd vertices. . . . . . . . . . . . . . 12011.7 one irregular neighbour vertice with valence 3, 4 and 5 . . . . . .. . . . . . . 12011.8 4-point-scheme for boarder vertices . . . . .. . . . . . . . . . . . . . . . . . 12111.9 Butterfly-Subdivision: top: coarse triangle mesh, bottom: after 1 subdivision

step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12211.10Butterfly-Subdivision: top: after 2 steps, bottom: after 3 steps . .. . . . . . . 123

Page 10: Geometric Modelling

List of Figures x

Page 11: Geometric Modelling

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, EnglewoodCliffs, 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

Page 12: Geometric Modelling

Bibliography xii

Page 13: Geometric Modelling

1

1 General Remarks on Curves and Surfaces

– A curveis a one-dimensional connected point set in a two-dimensional plane or in three-dimensional space. It is at least piecewise smooth.

– A surfaceis a two-dimensional point set in three-dimensional space with the same prop-erties.

Figure 1.1: Curves in the plane and in space

– Distinguish betweenregular andfree form(= non-regular) curves and surfaces. Regularcurves 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 3Dspace.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.

Page 14: Geometric Modelling

1 General Remarks on Curves and Surfaces 2

example circle:

implicit explicit parameterized

���� � � �� � � �� � � Graph of���� � ���� � �� � ��� �

�� � �� �� � � � �

�� � �� �� � � ��� � � ��� �

example sphere:

implicit explicit parameterized

���� � �� �

� �� � �� � �� � �

Graph von

���� � � ���� � �� � � � ��� �� �

��� � �� � � �� �� � �� � � � � �

� � � � �

��

� � �� �� � � �� �� � � �� ���

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

– ��� : � ��� �

������

– ��� : � ��� �

�����������

�Invert � �� ����� and define���� �� ����

��� ����.

Remark:“reasonable” means here: differentiable and����� �� �, e. g.� ����� �� �.

– ���: ���� � � � ����– ��� : implicit function theorem. If the following statements are true,���� � � � can be

solved to � ����:

– ���� � continuous

– ���� � has continous partial derivations����� � and����� �

– ����� �� � � and������ �� �� �

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

Page 15: Geometric Modelling

3

2 Polynomial Curves

2.1 Basics

– Polynomial of�th degree:���� � �� �� ���� ���� � � � �� � ��– � � � � set of all polynomials

– ��� � � � � �� � � are coefficients of the polynomial

– If �� �� �, then� is the degree of the polynomial

– Set of all polynomials of degree �: �� �� � � � � degree��� ��Definition 2.1 (Polynomial Curve)A two-dimensional (three-dimensional,�-dimensional)polynomial curveis a parameterizedcurve� �� � ���:

� ��� ������

�� � �� � �� �� � � � �� � �� 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, thusit is of type�����. A smarter way to evaluate the equation is to save and reuse the intermediaryresults of the multiplication of the parameter�. In this case we have�� multiplications and�additions (complexity����). An even faster evaluation is possible usingHorner’s Rule:

Algorithm 2.1 (Horner’s Rule)

� ��� � �� � � ���� � � ����� � � ����� � � � � � � � � ��Complexity:���� with � multiplications and� additions. Pseudo code:

� �� ��for � �� �� � to � do� �� � � � ��

end for

Page 16: Geometric Modelling

2 Polynomial Curves 4

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. Theseare the coefficients��� ��� ���� �� for polynomial functions.

The standard basis for�� is themonomial basis�� �� ��� � � � � ��. Other possible basis for�� arepresented in the next sections.

2.2.1 Lagrange Polynomials

Definition 2.2Given� � parameter values��� � � � � ��� � with �� � �� � � � � � ��. The polynomial

��� ��� ���

�� ���

�� ��� � � �

��� ������ ��� � � � ��� ������ � ������ � ��� � � � ��� � ��� � � � �� � � � � � (2.2)

is called the� th Lagrange1 polynomial of degree�.

Theorem 2.1The Lagrange polynomials��

� � ��� � � � � � �

�� form a basis of��:

� ��� ������

�� �� �

�����

��� ��� � �� � �� � � (2.3)

Sketch of Proof:

��� ��� �

��� � �

� � �� � � ���� � �� � � � �� � � � � �

Interpretation: The points�� are interpolatedat parameter values��. There is only one poly-nomial of�th degree, that interpolates these� � points (number of conditions = number ofdegrees of freedom� unique solvable system of linear equations), therefore the Lagrange rep-resentation is unique. �

Example: Given�� � �� �� ���� �� � �.

������ ��� �

� ���

�� �� ��� � � ��� �

�� ��� ��

1Joseph Louis de Lagrange (1736–1813)

Page 17: Geometric Modelling

5 2.2 Different Basis of��

������ ���� ��� ���� �

��� � �� � ��� ��

������ ���� �� �

��� �� ��� � � ��� �

��

0.2 0.4 0.6 0.8 1

-0.2

0.2

0.4

0.6

0.8

1

Figure 2.1: Quadratic Lagrange polynomials with respect to paramter values���� and�

2.2.2 Bernstein Polynomials

Definition 2.3The polynomial

��� ��� �

��

��� ��� ����� � � � �� � � � � � (2.4)

is called the� th Bernstein2 polynomial of degree�.Additional agreement:��

� �, if � � � or � � �.

Remark:Properties of the binomial coefficients:

(1) definition:���

��� ��

������

(2) recursive definition:���

��� ��

�������

��� ���

���

���

�(3) Pascal triangle: recursion:

�������

��� ����

�����

�and symmetry:

���

��� ����

Theorem 2.2Properties of Bernstein polynomials:

(1)��

������ ��� � �� ��� ���� (Binomial Theorem:�� ��� �

�����

���

������� )

(2)��

������ ��� � � (partition of 1)

(3) ��� ��� � � � � � ��� �� (positivity)

2Sergeı N. Bernstein, 1912

Page 18: Geometric Modelling

2 Polynomial Curves 6

(4) ��� ��� � � �����

��� ��� ��� �� ������ ��� (recursion)

(5) ��� ��� � �

������� �� (symmetry)

(6) ��� ��� has a maximum in��� �� at� � �

�.

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

0.2 0.4 0.6 0.8 1

0.2

0.4

0.6

0.8

1

Figure 2.2: Bernstein polynomials for� � �, � � � and� �

Example:

������ �

���

��� ��� ����� � ��� ���

������ �

���

��� ��� ����� � � � ��� ��

������ �

���

��� ��� ����� � ��

Definition 2.4 (General Bernstein Polynomial)Given the parametric interval� �� ��� ��:

� ��� ��� �

��� �����

���� ��� ��� ����� (2.5)

is called the� th Bernstein polynomial for the interval� � ��� ��.

Theorem 2.2 holds also true.

How we get the general Bernstein Polynomial:

� � ��� �� � ��� �� , ���� � �� ��

Evaluating formula 2.3 at���� yields: ��� ������ � �

��� ���

Remark:Note that� � � � �� ��� �� � with � � �� �� .

� is represented here inbarycentric coordinateswith respect to and�.

Theorem 2.3The Bernstein polynomials��

� � � � � � ��� form a basis of��:

� ��� ���

���

��� ��� � �� � �� � � (2.6)

Page 19: Geometric Modelling

7 2.2 Different Basis of��

2.2.3 Comparison of Lagrange and Bernstein Representation

Different representations:� ��� ��

� �� �� �

�� �� �

�� ��� �

�� ���

�� ���

– �� will be interpolated�� ��� ��

� �� ��� ��� � ��.

– ��� �� will be interpolated�� ��� ��

� ����� ��� � ���.

– The location of��� � � � ��� or ��� � � � ��� determine the shape of the curve “somehowintuitively”. This is not true for the monomial coefficients��.

2.2.4 Change of Basis

How to switch from one representation to another? A general rule from Linear Algebra claims:

Theorem 2.4Given two linear combinations representing one vector� �

�� �� �� �

�� � �� :�

��...��...

��� � �

���

...��...

��� �

���

...�...

��� � ��

���

...��...

��� (2.7)

Proof:

�� ��

�� �

���

���

�� � ��

���

�� ��

��

���

Æ �

� Æ ���

�� ��

Example:����

���

���

�� �

��� � �� �

� � ��� � �

������ �

��

��� �

��������

�� �

��� � � �

�� � �

� �� �

�������

��

��

��

Supplement: Affine Maps

Definition 2.5A map� � ���� is calledaffine, if

���

�� ��

����

�� ����� (2.8)

Page 20: Geometric Modelling

2 Polynomial Curves 8

for all �� with�

� �� � �. The linear combination�

� �� �� is calledaffine combinationin thiscase. If additionally�� � � holds true for all�, then it is calledconvex combination.

An affine map especially preserves affine combinations, i. e.

� ���� ���� ���� � ��� ������� ������ (2.9)

Definition 2.6A map� � �� �� is calledmultiaffine, if for any fixed arguments�� the map

� �� ������� � � � � ������ �� ������ � � � � ����� �� �� � (2.10)

is affine. (Diction: � � � “bi-affine”, � � � “tri-affine” etc.)

Example:

� � ���� ��� �� �� �� is multiaffine.

! � ���� ��� �� �� � �� is multiaffine.

" � ���� ��� �� ��� ��� is not multiaffine.

Theorem 2.5 (Characterization of Affine Maps)� is affine � a linear map� and a translation vector� exist such that���� � ���� �.

Remark:

– affine maps map lines onto lines

– parallelity is preserved

– division ratios are preserved

– angles arenot preserved

– examples for affine maps: rotation, scaling, shearing� � �

2.3 Polar Forms

Theorem 2.6 (Polynomials and Polar Forms)For each polynomial� � � � � of degree� exists a unique map� � �� � � with thefollowing properties:

(1) � is n-affine:

����� � � � � ������

� � ����� � � � � ��� �

��

� ����� � � � � ����� � ����� � � � � ��� if�

� � �

Page 21: Geometric Modelling

9 2.3 Polar Forms

(2) � is symmetricin each variable, i. e.

����� � � � � ����� ��� ����� � � � � ���� �� ���� � � � � ��� �� ����� � � � � ����� �� ����� � � � � ���� ��� ���� � � � � ���

(3) � ��� � ���� � � � � �� �� ��

� (diagonal property)

Diction: � is thepolar form(“blossom”) of� .

Example:

� ��� ����� � � � � ���

� � � 1 1� ��

� � � 1 1� �

���� ���

�� �� ���� �� � �� �

� �� ������� ��� �� �� ��

� � � 1 1� �

���� �� ���

�� ����� �� �� �� �� ���

�� �� �� ��� � � � � �

General formula for polynomials of degree� in monomial representation:� ��� ���

��� �� ��:

����� � � � � ��� ���

���

������

� ������������

�����

��� (2.11)

Example: � ��� �����

�� ����� ��� �

��#� ��� ����� ��

���� �� �

���

�� ���� �� � ���� �� �

��#��

�� ���� �� �

���

�.

Consider a degree 2 polynomial curve:� ��� � ���� ��. This can be decomposed in the follow-ing way:

���� �� � ����� �� � � � � �� �� � ��� �� � ���� �� � � ���� �� �� ��� ������ �� ���� �� � ���� ��� � ���� �� ���� �� � ���� ��� �� ��� ��� ���� �� � � ��� �� ���� �� �� ���� �� �� ��

���� ���� �� ������ ���� �� �

����� ���� ��

Page 22: Geometric Modelling

2 Polynomial Curves 10

����� �� ���� ��

���� ��

���� ��

Figure 2.3: Polar Form of a Curve of degree� � �

Corollary 2.1���� ��� ���� ��� ���� �� are coefficients with respect to the Bernstein basis. With degree� wehave coefficients���� � � � � �� �� �

���

� �� � � � � �� �� ��

�, � � �.

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

�:

����� �� ���� ��

���� ��

���� ��

�� ��� ���

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

Page 23: Geometric Modelling

11

3 Bézier Curves

3.1 Basics

Definition 3.1 (Bézier Curve)A polynomial curve

� ��� ������

� ��� ��� � �� � �� � � (3.1)

is calledBézier curve1 of degree� over� � ��� �� with the gereralized Bernstein polynomial� ��

� ���. The points�� are calledcontrol pointsor Bézier points, the polygon formed by thecontrol points is calledcontrol polygon.

Theorem 3.1 (Bézier Points and Polar Form)Given a polynomial� � ��� of degree�, the Bézier points with respect to� � ��� �� are

�� � ���� � � � � �� �� ����

� �� � � � � �� �� ��

� � � � �� � � � � �� (3.2)

Proof: Write � as an affine combination of� and�:

� �

��� ��� �

��

��� ��� �

��

Now we have:

� ��� � ���� � � � � �� �� ��

� �

��� ��� �

����� �� � � � � �� �� �

����

��� ��� �

����� �� � � � � �� �� �

���� �

��� ��� �

��

���� �� �� � � � � �� �� ����

��� ��� �

���� ��� �

����� �� �� � � � � �� �� �

����

��� ��� �

���� ��� �

����� �� �� � � � � �� �� �

����

��� ��� �

��

���� �� �� � � � � �� �� ����

� �

� � � � decompose�’s

���

���

��

���� ��� �

����� ��� �

�������� � � � � �� �� �

���

� �� � � � � �� �� ��

���

���

� ��� ��� ���� � � � � �� �� �

���

� �� � � � � �� �� ��

1Pierre Bézier, 1966

Page 24: Geometric Modelling

3 Bézier Curves 12

Example: Given:� ��� � ��� ���, ����� ��� � ������ ���� �� ���, � � ���� ��.

�� � ����� �� � ���� ��� �� � ����� �� � ������� �� � ���� �� � ��� ��

�� �

��

��� ��

��

Figure 3.1: A Bézier curve

Theorem 3.2 (Derivative of a Bézier Curve)Let� ��� �

����� �

��� ����� a Bézier curve over� � ��� ��. Then:

� ���� ��

�� ��������

� ����� ��� � ����� � ��� (3.3)

Proof: Consider� ��� ��� ��

���

���� �� �� � ���

�� ����

(i) �� ��� ����� �

��

����� ����

�� ���� ��� �

������� ��� �

�����

� ��

����� ������ ��� �

���� ��� �

��� ��� �

�������

��

�� �

���� ���

��� ������ �� ��� ����

��� ��� �

������� ��� �

���������

� ��� ���

����� �� ������ ��� �

����� ��� �

������ ��

��

�� ��� ����

��� ���� � ����� ���

Page 25: Geometric Modelling

13 3.1 Basics

(ii) � ���� ������

�� ��� � ������

��

�� �

���

��

� ������ ���� �

�������

� ����� �����

��

��

�� �

��������

� ����� ������� �

�������

� ����� �����

��

��

�� ��������

� ����� ��� ����� � ���

Corollary 3.1

� ����� �� ��� ��

��� ����������

� ����� ��� ����� � ����� ��� (3.4)

etc. for higher derivatives.

3.1.1 Shape Properties for Bézier Curves

Theorem 3.3 (Lemma of Bézier)For� ��� �

����� �

��� ����� Bézier curve over� � ��� �� we have:

(1) For� � �, � ��� is contained in the closed convex hull of the control polygon. (Thecurve point� ��� is a convex combination of the���).

Remark:A set of points is calledconvex, if for any two points��� �� � the line���� � .

�� � � ��� �� � � ���

������

Figure 3.2: Convex hull

(2) End-point interpolation:� ��� � �� and� ��� � ��, i. e. the curve runs through the firstand the last control point.

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

�� ��� � �����

Page 26: Geometric Modelling

3 Bézier Curves 14

(4) Affine invariance: Let���� � �� � an affine map, then

��� ���� ���

���

� ��� ���������

I. e. to transform the curve with the affine transformation�, it is sufficient to transform thecontrol points.

(5) Variation diminishing property:“A Bézier 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� � � set�� � � ��� ���

� �� �� � �� �� � �

� � ��� ��

� �� �� � ���� � � � ����

(2) � ��� � ���� � � � � �� �� ��

� � �� und� ��� � ���� � � � � �� �� ��

� � ��

(Theorem 3.1, diagonal property of the polar form)

(3) � ���� � ���

�� �

����� �������� � ���

� � ���� � ��� ��� � ��� because� ����

� ��� �

��� � � � �

� � sonst

The same for� ����.

(4) Let���� � �� � an affine map��� .

��� ���� � �

���

���

� ��� �����

�� �

������

� ��� �����

� �

�����

� ��� ��� �

���

���

� ��� ��� ������ �� �

�����

� ��� ��������

(5) see [4]. �

Page 27: Geometric Modelling

15 3.2 Algorithms for Bézier Curves

3.2 Algorithms for Bézier Curves

3.2.1 The de Casteljau Algorithm

The de Casteljau algorithm is a method for evaluating Bézier curves.Given: control points��� � � � ��� of a Bézier curve

����� �

��� �����.

Algorithm 3.1 (de Casteljau)

��� �� ��

�� ��

�� ��� � �

���

�� ��� � �

����� � � �� � � � � �� % (3.5)

Then:��� � � ��� is a point on the Bézier curve.

Remark:The points�� depend on parameter� for � � � � �� � .

��� ��� ���

��� ���

��� � � ��

��� ��� ��� ���

��� ��� ���

��� ���

��� � � ��

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 Casteljau’salgorithm. 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

Page 28: Geometric Modelling

3 Bézier Curves 16

Example: � ��� �����

�� ����� ��� �

��#� ��� ����� ��

�Bézier 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 tothe symmetry of the polar form, there are two possibilities.

Find: ���� ���

(1) � � ������ �

���� �

�� �

����� �

����

de Casteljau: evaluate first�, then ��:

����� �� � ���������� �

������ �� �

���#��

���� �� � ������� �� �

����� �� �

��#��

���� ��� � �

������ �� �

����� �� �

��#��

�������� ����� �� ���� ��

����� �� ���� ��

���� ���

(2) symmetric variation: first��, then�

Page 29: Geometric Modelling

17 3.2 Algorithms for Bézier Curves

����� ��� � �

��������� �

������ �� �

���#���#�

����� �� � �

������ �� �

����� �� �

��#��#�

����� �� � �

������ �

�� �

����

�� �� �

��#��

�������� ����� �� ���� ��

����� ��� �� �

�� ��

�� ��� ��

Remark:

– The de Casteljau algorithm is stable (only evaluation of convex combinations).

– Complexity is����� (in contrast to���� with Horner’s rule).

– Improvement is possible by recursive subdivision.

3.2.2 The de Casteljau Subdivision Algorithm

Theorem 3.4Let � ��� �

����� �

��� ����� a Bézier curve over� � ��� �� and& � ��� ��.

Define:

�� ��� ������

� ���� �����

��&� Bézier curve over�� � ��� &�

�� ��� ������

� ���� �������

� �&� Bézier curve over�� � �&� ��

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

� ��� �

�������� � � ��� &�

������ � � �&� ��(3.6)

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

����� ������

� ���� ��� ���� � � � � �� �� �

���� &� � � � � &� �� �

� ���

���

� ���� ��� ����&�

Page 30: Geometric Modelling

3 Bézier Curves 18

(����&� are Bézier points with respect to��� &�). Similar for the right part. �

Example: According to figure 3.5 set� � � and �� �� � �

�. See figure 3.7 for evaluation of the

de Casteljau algorithm. The control points of the Bézier 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 poly-gons that convergesfast to the Bézier curve.

Lemma 3.1Let� � ��� ���� a��-continuous curve (i. e. two times differentiable).

Let� � ��� ���� a line defined by���� �� �� �� � ���

����� � ���. Then:

�� ���� ����� �

���� ������

��� ����� ���'�� (3.7)

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

3.2.3 How to draw a Bézier Curve

Given: degree�, � � ��� ��, ��� � � � ���

Find: polygon for piecewise linear approximation of� ���.

Algorithm 3.2(1) Evaluate� ��� at � parameter values& with & � &�� (e. g. with de Casteljau or by

evaluation of Berstein polynomials).

(2) Draw the polygon� �&��� � � � � � �&��.

Example: � � �� � � ��� ��� &� � �� &� ���� &� �

��� &� �

��� &� � �

Algorithm 3.3(1) Subdivide� ��� at the parametrical midpoint�& � ��

�� in ����� and����� using de

Casteljau.

Page 31: Geometric Modelling

19 3.2 Algorithms for Bézier 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.5Let � ��� �

����� �

��� ����� a Bézier curve of degree� over� � ��� ��.

Assume� ��� �����

��� � ����� ����� as Bézier curve of degree� � over� � ��� ��. Then:

�� ��

� ����� ��� �

� ���� � � � �� � � � � � � (3.8)

(where��� � ���� � )

�� � ���

��

�� � ���

��� ���

� �

Figure 3.10: Degree elevation� � � � � �

Proof:

(i) Let ������ � � � � ��� the�-affine polar form of� (as polynomial of degree�).

Page 32: Geometric Modelling

3 Bézier Curves 20

Definition 3.2

� ���� � � � � ����� ���

� �

������

������ � � � � ���� ���� � � � � ����� (3.9)

(a) affine in every�

(b) symmetric

(c) diagonal

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

(ii)

�� � ���� � � � � �� �� �

������ �� � � � � �� �� �

� � � ��� � � � � �� �� ��

� �� � � � � �� �� ������

� �

��

� �

�� ��

��

����� � � � � �� �� ����

� �� � � � � �� �� ������

� ��������

����� � � � � �� �� ��

� �� � � � � �� �� ����

�� �

��

� ������� �� �� ����� �

� ����� ��� �

� ���� �

Example: � � � � � � �

�� ��

��� � ��� � � ��� �� �

��� � �� � � ���

�� ��

��� � �� � � ��� �� �

��� � �� � � ���

�� ��

��� � �� � � ���

��

�� ��

��

���

���

���

Figure 3.11: Degree elevation� � � � �

Remark:

– The repeated degree elevation yields a sequence of polygons then convergeslowly to the Béziercurve.

– One can use this fact to prove the variation diminishing property of Bézier curves (see [4]).

Page 33: Geometric Modelling

21 3.2 Algorithms for Bézier Curves

3.2.5 Degree Reduction

Given: a Bézier curve� ��� ���

��� ��� �����.

Find: a representation with reduced degree:� ��� �����

��� �����

���.

This is not possible in general; therefore find the best approximation�� . The degree elevation of�� yields �� ��� �

����� �

�� ���

��� , where in general�� �� ��� . Find control points���� such that

�����

���� � ���� � � � �

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

��� ��

������

�� ��

���

������

���� �� ����� �� ��

��� � ��

����� � � � �

This leaves a linear system to solve.Example: � � � � � � �

Given: control points�� �

���

�� �� �

����

�� �� �

�����

�� �� �

����

�The new control points���� � � � � ��� are obtained as follows:

������ � � � � ���� ���

���

���� �� ����� �� ��

��� � ��

����� � � �

To receive the minimum we have to set the gradient of� to zero. The partial derivatives of� canbe written as

(

(��

������ � � � � ���� �(

(��

������ ���� �� �

�� � �

����� ���� �

���

�� � ��

����� � ���

������

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:���

��#� �#� ��#� ��#� �#�

� �#� ��#�

����������

����

����

��� �

��� �

���#����#�

��� �

���

��#� �#� ��#� ��#� �#�

� �#� ��#�

����������

����

����

��� �

���

��#����#���#�

���

Page 34: Geometric Modelling

3 Bézier Curves 22

with the solution:

��� �

����

�� ��� �

�����

�� ��� �

����

�The Bézier curve with reduced degree is depicted in figure 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 controlpoints of the degree-elevated curve can be obtained by an appropriate matrix multiplication onthe initial control points. E. g., the degree elevation� � � � � � � with the initial points��� � � � ��� and the control points��� � � � ��� of the degree elevated curve can be described bythe following matrix:

� �

��������

� � � ��#� �#� � �

� �#� �#� �

� � �#� �#�

� � � �

�������� �

��������

��

��

��

��

��

�������� � � �

��������

��

��

��

������

To find thedegree reductionof a curve, one has to solve the linear system�� � �. In general,this is not possible (over-determined linear system). Therefore find the best possible solutionsatisfying 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

���� ��� � ���� ��� ���� �� � ������� ������ ���

Page 35: Geometric Modelling

23 3.3 Bézier Splines

To receive the minimum set the derivation to zero:

(

(�

�������� ������ ���

�� ������ ���� � � � ���� � ���

Remark:Due to the structure of�, the square matrix��� is tri-diagonal. Therefore, the linear systemcan be solved very efficiently.

Example: � � � � � � � (see figure 3.12)

Given: control points�� �

���

�� �� �

����

�� �� �

�����

�� �� �

����

�The following matrix� describes the degree elevation� � � � � � �:

� �

������� � ��#� �#� �

� �#� �#�

� � �

������

To calculate the new control points useGauss Normal Equation

� � ����������

� ��

��

��� �� � �� �

�� �� �� ��� �� � ��

��� � �

with the result

�� �

����

�� �� �

�����

�� �� �

����

3.3 Bézier Splines

3.3.1 Construction of “complex” Curves

To model more complex shapes with Bézier curves, there are two possibilities:

– Method 1: use a Bézier curve ofhigh degree. This method may cause numerical problems.

– Method 2: split curve intoseveral simple partsand represent every segment as a lowdegree Bézier curve.

Definition 3.3A Bézier splineis a piecewise polynomial curve. The segments are represented by Bézier curves.

Page 36: Geometric Modelling

3 Bézier Curves 24

���

� ��

��

��� ��

�� ��

Figure 3.13: Joins of Bézier curves

Problem: continuity of the joins? Discontinuities or non-differentiable joins cause “non-smoothness” of the curve.

Definition 3.4Given two polynomial curves� � ��� �� � � and) � ��� �� � � . Then the curves are��-continuousat � if � ��� � )���� � ���� � )����� � ����� � )������ � � � � � ���� � )����.

Interpretation:

– ��-continuous = continuous, no jumps

– ��-continuous =��-continuous + same tangent vector

– ��-continuous =��-continuous + same osculating circle.

3.3.2 ��-Continuity of two Bézier Curves

Theorem 3.7Let � ��� �

����� �

���� �� and)��� �

����� �

���� � Bézier curves over�� � ��� �� and

�� � ��� ��, � � � � �. Then:

��) are��-continuous at� � � � �������� � � � � (3.11)

Proof: Any Bézier curve has a unique representation over every interval. (In this case we onlyconsider� ��� over the interval��, but in fact the curve has the domain������.) Thereforewe can define curve� ��� over the interval�� without changing it:

� ��� ������

� ���� ������� � � � � �� �� �

���� �� � � � � �� �� �

� ���

���

� ���� ������� � � � � �� �� �

���� �� � � � � �� �� �

� ���� ��

�� ��������

� ������ �������� � � � � �� �� �

������ �� � � � � �� �� �

���

�� ���� � � � � �� �� ����

� �� � � � � �� �� ��

��

...

� ���� ���

��� ������ ����������

� ������ ���

����

��

����������� � � � � �� �� �

����� �� � � � � �� �� �

��

Page 37: Geometric Modelling

25 3.3 Bézier Splines

� ��� � ���� � � � � �� �� ��

� )��� � ���� � � � � �� �� ��

� ���� ��

�� ������ � � � � �� �� ����

� ��� ���� � � � � �� �� ��

�� )���� ��

�� ��*��� � � � � �� �� ����

� ��� *��� � � � � �� �� ��

��

...

� ���� ���

��� ������ �����

��

��

����������� � � � � �� �� �

��

� �� � � � � �� �� �

)���� ���

��� ������ �����

��

��

�������*��� � � � � �� �� �

��

� �� � � � � �� �� �

� ��) are��-continuous at�

� ���� � � � � �� �� ����

� �� � � � � �� �� ��

� � *��� � � � � �� �� ����

� �� � � � � �� �� ��

� �������� � � for all � � �

Remark:� ����� ��

�� �

��� ���

����

��� ����� ����� ��� � ��

����� � ��

����� � ��

���

��

��

��

Figure 3.14: Join conditions in the de Casteljau algorithm

Page 38: Geometric Modelling

3 Bézier Curves 26

3.3.3 Geometrical Construction of continuous Joins

Let��) and����� like above and �

�� ��

�� . Then:

(1) ��) are��-continuous� �� � �.

(2) ��) are��-continuous�

���� �� � �� ��

�� ��

(3) ��) are��-continuous� “A-frame” property:

���� �� � �� ��

����

��

�� ��

��

�� ��

��

Example: Given: standard parabola� ��� �

����

�over��� �� � ���� ��

Find: continuation)��� �? over��� �� � ��� ��

��-continuity:� � ��

��-continuity: � � ��� �� � � �

�� ��� ��� � � � � � �� � � �.

Result: see figure 3.16

�� � ������ �� � ��� ��

�� � ��� �

�� �

�� � ���� �� �� � ������ �� � ��� ��

���� � ��� �

�� � � � ��

�� � �� �

�� �

Figure 3.15: de Casteljau conditions for��- and��-continuity

Remark:The figure 3.17 is fully described by the location of�����, the endpoints and the intervals��.Note: The points� are B-Spline control points (see chapter 4).

Page 39: Geometric Modelling

27 3.3 Bézier Splines

��

��

�� � ��

��

��

Figure 3.16:��-continuation of the standard parabola

������������

������

���� � ������

���� ����

���� � ������

������

������

������

�� ��

����

��

���� �� ����

��

����

����

�� ��

����

Figure 3.17:��-join of several cubic Bézier segments

Page 40: Geometric Modelling

3 Bézier Curves 28

3.3.4 Interpolation with Bézier Splines

Given: Points��� � � � ��� and parameter values��� � � � � ��.

Find: A curve thatinterpolatesthe points�� at the corresponding parameter values, i. e. all��

must be on this curve.

A simple idea areCatmull-Rom Splines2:

– find a (e. g. cubic) Bézier curve between two neighbour points��, ����

– specify the tangents (= derivatives) at the end points as follows:

� ����� � ������� � �����

� ������� � ������� � ��� (3.12)

� ���� � ��

� ������ � ����

(3.13)

Theorem 3.8If � � � � ���� �����, you get the control points of an interpolating Bézier curve as follows:

��� � ��

��� � ��

���� � ���

����� � ����� (3.14)

��� � ���� � ���� � ��

������ � ���

��� � ����

(3.15)

Sketch of Proof:

� ����� ��

���� � ����

��

� ��� ���� ��

��� � ��

� ��

���� � �� ���� � ��

����

������ � �����

� ������� ��

���� � ����

��

� ��� ������ ��

��� � ��

� ��

���� � �� ���� � ��

����

������ � ���

Remark:

– Problem: What happens at the end points?

– 1st case: closed curve (i. e.�� � ��).

– 2nd case: open curve (�� �� ��). In this case the natural end conditions������� � � and� ������ � � hold true.

Page 41: Geometric Modelling

29 3.3 Bézier Splines

����

�� � ���

���� � ���

����

���

���

Figure 3.18: Interpolation with Catmull-Rom Splines

� �

– When interpolating points, you have to consider the order (ortopology= neighbourhood relation)of the points.

– Only if the points are “uniformly distributed”, you can assume that all parameter intervals have thelength 1 (e. g.�� � �). In general, this is not true.

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

Page 42: Geometric Modelling

3 Bézier Curves 30

Page 43: Geometric Modelling

31

4 B-splines

4.1 Basics

B-spline curves are piecewise polynomial curves with built-in� �-continuity at the joins. Mainlywe deal with curves of degree� that are����-continuous, e. g. a B-spline curve of degree 1 ispiecewise linear and��-continuous.

Given: degree� and a sequence of knots�� � �� � �� � � � � � ���� where is the numberof control points of the curve. Thus, theknot vector+ � ���� ��� defines parameter intervals���� �����.

�� ���� ���� �� ���� ����

Figure 4.1: A knot vector

The B-spline basis functions� �� ��� are defined recursively by degree�:

��� ��� �

��� �� � � ����

� otherwise

��� ��� �

�� ������ � �� �

�� ���

���� � ����� � ����

��������

General recursion formula:

Definition 4.1 (Normalized B-spline Basis Functions)

��� ��� � �

��� �� � � ����

� otherwise� � � �� � � � � � � � (4.1)

��� ��� � �

�� ������ � �� �

���� ���

������ � ������� � ����

������� ���� � � �� � � � � � (4.2)

The��� are computed according to the follwing scheme:

��� ��

� ��� ��

� � � � ������� ��

����� �������

� � � � � � � � � � � � ���

� ��� ��

� ��� � � � ��

����� �������

� � � � � � � � � � �...

......

......

� � � � � � � � � ���

� ��� ��

� ��� � � � ��

���

Page 44: Geometric Modelling

4 B-splines 32

Example: We choose the knot vector+ � �� � � � �� �� �� �� �� �� �� � � � ), i. e. �� � �.

� � � � ��� ��� �

��� � � �

� � � � �

� � �

� � � � �

��� ��

� ��� ��

� ��� ��

Figure 4.2: B-splines for� � �

� � � � ��� ��� �

��

� � � �

�� � � � � �

�� � � � � �

� � �

� � � � �

��� ��

� ��� ��

� ���

Figure 4.3: B-splines for� � �

� � � � ��� ��� �

�� �

�� ���

� ��� �� ��� �

��� ��� �

��

� � � �

����� ��� � � � �

������ �� ��� �� ��� �� ��� ��� � � � �

����� ��� � � � �

� � �Remark:The B-spline��

� ��� is tangent-continuous at the joins.

Page 45: Geometric Modelling

33 4.1 Basics

� � � � �

Figure 4.4: The B-spline��� ���

Properties of B-splines

(1) ��� is piecewise polynomial of degree�.

(2) The support of��� : � !!���

� � �� � ���� ��� �� �� � ���� �������, i. e. the support consists

of � � intervals per section.

(3) Positivity:� �� ��� � � for � � ���� �������.

(4) Partition of 1:����

��� ��� ��� � � 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 fig. 4.2), and thus���

� ����� is either

���� � �� or � �

���� � ����

(see fig. 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:

���� �

���� ��

���� � ������� ���� �

������ � ��������

��� ��� � � �

���� � ���� ��

������ � ������� ���

� � �

���� � ����

������� � ������� � ����

� �� ������ � ��

�����

��� ����

� � � �

������ � ����

������ � ������� � ����

������� ���

Page 46: Geometric Modelling

4 B-splines 34

Because of �������������������

� ����������� �

������������� �

������

�����������, we obtain:

���� �

���� ��

���� � ������� ���� �

������ � ����

������� ���

� � �

���� � ��

��� ��

������ � ������� ���

���� � ����� � ����

������� ���

�� �� �

����� �

� � � �

������ � ����

��� ����

���� � ����

������� ���

������ � ������� � ����

������� ���

�� �� �

������� �

��

���� � ������� ���� �

������ � ����

������� ��� �

Example: Support for cubic B-splines:

��� ���� ��� ��

� ���� ��� ��� ���� ��� ��

� ���� ��� ��� ���� ��� � � �

� � � � � � � � ...

��� ���� ��� ��

� ���� ��� ��� ���� ��� ��

� ���� ��� � � �� � � � � � ...

��� ���� ��� ��

� ���� ��� ��� ���� ��� � � �

� � � � ...

��� ���� ��� ��

� ���� ��� � � �

4.2 B-spline Curves

Definition 4.2Given:

– degree�

– knot vector�� � �� � � � � � ����

– control points��� � � � ����� � �� or �� .

� ��� ���������

��� ����� (4.4)

is calledB-spline curve. The points�� are calledcontrol pointsor de Boor points1. They form acontrol polygon.

1Carl de Boor, 1972

Page 47: Geometric Modelling

35 4.2 B-spline Curves

4.2.1 Shape Properties of B-spline Curves

Theorem 4.1 (Shape properties of B-spline curves)Let � ��� �

������� �

�� ����� a B-spline curve of degree� over the knot vector+ . Then the

following properties hold true:

(1) In general there isnoendpoint interpolation.

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

(“local convex hull”).

��

��

��

Figure 4.5: Local convex hull

(3) Local control: For� � ���� ����� the curve is independent of� for � �� � and � �.

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

���� � �� � ����

����

����

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

Page 48: Geometric Modelling

4 B-splines 36

(6) If � � control points are on a line�, then� ��� � � for �� � � ����, i. e. a wholesegment of the curve� ��� coincides with� (Fig. 4.8).

���� �� ���� ����

Figure 4.8:�� � � control points on a line

(7) Derivative:

� ���� ��������

������� ����

� mit �� �

������ � ��������� � ��� (4.5)

(8) If � knots�� � ���� � � � � � ������ coincide, then� ���� � ��, i. e. the curve goes througha control point and is tangent to the control polygon.

(9) If � is an affine map, then:

��������

��� �����

��

�������

��� ��������

(affine invariance).

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

��� �$� ��$ � control polygon�

4.2.2 Comparison of B-Spline and Bézier Curves

Bézier Curves

+ control polygon gives an impression of the possible run of the curve

+ the run of the Bézier curve can be changed by the translation of control points

but:

– control points have global influence on the run of the Bézier curve

– number of control points depends on the degree of the Bézier curve� more controlpoints, i. e. more possibilities to influence the run of the curve, only possible by degreeelevation

Page 49: Geometric Modelling

37 4.3 Control Points and Polar Forms

B-Spline Curves

B-Spline curves do not have the disadvantages of Bézier curves.Geometric properties of Bézier curves like "convex hull" or "variation diminishing" are alsovalid for B-Spline curves.Additional advantages are:

+ B-Spline functions are defined locally

+ Translation of a control point has only local influence on the run of the curve

+ Insertion of additional control points without degree elevation

+ Smoothness of the junction of adjoining segments can be influenced "easily"

Basis Functions Curves

Bézier curvespolynomial Bernstein polynomials� ��

� � ��� ���

��� � ��� �����

(normalized) B-splines��� B-spline curves

piecewise polynomialover knots+ )��� �

������� �

�� �����

Table 4.1: Review: curve schemes mentioned so far

4.3 Control Points and Polar Forms

Theorem 4.2 (Control points and polar forms)Given: a B-spline curve� ��� �

������� �

�� ����� of degree� over a knot vector�� � �� �

� � � � ����. � restricted to the interval��� ���� is a polynomial curve and has a unique polarform �. Then:

�� � ������� � � � � ����� for � � % (4.6)

e. g. for� � � this means:

��� � ������ ���� �� ��� � ���� ���� ����

��� � ������ �� ���� � � ������ ���� ����

Special case: The Bézier 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 Bézier spline curve.

Page 50: Geometric Modelling

4 B-splines 38

Example: � � �� + � �� � � ���� � � � ���� �� �� �� �� � � � �. Consider the curve segment where� � ��� ��. In this segment,�� is the polar form of the B-spline curve� . Control points:

��� � ��������� �� ��� � ����� �� ��

��� � ������ �� �� �� � ����� �� ��

Bézier points of� ������:

�� � ����� �� �� �� � ����� �� ��

�� � ����� �� �� �� � ����� �� ��

Given: ��������������

Find: �����������

The Bézier points are obtained by construction of suitable affine combinations, e. g.

����� �� �� ��

������ ����� �

������ �� �� �

��

��

������ ����� �

������������

��

��

��������� �� �

������ �� ��

��

��

��

����

����

��

��

����

����

��

��

����

����

���� � ��

Similar computation for the other control points.

4.4 Multiple Knots

Multiple Knotsare allowed, if the multiplicity of the knots is less or equal to the degree. Gener-alized knot vector:

�� �� � � � � ��� � � � ���� � � � ��� (4.7)

Exception: The first and last knot may have the multiplicity� �.

We have to extend the definition 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� � �:

��� ��� �

�� ������ � �� �

���� ���

������ � ������� � ����

������� ���

Page 51: Geometric Modelling

39 4.4 Multiple Knots

(1) case���� � �� � �, i. e. the multiplicity of�� ist greater or equal to� �.

��� ��� �

������ � ������� � ����

������� ��� (4.9)

(2) case������ � ���� � �, i. e. the multiplicity of���� is greater or equal to� �.

��� ��� �

�� ������ � �� �

���� ��� (4.10)

(3) case������ � �� � �, i. e. the multiplicity of�� is greater or equal to� �.

��� ��� � (4.11)

Example: �� � �� � �� � �� � �� � ��

��� ��� �

�� ���� � �� �

�� ���

�� � ��� � �� �

�� ���

��� ��� �

�� ���� � �� �

�� ���

��� ��� �

�� � ��� � �� �

�� ���

��� ��� �

�� ���� � �� �

�� ���

�� � ��� � �� �

�� ���

�� �� �� � �� �� ��

��� ��

��� ��

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)Given: a sequence of knots�� �� � � � ����. These knots have multiplicities,�� � � � � ,���, where the inner knots have the multiplicity� ,� � and the border knots

Page 52: Geometric Modelling

4 B-splines 40

have the multiplicity,� � ,��� � ��. Now consider this knot vector as a sequence of singleknots-� � -� � � � � � -� with the corresponding multiplicities,�� � � � � ,�.

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

Remark:

– The most important special case are theproper splines, where�� � � � � � ���� � �.

– If we insert a new knot��, the dimension of the space increases by 1, i. e. the space of all piecewisepolynomial 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 maximalmultiplicity of the knots may be�. At the end points we can equate�� � � � ��, because the curvedoes not depend on�� (see scheme on page 34: For� � ��,��

� ���� ��� does not contribute to thecomputation 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 correspondingcontrol point and is tangent to the control polygon.

Sketch of Proof: Consider a B-spline curve of�th degree over the knot vector

� � � � � � �� �� ����

� � � . � � � � � .� �� ����

For the basis function��� ��� for � � ��� �� we obtain:

��� ��� �

�� ��� � �

���� ��� �

��� ��� �

��

����� ��� � � � � �

��� ��� �

��

This is the first Bernstein polynomial of�th degree with respect to the interval��� ��.� ��

� ��� � � ��� ��� with � � ��� ��.

Similar, it can be shown that��� ��� � �

��� ��� with � � ��� .�.

Because of� ��� ��� � � and� ��

� �.� � � the end points are interpolated.Tangential property:

� ���� ��������

������� ��� �

������ � ��������� � ��� �

� ����� ��� � �

�� ���� � ��� ��

�� ���� � ����

since����� ��� does not exist and����

� ��� � �. All the other basis functions must be zero atthe parameter value� (affine combination). So the line���� is the tangent to the Bézier curve atcontrol point��. Similar for� ��.�. �

Page 53: Geometric Modelling

41 4.5 Algorithms for B-spline Curves

Example: � � �� � �� + � ��� �� �� �� �� �� �� �� �� ��.

We construct a piecewise polynomial curve� ��� over this knot vector that “lives” on three notvanishing parameter intervals:

� ��� �

������� � � � � control points:�� �� �� ��

����� � � � � control points: �� �� �� ��

����� � � � � control points: �� �� �� ��

Consider the interval���� ��� � ��� ��. B-spline control points that affect�� are:

�� � ����� �� �� �� � ����� �� ��

�� � ����� �� �� �� � ����� �� ��

The Bézier representation of�� is obtained as follows:

���� � ����� �� �� ��

������ �� ��

������ �� �� �

��

��

������ �� ��

������ �� ��

��

������ �� �� �

��

���

���

��

�����

���� � ����� �� �� ��

������ �� ��

������ �� �� �

���

���

���� � ����� �� �� ��

������ �� ��

������ �� �� �

���

���

���� � ����� �� �� ��

������ �� ��

������ �� �� �

��

������ �� ��

��

������ �� ��

������ �� ��

��

�����

��

���

���

4.5 Algorithms for B-spline Curves

In this section,� ��� �����

��� ��� ����� is a B-spline curve of degree� over a knot vector

�� � � � ����, where multiple knots are allowed.

4.5.1 The de Boor Algorithm

The de Boor algorithm is a method for evaluating B-spline curves.Given: control points��� � � � ����� and knot vector+ � ���� of a B-spline curve� ��� �����

��� ��� ����� and a parameter intervall� � � ���.

Find: value of� at�

Page 54: Geometric Modelling

4 B-splines 42

�� � ����

�� � ����

����

���� � ��

���� � ��

���� � �������� � ����

��������

��������

��

����

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

Algorithm 4.1 (de Boor)

��� �� �� � � � � �� � � � �

��� ��

�������� � ��������� � �� �

������

�� ���������� � �� �

���� � (4.12)

with � � �� � � � � � and � � � � �� � � � �

Then:� ��� � �� .

The evaluation scheme for the de Boor algorithm is depicted in Figure 4.12.The coefficients canbe 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 Bézier curves.

Page 55: Geometric Modelling

43 4.5 Algorithms for B-spline Curves

���� ���� �� ���� ���� ����

� � �� � � � � �

� � �� � � � � �

� � �� � � �

� � �� � � � � �

� � �� � � �

� � � � � �

� �

� Æ

� �

� �

� �

� �

Figure 4.12: Visualization of the coefficients for the de Boor algorithm (� � )

Example: � � �� � �� + � ��� �� �� �� �� �� �� �� �� �� � /� � ���� ��� � ��� �� � � � ��� /�

(see fig. 4.13, 4.14 and 4.15).

�� �� �� � � � � � �

� � �

� � �

� �

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

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 affine transformations, assumption of the interval� � ��� �� is not a

loss of generality.

Page 56: Geometric Modelling

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

Page 57: Geometric Modelling

45 4.5 Algorithms for B-spline Curves

– If two neighbouring knots have the multiplicity�, then the corresponding B-spline curveis a Bézier curve between these knots.

– By insertion of all knots until multiplicity� we can construct the Bézier polygon.

4.5.2 Conversion of B-spline Curves into Bézier Splines

Given: B-spline curve� ��� �����

��� ��� ����� over a knot vector�� �� � � � ����.

Find: Bézier representation for each polynomial segment� ���� ������.

There are two possibilities:

(1) Insert knots� and���, until both have the multiplicity�.

(2) Use the polar form.

Example: Knot vector:+ � �� � � ������� �� �� �� �� � � � �. Consider interval��� ��.

The control points�������� ��� ����� �� ��� ���� �� ��� ���� �� ��� � � � are given.

To find the Bézier points���� �� ��� ���� �� ��� ���� �� �� and���� �� ��, construct suitable affinecombinations, e. g.

���� �� �� ��

������ �� �� �

����� �� ��

����� �� ���

4.5.3 The Boehm Algorithm

How can we insert a new knot into a knot vector without changing the curve? Insertion of knotsis useful for:

– adding local detail

– as basis of other algorithms (e. g. de Boor’s algorithm for curve evaluation)

– to convert B-splines into Bézier splines.

Insertion of an additional knot��, let’s say at� �� � ���, gives a new knot vector��� � � � ���� �� ���� ���� � � � �������.

+ � ���� � � � � ���� �� �� � ���� ���� � � � � �����

� � � � � � ��+ � ����� � � � � ����� ��� ���� � ����� ����� � � � � ��������

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

� ��� ��������

��� ����� �

�����

���� ��� ���

Page 58: Geometric Modelling

4 B-splines 46

How to compute the new control points��� from the given��? An answer is given by the Boehm2

algorithm.With theorem 4.2, we get�� � ������� � � � � ����� and also��� � �������� � � � � ������. Then:

���� � ������� ����� ��� � ������ ���� �� � ������� � ������� ��� ����� � ������ �� ������� � ����� ����� ����� � ���� ��� ������ � ������� ����� ����� � ����� ���� �������� � ������� ����� ����� � ������ ���� ���� � �

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

���� � ������ �� ��� ���� � ��

��� � ��� ������ ���� �� ��� ������ � ��� ������ �� ���� �

���� � ��

��� � ��� ��� ��� ������ � ��� ���

The other control points are obtained similar. More general:

Algorithm 4.2 (Boehm)

��� �

���� � � ��������������� ����

������������ �� � � � �

���� � �(4.13)

The coefficients can be visualized as divide ratios of line segments. In the following schema,there is���� � ���� � ���, ���� � 0 ��� Æ ��� and�� � 1��� 2 �.

���� ���� �� �� ���� ���� ����

� �

� Æ

� �

���� ���� ���� ��

����� ����� ���

Figure 4.16: Schema for the Boehm algorithm

2Wolfgang Boehm, 1980

Page 59: Geometric Modelling

47 4.5 Algorithms for B-spline Curves

Example: � � � � + � ��� �� �� �� �� ��� �� � �.

���� �� ��

���� �� �

���� �� � ���� � � ���� � ��

�� � � ��

��� �� ��

� � � �� � �

���� �� �� ���� �� � ���� � �� ��� �� ��

���� �� � ���� � � �� � � ��

Figure 4.17: Example for the Boehm algorithm

Remark:

– According to Theorem 4.3 we can insert inner knots up to multiplicity� and at the end points upto mulitplicity �� �.

– 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. Thisgives the de Boor algorithm to evaluate B-spline curves.

4.5.4 Knot Deletion

Knot deletionis the inverse process to knot insertion. In general, it is not possible to remove aknot without changing the curve. Therefore, try to remove a knot and find a curve that is as closeas possible to the original curve (see degree elevation� degree reduction for Bézier curves).Knot insertion is a linear process:�

�������

��������������

����

�������� �

��������

��� ������ ���

� �

��������

����������������

������ (4.14)

Short: �� � ��. Find control points� such that��� ���� is minimal. With theorem 3.6 wehave to solve the linear system

���� � �� �� (4.15)

Page 60: Geometric Modelling

4 B-splines 48

and get

��� �

������� ���� ������������ ���� �

��� ������

������ �� ���� ��

�� �� �

������

4.5.5 Subdivision for uniform B-spline curves

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

Let� ��� �����

��� ��� ����� a B-spline curve of degree� over the knot vector+ � �� � � ��

���� � � � � with ���� � �� � � for every� or simply�� � � � �. A knot vector with this propertyis calleduniformknot vector.

Insert new knots at� � ��:

Then:� ��� ������

��� ��� ���

��� over the new knot vector�+ .

Repeating this process gives a sequence of polygons that covergesfast to � ��� (compared withsubdivision for Bézier curves).The ��� are obtained again with suitable affine combinations. For� � � this gives Chaikin’s3

algorithm.

Example 1: � � � and knot vector with multiplicity� � at the endpoints+ � ��� �� �� �� �� �� �� �� �� �� �� ��Knots are inserted where the curve has full support, in this example at� � �

�� ��� ��.

���� �� ���� � �� � �

���� ��� �� �

�� �

�� ��� � �� � � ��� ��

�� � ��� �� �

�� �

�� ��� � ��� �� ���� ��

��� �� ��

�� ��

Figure 4.18: Knot insertion at� � �� �

�� �

��

3G. Chaikin, 1995

Page 61: Geometric Modelling

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 stepsof iteration in Figure 4.19.

��

�� ��

��

��

Figure 4.19: Geometrical construction: cutting the corners

Example 2: � � � andopenknot vector e.g.+ � ��� �� �� �� �� �� �� ��Evaluation according to the following scheme (see Figure 4.20):

��� � ��

����� ����� for � � �� � � � � � �

��� ��� ��

���� ������ for � � �� � � � � � �

Page 62: Geometric Modelling

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 threeold control points:Example 3: � � � and knot vector with multiplicity� � at the endpoints, control pointsEvaluation according to the following scheme:

��� � ��

��� ��

���� ���

��� ��

����� ���

��� ��

������ ���� ����

��� � ��

���� ����� for � � �� � � � � � �

��� ��� ��

���� ����� ����� for � � �� � � � � � �

�������� ��

�������� �����������

������ ��

������� �����

�������� ��

���� �����

������ � ��

Example 4: � � � andopenknot vector, control pointsEvaluation according to the following scheme:

��� � ��

���� ����� for � � �� � � � � � �

��� ��� ��

���� ����� ����� for � � �� � � � � � �

Page 63: Geometric Modelling

51 4.6 Interpolation and Approximation

4.6 Interpolation and Approximation

Given:

– 3 data points�� � � � � ��� with3 corresponding parameter values��� � � � � ����

– an -dimensional space with basis functions� �� � � � � � �

���� over a knot vector+ � ���

� � � �����

Find: Curve� ��� �����

��� ��� ����� that interpolates / approximates the data points

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 wantto find, should run through the point�� at time�� (see Figure 4.21).

��

��

����

��

��

!� !� !� !� !� !��� ����

Figure 4.21: Illustration of parameter values

There are three cases to distinguish:

(1) 3 � : number of conditions = number of degrees of freedom� interpolation

(2) 3 � : overdetermined system of equations� approximation

(3) 3 � : underdetermined system of equations� "constrained" interpola-tion/approximation

4.6.1 B-spline Interpolation

Given:

– points�� � � � � ��� with parameter values��� � � � � ����

– an -dimensional space:� ��� �����

��� ��� ����� with knot vector+

Find: control points��� � � � ����� such that the curve� ��� �����

��� ��� ����� interpolates

the given points�� � � � � ��� at the parameter values��� � � � � ����, i. e.� ������ � ��.

In matrix notation:��� ��

� ���� � � � ���������

......

��� ������ � � � ��

�������

���

� �� ��

�� ��

...����

��

� �� ��

�� �

...���

��

� �� ��

(4.16)

Page 64: Geometric Modelling

4 B-splines 52

Therefore, the interpolation problem is always solvable in case the matrix�� � ������� is invert-

ible.Remark:

– Matrix � has at most�� � non-zero entries per row (support of��� : ������

� � �� ���� �������).

– Matrix � is a band diagonal matrix. There are efficent numerical methods to solve a linear systemconsisting 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�� that always fulfills the requirements ofTheorem 4.5 are theGreville abscissas.

Definition 4.3The parameter values�� ��

������� � � � ����� are calledGreville abscissas.

Remark:

– For theGreville abscissasholds:� ��� � � ��

� ��� ��� �

– �� � �� fulfills �� � �� � ������, if all inner knots in� have multiplicity�� � �. Reason for this:� � �� � ���� � � � � � ���� � � � ������.

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

4.6.2 Special case: Cubic spline interpolation at the knots

Given:

– degree� � �

– a -dimensional space

– � � data points�� � � � � ���

– knot vector+ � ��� � � � �����

Find: cubic B-spline curve� ��� over+ with � ������ � �That means: we choose those knots as parameter values that lie in the area where the curve hasfull support. Then the conditions of Theorem 4.5 are fulfilled. But the number of conditions issmaller than the number of degrees of freedom. Hence for the uniqueness of the curve we needadditional conditions.

Page 65: Geometric Modelling

53 4.6 Interpolation and Approximation

Possible additional conditions:

(1) Specification of tangents at the end points:� ����� � '� � � ����� � '�

(2) Natural end condition:� ������ � � � � ������ � �

(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 anarbitrary knot vector by a cubic spline with addi-tional condition 2

� ���� ��������

��������

���� � ��������� � ���

� ����� ��������

��������

���� � ����

��

���� � ����

����� � ������ �

���� � ����

����� � ���

� ������ ��

��� � ������ � ���� �� ���

�� � �

�� � ��

��

�� � �� �

�� � ��

�� �� �

��

�� �

��� � ������ � ���� �� ���

��

� ������ ��

����� � ���������� � ������ �� �����

���� �

� �

���� � ����

��

���� � ���� �

���� � ����

�� �� �

����

���� �

����� � ���������� � ������ �� �����

����

Linear system to solve:

�����������

�� �� ��

��� ���� ��

� ���� ��� ����

��� ���� ��

� ���� ��� ����

. . . . . . . . .

��������� ��

������� ���������

���� ���� ����

�����������

�����������

��

��

��...

��������

�����������

�����������

�...

����

�����������

Example 2: Interpolation at the knots of anend point interpolatingknot vector

+ � ��� � � � � � �� � ��� � �� � � � � � ����� by a cubic spline with additional condition 2

�� � � � � � �� � ��� ���� � �

�� ���� � � � ��

� ���� � � � �� � �

�� � � � � � ���� � ��������� � �

�������� � � � ��

������� � � � ���� � ���

Page 66: Geometric Modelling

4 B-splines 54

� ���� ���� ���� � � � ����� � ���� � ���� � ���

� ������������

�� ������������

�� � �

analogue:��������� ��������� � .���

The linear system that we have to solve is derived by modification of the linear system ofExample 1:

�����������

��� �����

� ���� ��� ���� ��

� ����

��� ���� ��

� ���� ��� ����

.. . . . .

����������� ��

��������� �����������

����� �����

�����������

�����������

��

��

��...

��������

�����������

�����������

�...

������

�����������

with

��� � �����

��� � ���� � �� � ����� � �����

����� ��� � ����

�� � ������� � ���

��� ��� � ��

�� � �� ����� � ���������

��� � ������ � ���� �

Example 3: Interpolation at the knots of anend point interpolatinganduniform knot vector+ � ��� �� �� �� �� � � � � � �� � �� � �� � �� � �� by a cubic spline with additionalcondition 2The linear system� � � � is:

�������������

�#� ��#��#� �#�� �#�

�#� �#� �#�. . . . ..�#� �#� �#�

�#� �#�� �#��#� ��#�

�������������

��������������

��

��.........

��������

��������������

��������������

�.........

������

��������������

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,then interpolation of the data points is usually impossible. The linear system�� � is overde-termined and therefore not solvable.

Page 67: Geometric Modelling

55 4.6 Interpolation and Approximation

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

����� ��� � ���� �� ���� � � ������� ����� � is minimal

� �� derivation� �

� ���� � ��

� � � ���������

Thus, the approximation has exactly one solution if and only if the matrix��� is invertible:

������� exists � Theorem of Schoenberg-Whitney is fulfilled

� columns of� are linear independent

4.6.4 Parametrization

An important item of interpolation and approximation of data points is the choice of the pa-rameter values�� (parametrization). By choosing a proper parametrization great deflections andloops of the curve can be avoided in some degree.The easiest way to determine the�� is to set�� � �. This is called theuniformor equidistantparametrization. The disadvantage is the disregard of the position of the data points. For thisreason the interpolating curve will have unwanted loops and deflections in most cases.Interpretation: Imagine the parameter value� is the time. Because of the� �-continuity thespeed and the acceleration is continuous. On account of the uniform parametrization large dis-tances between data points must be managed in the same time as distances between data pointsthat are close to each other. Therefore the speed is higher between points with large distance, butspeed and acceleration are continuous and we receive loops and deflections of the curve betweendata points with short distance.

One way to take the positions of the data points into account is to choose the distance of theparameters proportional to the distance of the data points:

�� � ��� � ������ � � � �� � � � � � � with � � ��� ��

�� � �� ���� � �� ���� � � � �� � � � � � �

This parametrization is called

��

uniform for � � �

centripetal for � � �#� �

chordal for � � �

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

�� �������

��� �� � for � � �� � � � � � � � �� � � � ���� � �

Page 68: Geometric Modelling

4 B-splines 56

!� !� !� !� !�

��

��

��

��

��

�� �� � � �

����

��

��

Figure 4.22: Chordal parametrisation

Remark: It is also possible to choose the knot vector� depending on the parameter values��. Cubiccase:�� � �

������ � ���� � �����

Page 69: Geometric Modelling

57

5 Rational Curves

A more general approach arerational curves. Using thepolynomialcurves we have examinedso far it is not possible to represent conic sections (e. g. circle arcs). This becomes possible ifwe extend the schemes to rational curves. Of special interest in this chapter are rational Béziercurves 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�4 ��4 � 4)and can be represented by a line through the origin:

"

!

�"!�"#�"�

�!� #� ��

Figure 5.1: Homogeneous coordinates

By projection onto the plane4 � � (division by4) we get back the 2D point.

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

5.1 Rational Bézier Curves

Definition 5.1 (Rational Bézier curve)A rational Bézier curvein � �� � �� �� is the projection of a polynomial Bézier curve in��� .

Definition 5.2 (Rational Bézier curve, analytic definition)Given:

– control points��� � � � ��� � � (e. g.�� � �� )

(projections of the�� ��-dimensional control points��� � � � � ��

��)

Page 70: Geometric Modelling

5 Rational Curves 58

"

!

#

��

��

��

" � �

$��

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

– weights4�� � � � � 4� � �� 4� � �(homogeneous�� �� component of the control points)

We can assume without loss of generality:4� � 4� � �.

Then:

5��� ��

����� �

�� ��� �4� � ����

��� ��� ��� � 4�

� � � ��� �� (5.1)

is calledrational Bézier curveover the interval��� ��.

5.1.1 Properties of rational Bézier curves

Let� ��� a rational Bézier curve and4� � 4� � �� 4� � �.

(1) If all 4� � �, then we get the well known polynomial Bézier curves.

(2) � ��� � ���� � � � ���� (convex hull property)

(3) � ��� � ��� � ��� � �� (endpoint interpolation)

(4) The curve is tangent to the control polygon in the endpoints.

(5) Affine (even projective) invariance� affine yields:

���� � � � � ��

���

����� �����

��� � � � � ������� ! !

5���� ���

��� ��� ����

��

����� ����

��� ��� ����

��

�I. e. ��5���� �

�� �

�� �������� �

�� ���

(6) � ��� shows the variation diminishing property with respect to���� � � � ����.

Page 71: Geometric Modelling

59 5.1 Rational Bézier Curves

5.1.2 Evaluation of rational Béziercurves

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

4� �

4�

�� ��� ��

�4��� �

���

4���

� �

�4����� �

�����

4�����

�(5.2)

�"�� �

��

"��

� �"�� �

��

"��

� �"�� �

��

"��

�"�� �

��

"��

� �"�� �

��

"��

�"�� �

��

"��

�� ��

��

Figure 5.3: de Casteljau scheme for rational Bézier curves

Problem: The Algorithm is numerically unstable if the weight differ very much.

2nd possibility: Rational de Casteljau algorithm

��� ��� � ��� �� � 4����

4��

� ����� ��� � � 4������

4��

� ������� ��� (5.3)

with 4�� � ��� �� � 4���

� � � 4������ � for � � �� � � � � �� �" � � �� � � � � �

5.1.3 Influence and properties of the weights

Theorem 5.1 (Effect and properties of the weights)(1) For4� � 4� � � � � � 4� � � the rational Bézier curve is equal to a polynomial Bézier

curve.

(2) Multiplication of all weights with a common factor does not change the curve.

(3) More general: If for all ratios

4�

4���

�4���

4���

� const.

then the curve has the same shape but another parametrization.

(4) Increasing the weight4� pulls the curve to the control point��. Decreasing the weight4� pushes the curve away from the control point�� (see Figure 5.4).

Page 72: Geometric Modelling

5 Rational Curves 60

(5) In the limit case:

# �����

� ��� � ��� (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

Definition 5.3 (Conic section)– analytic: given a quadratic polynomial

)��� � � � �� � � . �� �� �quadratisch

� � 6 � �� �linear

�����konstant

then a conic section is defined as the point set

����� � �� ��� � �)��� � � �� �

i. e. a conic section is the

– geometric: section of a plane with a double cone.

The coefficients�� �� . determine the type of the conic section.

� �� � � . � � ��� �

�� �#��#� .

� ��

The type of the conic section can be seen directly from the determinant of this matrix.

Graph Angle between cone axisand plane

determinant of

�� �#��#� .

ellipsis greater than cone openinggreater than 0

parabola equals cone opening equals 0

hyperbola less that cone opening less than 0

Page 73: Geometric Modelling

61 5.1 Rational Bézier 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 Bézier curve is part of a conic section. For4� � 4� � � and4� � � we have:

�� �

��

ellipsis

parabola

hyperbola

&'( �

��

� � 4� � �

4� � �

4� � �

– Each part of a conic section can be represented as a rational quadratic Bézier curve.

5.1.4 Quadratic rational Bézier Curves as Conic Sections

Theorem 5.3Given: a rational quadratic Bézier curve� ��� over��� �� with

� ��� ���� ��� �� � � ��� ��4� �� �

� ��

��� ��� � � ��� ��4� ��� (5.5)

Choose coordinate system�2� 7� such that

�� �

���

�� �� �

���

�� �� �

���

��

Page 74: Geometric Modelling

5 Rational Curves 62

Then:� ��� is part of a conic section with the defining equation

��� 2 � 7�� � �4�� � 2 � 7 (5.6)

Proof: Let8�� �� �� � ��� 8�� �� �� � ��� ���� �� ��� ��� � � ��� ��4� ��.

��� � ��� ���� �������

�� � � ��� ��4�

������

��

������ �

���� �������

�� ����� ��� ��� � ��

������

��

������ �

���� �������

��� � ��� ��

������� � ��� �� �

��� �������

8�� ��

����8�� ��

Thus, in the coordinate system2� 7 we have

2��� ���� �������

7��� ���

����

and additionally:

� � ��� ��4�

����� �� 2���� 7���

� �4�� 2 7 �

�4�� ��� ��� �������

��4� ��� �� �

����

��

� ��� 2 � 7��

(2) From equation 5.6 follows2� 7� ��� �4���27 � � 2 � � 7 � � � and therefore

�2� 7�

�� �� �4�

�� �4�� �

� �27

� � � �

�$%

�� �� �4�

�� �4�� �

�� �4�

� ��� 4���

� �� �

��

ellipsis

parabola

hyperbola

&'( �

��

� � �4�� � �

�4�� � �

�4�� � �

5.1.5 Segments of Conic Sections as quadratic rational Bézier Curves

Given:

– )��� � � � �� � � . � � � 6 �

– conic section�� � ��� � �)��� � � ��

Page 75: Geometric Modelling

63 5.1 Rational Bézier Curves

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

Find: Representation of the corresponding segment of a conic section as a rational quadraticBézier curve���������" 4�" 4� � 4� � ��.

Procedure:

(1) Choose����� as given.

(2) Choose�� as intersection point of the tangents+� and+�:

+� ��

�()

( � �()(�

�� ��� � � ��

Intersection point: solve�� �+� � �� � +�.

(3) Express the given polynomial)��� � in the coordinate system�2� 7� with

�� � ��� ��� �� � ��� ��� �� � ��� ��:

� � ��� � ��� 2 ��� � ��� 7 �� � � � � �� 2 � � � �� 7 �

Inserting this into)��� � gives a new polynomial (also of degree 2) with�)�2� 7� �)��� �. �) describes the conic section in the coordinate system�2� 7�.

(4) Determine the weight4� using equation 5.6

�)�2� 7� �

��

�4��

��� 2 � 7�� � 2 7�0 �

� 0

��

�4��

�2� 7� � � 2 � � 7 ��

��

�4��

� �

�2 7

These are two equations for two variables� comparison of the coefficients gives thesolutions4�� 0.

Example: Unit circle:)��� � � �� � � �� �� � ��� ��� �� � ��� ��� ����

� � �� ����

� �

��

����� "� �

���

(1) �� � ��� ��� �� � ��� ��

Page 76: Geometric Modelling

5 Rational Curves 64

(2) +� � �� ��� �� ���� � ������" +� � ��� ��

��� �� � ������ � ��� �� � ��� ��

� � � ���� � � �

�� �� � ��� ��

(3)

��

��

�� ���� �

��27

���

� �)�2� 7� � ��7 ��� ��2 ��� � � � 2� 7� � � 2 � � 7 � �� �

(4) Comparison of coefficients to determine4� and0:

� � ���

�" � �

��

����� �

�0

4�� �

��� 4� �

� �

Remark:For a circle arc of an arbitrary opening angle� � � we get�� � �� �� .

5.1.6 Rational Bézier-Spline Curves

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

��

��

���

��

���

� ���

��

����

��

����

� ����

��

�������

����� �

�����

������

���

The weights are4� � 4� � � and4� �� �

(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 quitetypical for rational spline curves. By projection one can gain differentiability!

Page 77: Geometric Modelling

65 5.2 Rational B-Spline Curves (NURBS)

Theorem 5.4Given: Rational Bézier curves� � ��� �� � � and) � ��� �� � � with control points��� � � � ���, �� � � � � � and weights4�� � � � � 4�, �� � � � � �. Additionally, set4� � 4� �� � � � �.The curve composed from� and) is continuously differentiable�

�� � � �4���

4��� �����

�4��� �

�� (5.7)

Geometric interpretation:�� � � divides the line segment from���� to � by the ratio� �4���.

Proof: We have� ���� � �4������ � ����� and)���� � � ��� � ��. Because� � ��, wecan summarize:

� �� 4���� � � � 4��� �����

5.2 Rational B-Spline Curves (NURBS)

no local support local support

rational rational Bézier curves NURBS

polynomial Bézier curves B-splines

Table 5.1: Summary: polynomial and rational curve schemes

“NURBS” = non-uniform rationalB-spline.

Definition 5.4 (Rational B-spline curve)A rational B-spline curvein � is the projection of a B-spline curve in��� .

Definition 5.5 (Rational B-spline curve, analytic definition)Given:

– degree�,

– knot vector+ ,

– control points��� � � � �����,

– weights4�� � � � � 4��� � � with 4� � 4��� � �.

Page 78: Geometric Modelling

5 Rational Curves 66

Then:

� ��� �

������� �

�� ���4� ������

��� ��� ���4�

(5.8)

is calledrational B-spline curve.

Advantages:

– compared with rational Bézier-spline curves:����-continuity of rational B-spline curvesof �th degree

– compared with B-spline curves: more degrees of freedom

Disadvantages:� is linearly dependent of the��, butnot of the4�.� For tasks of approximation and interpolation NURBS are improper, because you can’t builda linear system of equations.

Page 79: Geometric Modelling

67

6 Elementary Differential Geometry for Curves

We are not (really) interested in the parametric representation of curves but in the “shape” of acurve. What characterizes shape?

6.1 Reparametrization

Definition 6.1 (Regular curve)Let� � ��� ���� a differentiable curve�� � �" ��. Then:� is calledregular� � ���� �� � forall � � ��� ��. � ���� is the (unique)tangent directionat the point� ���.

Now we consider areparametrizationor parameter transformationof a regular curve:

� � ��� ��� ��� �� ���� � �� ���� � � � &� ��� � � ������

Definition 6.2 (Equivalence of curves)Let � � ��� ��� � and &� � ��� ��� � regular curves. Then:� and &� are calledequivalent(notation:� � &� ) � there exists a differentiable mapping� � ��� ��� ��� �� with ���� � � forall � � ��� �� such that&� ��� � � ������.

Example:

&� � ����

����� � � �� ���� ���

� � ��� ����� � �� �� � �

� � ����

��� ��� �� � � �� ��� ����� � � � �� � � � &�

Example: Arc length

Let � � ��� ���� a regular curve. If we denote the length of the curve segment� ��� � � � �� with 9!", then:

9!" � # ������������

)��

�� ������� � �����*�

� # ������������

)��

�� ���������� � ����*�

+ !

"

�� ����� ��(6.1)

This leads to a nice parametrization (arc length parametrization). In this special case we have9!" � � � � for all �� � and therefore+ !

"

�� ����� �� � � � � � �� ����� � � for all ��

Page 80: Geometric Modelling

6 Elementary Differential Geometry for Curves 68

� �&� � ���

� ���

� ���

Figure 6.1: Arc length

Example: Circle: � ��� �

�� �� �� � � �

�� � � �� � � � � �:

Parameter transformation: �� �:� � yields &� �� �

�� �� �#$

� � � �#$�

�� � �� � � � � ��

� �� ����� � �� � &� ���� � �.

Theorem 6.1Every regular curve can be reparametrized by arc length parametrization. This can be achievedby 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:Bézier curves are rarely arc length parametrized.

6.2 Planar Curves

Definition 6.3 (2D Frenet frame)Given: Let� � ��� ����� a regular parametric curve.

The local coordinate system6����� 6����� with

6���� �� ������ ����� (6.3)

6���� � 6���� rotated by��Æ (6.4)

is called2D Frenet frame1 of � .

1Jean Frédéric Frenet (1816-1900)

Page 81: Geometric Modelling

69 6.2 Planar Curves

'�'�

Figure 6.2: The 2D Frenet frame

Theorem 6.2 (Frenet)For the derivatives of6���� and6���� the following holds:

6����� � 4��� 6����

6����� � �4��� 6����

The quantity;��� � ���% ��� is calledcurvatureof the curve.

For arc length parametrized curves:

;�� � 4�� �

���� ����� curve bends to the left

��� ����� curve bends to the right

Sketch of Proof: The theorem states that6� and6�� (respectively6� und6��) are perpendicular;this is the case if and only if�6����� � const., because from� � � �6� � 6��� � �6� � 6�� �follows �6������ � � and�6����� � const. This is true by the normalization of6�.

Remark:

– ���� � ��&�� is the radius of the osculating circle with the midpoint

� � �� ��

������������

Theorem 6.3For a curve point� ��� �

����� ���

�it holds true that

;��� ������ ������ ������ ����

������� �������'�

(6.5)

Example: Ellipsis:� ��� ��

����� ���

��

�� �� �� � � �

�� � �� � �� ��� � �� �� � � � � �� � �� � �� � ��

Page 82: Geometric Modelling

6 Elementary Differential Geometry for Curves 70

� ;��� �� � � �� � � � ��� �

��� � �� � �� ��� ���'�

�� �

��� � �� � �� ��� ���'�

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

– ; � � � � is a line segment.

– ; � ;� � const.�� � � � is a circle arc (with radius�&�

).

Remark:Distinguish betweengeometricandparametricproperties of a curve.Geometricmeans inde-pendent of the parametrization. Example:

geometric parametric

unit tangent vector tangent vector�����Frenet frame curvature vector������curvature� all derivatives

6.3 Space Curves

Definition 6.4 (3D Frenet frame)Given: curve� � ��� ����� . The local coordinate system6����� 6����� 6����� with

6���� �� ������ ����� unit tangent vector

6���� � 6����� 6���� main normal vector (6.6)

6���� �� ����� � ������� ����� � ������ binormal vector

shows the following properties:

– 6����� 6����� 6����� is orthonormal

– �!��6����� 6����� � �!��� ����� � ������ with the same orientation

– 6����� 6����� 6����� is positively oriented (right handed system)

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

6����� � 4���� 6����

6����� � �4���� 6���� 4���� 6����

6����� � �4���� 6����

(6.7)

Page 83: Geometric Modelling

71 6.3 Space Curves

'�'�

'�

Figure 6.3: The 3D Frenet frame

In matrix notation: ��6��6��6��

�� �

��� � 4� �

�4� � 4�

� �4� �

�����6�6�6�

��

Definition 6.5 (Curvature and torsion)

curvature: ;��� ��4����

�� ����� (6.8)

torsion: -��� ��4����

�� ������ (6.9)

Theorem 6.6Formulas to compute; and- :

quantity arc length parameter arbitrary parameter

;��� �� ������ �� ����� � �������� ������

-����$%�� ����� � ������ � �������

�� ��������$%�� ����� � ������ � �������

�� ����� � �������

(6.10)

Example: Spiral:� ��� �

������ �������

�� �

��� �� �� � � �< �

��

Derivatives:

�� � �� � � � ��� � �� �� � ���� � � � ��

� � � �� � �� � �� � �� ��� � �� �� ��� � < ��� � � ���� � �

Page 84: Geometric Modelling

6 Elementary Differential Geometry for Curves 72

Figure 6.4: Spiral

6� ��

���(�

���� � ��� �� �<

�� � 6� �

� ���(�

�� < � � ��< �� ��

��

6� � 6� � 6� � ����(�

���<� �� �� �� �� ��<� � ��� �� � ��

�� �

��� �� �� � ��

��

;��� ����� <����� <�

�� ��

�� <�

-��� ��

�� <�

,,,,,,,�� �� � �� �� � � � ��

� .=�� �� � � � �� �� �< � �

,,,,,,, ���<

�� ��� <���

<

�� <�

Remark:

– The osculating planeis ������� �� � ����� ����� � ����� (see osculating circle for planarcurves).

– Thenormal planeis ������� ��.

– 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. Ad-ditionally:

– - � � � 6���� � � � � is a planar curve.

6.4 Geometric and Parametric Continuity

Remember: continuity of composed Bézier splines

Two polynomial curves� � ��� ���� and) � ��� .��� are called (parametric)��-continuousat �, if � ��� � )���� � ���� � )����� � � � � � ���� � )����.

Page 85: Geometric Modelling

73 6.4 Geometric and Parametric Continuity

���

� ��

��

Figure 6.5: Continuity of Bézier splines

Definition 6.6 (Geometric continuity)Two polynomial curves� � ��� ���� and) � ��� .��� are called (geometric))�-continuousat �, if the arc length parametrizations&� and &) are��-continuous.

Remark:��-continuity depends on parametrisierung ab,��-continuity does not!

Theorem 6.8 (Charakterization of geometric continuity)The following statements are equivalent:

(1) � and) are)�-continuous

(2) either� or) can be reparametrized such that� and &) (or &� and)) are��-continuous.

(3) There exist constants��� � � � � �� (“Beta-constraints”) such that

)���� ������

��������

��������� ����

��

��� �� ��� �� � � � ��� ���� � � ��� ���� (6.11)

Proof: Let' and( parameter transformations such that&� � � Æ ' und &) � ) Æ(.

��� � ���: &� and &) are��-continuous� F and &) Æ ( Æ '�� � ) Æ �( Æ '��� are��-continuous.

��� � ���: Assume:) and� Æ ' are��-continuous at�.

� � � � )���� � �� Æ '����� � � ��'���� � '���� � � ��'���� � ��� � � � )����� � �� Æ '������ � � ���'���� � '����� � ��'���� � '����� � � �� � ��� � � � ��� � � � )������ � �� Æ '������� � � ��� ��� �

�� ����� � �� ���� � � ��

Note that�� � '����.

In matrix notation: ��������

)�

)��

)���...

)�

�������� �

��������

��

�� ����� ����� ���...

. . .

�� � � � � � � � � � ���

��������

��������

� �

� ��

� ���...

� �

��������

Page 86: Geometric Modelling

6 Elementary Differential Geometry for Curves 74

(3) � (2): Define' locally by

'��� � � �� ��� �� ����

� � � ������� ���

Remark:Normally, of interest are only:

– �� � ����� � �� ����� für �� � �

– �� � ������ � ��� ������ � �� �

����

– �� � ������� � ��� ������� � ���� �

����� � �� �����

6.4.1 Geometric Continuity of Bézier Curves

Given: Bézier curves� � ��� �� � � and) � ��� .�� � with � ��� ���

��� ��� ����� and

)��� ���

��� ��� ��� � and the interval lengths�% � �� � and�� � .� �.

Theorem 6.9 (Characterization of)�-continuity (tangent continuity))Equivalent are:

(1) � and) are)�-continuous

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

(3) divide ratio:

���� �� � �� ��

��� ��

Sketch of Proof: (1) � (2): follows from)���� � �� � ����

(1) � (3): use equation for�-constraints and� ���� � � �

��� � ������ )���� � �

�� � ��

Theorem 6.10 (Characterization of)�-continuity (curvature continuity))Equivalent are:

(1) � and) are)�-continuous

(2) � and) have the same unit tangent vector and the same curvature vector at� (6%� �6�� � 6

%� � 6�� � !

% � !�)

(3) There exist constants0�� 0� with 0�� 0� � � such that the generalized A-frame propertyholds.

Page 87: Geometric Modelling

75 6.4 Geometric and Parametric Continuity

���� �� � �� ��

����

��

��� ��

���

�� ���

��

Figure 6.6: Generalized A-frame property

Sketch of Proof: (1) � (3): Use�-constraints:

� ���� � ��)���� and

� ����� � ��� )����� ��)���� and for the control points

�%��� � ����� �

�� �

���� � ��

���� ��

��%

��� ����� ����� ���� � ��� ��

���

�� � �� �� �� �

���� � ��

generalized A-frame condition:

�� � �

� � � ���0�0��%

��� � �����

���� ��

0��%

����� � ����� � � � 0��%

��

�� � ��

0� �� �� ��� �

��

�� � �� � ���

0� ��� � �� � ���

� �� ���

respectively

�� ��0�0�

�� � � �0� � ���0�0� � � 0�0� �0�

Page 88: Geometric Modelling

6 Elementary Differential Geometry for Curves 76

Page 89: Geometric Modelling

77

7 Tensor Product Surfaces

7.1 General Approach

Given: two curve schemes in 3D space:

� ��� ���

������� and )��� ���

3������

with scalar basis functions����� and3����.

The tensor product of these schemes is:

>��� � ����

�����3��� �� (7.1)

-1

0

1

2

-1

0

1

2

-1

0

1

-1

0

1

2

-1

0

1

2

Figure 7.1: A tensor product Bézier surface

Of special interest are:

Definition 7.1 (Tensor Product Bézier Surface)

>��� � ����

���

����

��� ����

� ����� (7.2)

Definition 7.2 (Tensor Product B-Spline Surface)

� ��� � ��

�����

����

����� ������)

����� (7.3)

with knot vectors+ � ��� � � � � ����� and> � ��� � � � � �����.

Page 90: Geometric Modelling

7 Tensor Product Surfaces 78

Remark:We can factorize:

��� !� ���

������!� ��� ���

�����

���

�!� ���

�!�

���

����� ���

Each fixed� 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 Bézier and B-spline surfaces: consider aTP Bézier or a TP B-spline surface in 4D space (homogeneous coordinates) and divide by the4component. This gives:

�� �

����4��

� ��4��

����4��

�Definition 7.3The array of control points��� of a tensor product surface is called thecontrol netof the surface(analogon of control polygon for curves).

�� � � �

�� � � �

���

���

���

���

Figure 7.2: Parameter grid, control net and resulting surface

7.2 Tensor Product Bézier Surfaces

Given: a tensor product (TP) Bézier surface

>��� � ����

���

����

��� ����

� �����

Theorem 7.1 (Shape properties of TP Bézier surfaces)(a) Convex hull property:>��� � � convex hull��� � � � �� � �

for �� � ��� ��.

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

>��� �� � ���� >��� �� � ���� >��� �� � ���� >��� �� � ���.

Page 91: Geometric Modelling

79 7.3 Algorithms for TP Bézier Surfaces

(c) Tangency in the corner points, e. g. the tangent plane at>��� �� � ��� is spanned by��� � ��� and��� � ���.

(d) The boundary curves are Bézier curves, their control points are the boundary points of thecontrol net (e. g.>��� � � � �� is Bézier curve).

(e) Affince invariance

(f) Variation diminishing property doesnot hold!

Sketch of Proof:

– affine invariance:>��� � ����

���

���� �

�� ����

� ����� must be a barycentric (affine)

combination:����

������

��� ���

���

�� �����

� ��� �� � �

– convex hull:� �� � and��� ����

� �� � � � >��� � is a convex combination.

7.3 Algorithms for TP Bézier Surfaces

7.3.1 Evaluation with the TP Approach

Given:

– TP Bézier 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 first in -direction, afterwards in�-direction. The evaluation with the TP approach first 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 � �: first in �-, afterwards in-Richtung

– If � �: first in -, afterwards in�-Richtung

Page 92: Geometric Modelling

7 Tensor Product Surfaces 80

��� ���

��� �������

����

(�� )�

)

Figure 7.3: de Casteljau scheme for tensor product Bézier 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 thedirect de Casteljau Algorithm (see Figure7.5). Therefore the evaluation scheme looks like athree-dimensional pyramid.

Page 93: Geometric Modelling

81 7.3 Algorithms for TP Bézier Surfaces

Algorithm 7.1 (Direct de Casteljau)

������ � ���

������ � � ��� ��� � �

�����������

�� ������������

������������ �

�������������

����

��

�(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 difficult.

Comparison of direct de Casteljau and TP approach according to the number of convex combi-nations (CC):

TP approach direct de Castejau

� � � � � � � � � ��CC �� � � � ��CC

� � � � � � �� �� � ���CC �� � � � ���CC

In practice the TP approach is used, because it is more efficient and you don’t have to do anydistinction of cases.

Remark: Other algorithms like degree elevation or subdivision can be derived from the correspondingalgorithms for curves.

Page 94: Geometric Modelling

7 Tensor Product Surfaces 82

7.4 Tensor Product B-Spline Surfaces

Given:

– � knot vector+ � �� �� � � � ������������

– knot vector> � �� �� � � � ����� �� ���

– array of control points��� � � � � � �� � 3 � ��� ��� � � ���� �� �� ���� �� �

– surface

� ��� � ���������

������

����� ������)

�����

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

��� � � ������ ������� � ����� ������ � � ��� � � convex hull���� � � % � �� � �

(b) Affine invariance

(c) Endpoint interpolation: if�� � �� � � � � � �� � � � � � �� � � � � � ���� and�� � �� �� � � � �� � � � � � �� � � � � � ���� then

� ���� ��� � ����� � ��� � ��� � ������� � ���� ��� � ������� � ��� � ��� � ��������.

In this case: tangency in the corner points, and the boundary curves are B-spline curveswith the boundary points of the control net as curve control points. The tangential planeat the corners is spanned by the control points, e. g.+% ���� ��� � ��� ?���� � ���� ,���� � ����.

(d) Local control: “a control point has influence” only on a part of the surface.

Changing��� will change� ��� � only for ��� � � ���� �������� ��� ������.

(e) Variation diminishing property doesnot hold!

Remark:Remember from curves: a Bézier curve is a special case of a B-spline curve. A Bézier curveover 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.

Page 95: Geometric Modelling

83 7.5 Algorithms for TP B-Spline Surfaces

7.5 Algorithms for TP B-Spline Surfaces

7.5.1 Evaluation of TP B-Spline Surfaces

Given: � ��� � ������

��� ����� ���

������ �

��) ����� with knot vectors> and+ .

The proceeding is similar to the TP approach of TP Béziersurfaces:

(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) ina local area will produce overhead, because the refinement of the control net can only be doneby adding new rows and columns.

�� ����

��

� ��

��

��

Figure 7.6: Knot insertion with the Boehm algorithm

One alternative arehierarchical 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)��� � defined over a locally refined parameter grid. You can see in Figure 7.7 thatthe grid is refined only where needed.

��

� �� )� �� )� �� �� )���

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

Page 96: Geometric Modelling

7 Tensor Product Surfaces 84

7.6 Interpolation and Approximation

7.6.1 General interpolation

Be� ��� � ���

�� @

�� ����

� ����. Consider@�������� as basis functions����� �:

� ��� � �

����������

����� ��

Task: Interpolation/approximation of data points�� with parameter values���� ��:

� ���� �� �

����������

������ ��.��� �� � � � �� � � � � ��� �� � �3 ���

Interpolation and approximation are exactly the same as for Bézier and B-Spline curves.Problem: For curves we have the Theorem of Schoenberg-Whitney, that says if the interpola-tion/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���� � for � � �� � � � � � � � �� � � � �3

Find: surface� ��� � ���

���

����@

�� ����

� ��.� with � ���� �� � ���

� � �� � � � � � � % � �� � � � �3���@����� � � � @�����

......

@����� � � � @�����

���

� �� �*

����� � � � ��

......

�� � � � ��

���

� �� �+

�������� � � � �����

......

����� � � � �����

���

� �� ��

������ � � � ���

......

��� � � � ���

���

� �� �,

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

(1) Solve@ � A � B

(2) SolveA � � ���

Tasks (1) and (2) are interpolation problems of curves, for whom the corresponding algorithmscan be applied.

Interpolation at the knots:If ���� �� � ���� ��, then tasks (1) and (2) are tridiagonal matrices and therefore solvable in afast way.

Page 97: Geometric Modelling

85 7.7 Trimming of parametric Patches

7.7 Trimming of parametric Patches

One disadvantage of tensor product Bézier and B-spline surfaces is that all patches are square-like; it is not possible to model surfaces that does not have a well-defined tangent plane (i. e. if� ���� � �).

Figure 7.8: Trimming a patch

A solution aretrimmed patches. Specify a set of closed contours)�� � � � �)� in the parameterdomain, where)� is the outer contour and)�� � � � �)� are inner contours (see Figure 7.9). Bydefinition:� ��� � shall belong to the trimmed surface if

– ��� � is insidewith respect to)� and

– ��� � is outsidewith 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.4Given: a closed contour) � ��� ����� with )��� � )���:

– � is inside) �� a ray emanating from� intersects the contour� times with� beingodd.

– � is outside) �� a ray emanating from� intersects the contour� times with� beingeven.

Page 98: Geometric Modelling

7 Tensor Product Surfaces 86

��* *�

�* *�

�* �*

Figure 7.10: Determining inside and outside of a trimmed patch

Page 99: Geometric Modelling

87

8 Ray Tracing of TP-Bézier Surfaces (Bézier Clipping)

In this chapter, we want to discuss an algorithm to compute intersections between rational tensorproduct Bézier surfaces and rays. In particular, this is important for rendering Bézier patchesusing the ray tracing approach.

For more information see Nishita et al., Siggraph90.

Given:

– rational TP Bézier patch

� ��� � ��

�����

���� ��������4� ����

���

���� ��������4�

(8.1)

– rayC��� � �� � 8�

Find: intersection, i. e. find� and��� � such thatC��� � � ��� �.Remark:This problem is analytically solvable only for low polynomial degrees. Therefore an iterativeapproximation algorithm as presented here is normally a better approach.

1st step:

Represent the ray as an intersection of two planes:

�� � �� .� � �� � �

�� � �� .� � �� � �

+�

Figure 8.1: Bézier clipping, step 1

Example: Select plane normal vectors that are perpendicular to8 � ���� ��� �-�, e. g.���� ��� .�� � ����� ��� �� and���� ��� .�� � �����-� ���. Then determine�� and�� by applying��:

�� � ���� ��� �� ��� .� �� ��� � ���� ��� �� ��� .� �� �

Page 100: Geometric Modelling

8 Ray Tracing of TP-Bézier Surfaces (Bézier Clipping) 88

2nd step:

Find intersection of� with the two planes:-������.�

��,,,,,, � ��� �

. �� � � � � � �" �

�-������

.�

��,,,,,,

�����

����

��������4� ��

. ��

�����

����

��������4� � �

We get

5��� � ������

����

�� �������� � � and

>��� � ������

����

�� �������� � �

with

�� �� 4�

-������.�

��,,,,,, ��

. ��4� and

�� �� 4�

-������.�

��,,,,,, ��

. ��4��

Remark:This is a projection of� ��� !� along"��� onto a plane that is perpendicular to"���.

,

���

��

��

��

��

��

��

��

��

Figure 8.2: Bézier clipping, step 2

3rd step:

Page 101: Geometric Modelling

89

Choose two directions in��� �� space:

�� direction� perpendicular to� direction,� � const.�$ direction� perpendicular to direction, � const.

In case of a biquadratic patch:

�� ��

����� � ������ � ���

���� � ������ � ���

��

�$ ��

����� � ������ � ���

���� � ������ � ���

��

,

-�

-�

Figure 8.3: Bézier 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 aBézier representation of the “distance-to-��”-function that can be used to determine the distanceof an arbitrary point to��:

B��� � ������

����

�� ��������

5th step:

Plot the values

��

�� ��

�in a�-�-diagram (see figure 8.4)

6th step:

Determine the convex hull of the points in this diagram (by connecting maxima and minima ofthe columns) and intersect it with the�-axis. This gives an interval������ �����.

Page 102: Geometric Modelling

8 Ray Tracing of TP-Bézier Surfaces (Bézier Clipping) 90

��

���

Figure 8.4: Bézier clipping, steps 5 and 6

7th step:

Clip away the parametric domain� � ���� and� � ���� by two subdivision steps (using the deCasteljau algorithm for Bézier patches).

Switch direction��� � �$ � �� � � � � � and repeat steps4 to 7. The parameter values of theintersection point must be within the box������ ������ ����� ����.

Stop when the size of the box is smaller than a threshold value or the convex hull in step6 doesnot intersect with the axis; this indicates that there is no intersection ofC and� .

Figure 8.5: Bézier clipping, step 7

Page 103: Geometric Modelling

91

9 Triangular Bézier Patches

The tensor product surfaces discussed in the previous chapter have been defined over rectangularparameter domains. Now we will consider Bézier patches defined overtriangular parameterdomains. There are two major advantages:

– triangles give more topological flexibility

– tensor product surfaces have high polynomial degree, e. g. a biquadratic TP patch hasactually 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� � � 2 �� 7 ��. We call 2 and 7 the standard coordinatesof � with respect to thecoordinate system��� ���. Now we introduce another type of 2D coordinates based on threepoints:

Definition 9.1 (Barycentric coordinates)Given: Three points�, � and� that are not on a line. An arbitrary point� can be representedas an affine combination

� � !� " � - � � ! " - � �� (9.1)

The coefficients!� "� - are calledbarycentric coordinatesof � with respect to the triangle��5� >� + �.

Theorem 9.1Given: Triangle��5� >� + � and point�. The barycentric coordinates!� "� - of � with respectto��5� >� + � are unique and can be determined by

! ���������

��������� " �

��������

��������� - �

��������

��������� (9.2)

where

�������� �� �$%

���5� >� +�

5� >� +�

� � �

��� �

Page 104: Geometric Modelling

9 Triangular Bézier Patches 92

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

5� >� +�

� � �

�����!"-

�� �

������

��

So we have

�������� � �$%

�5� � +� >� � +�5� � +� >� � +�

�� �$%���������

�� �

� ��� and��� are linear dependent.

The formulas for!� " and- follow from Cramer’s rule. �

$ (

.

/ 0

Figure 9.1: Barycentric coordinates

Remark:

– Because of�������� � ����������� � � ������������ we can represent the barycentriccoordinates also as ratios of areas, i. e.

� ������������

������������ # �

�����������

������������ $ �

�����������

�����������

– � 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� � ��.��� .

The�th Bernstein polynomial of degree� over the interval� � ��� �� is defined as follows:

� ��� �.� �

��

�� ��� ��� ���� ���

Page 105: Geometric Modelling

93 9.2 Bernstein Polynomials over Triangles

$ (

.

/

0

./ 0

.

/

0

� �

� �

Figure 9.2: Divide ratios and barycentric coordinates

Definition 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 aBernstein polynomialover the triangle�.

Example:

��

���

���

��

���

���

� ���� ���

���

Figure 9.3: Arrangement of indices�%� for � � Bernstein polynomials

Theorem 9.2The Bernstein polynomials��

���� � � � � �� form a basis of��� (= bivariate polynomialsof degree �).

Sketch of Proof: The number of Bernstein polynomials is������ � �� � ����������,

which is the dimension of bivariate polynomials of degree �. Example: for� � � we have 10linear independent polynomials:�� �� � ��� � � �� ��� �� � � �� ��. �

Theorem 9.3 (Properties of triangular Bernstein Polynomials)(1) If � is inside��������, then��

���� � �.

Page 106: Geometric Modelling

9 Triangular Bézier Patches 94

(2) Partition of 1: �������

��������� � � (9.4)

(3) Recursion:

������ � !�

������� " �

������� - �

������� (9.5)

Sketch of Proof:

(1) follows from definition;!� "� - � � if � is inside��������.

(2) � � �� � �! " -�� ��

������

��

�� � ��!� " -�

(3) !�������� � !

��� ���

��� ��� � ��!��� " -� �

���

����.

Similar for" �������� and- ��

������.

Theorem 9.4 (Polar Forms in 2D)For each polynomial� � �� �� of degree� there exists a unique polar form� � ����

���

with

– � is symmetric

– � is multiaffine, i. e.

����� �� *� � &��� ��� � � � � ��� � � ����� *�� ��� � � � � ��� � ����� &�� ��� � � � � ���

– � is diagonal, i. e.� ��� � ���� � � � � �� �� ��

�.

Example: � �� ��� �� �� �� ���� ��� �� �� ���� ��

� ��� ����� � � � � ���

� �

� ����� ���

��� � ��

�� �� ��

� ����� � �� ��

� � �

Page 107: Geometric Modelling

95 9.3 Triangular Bézier Patches

9.3 Triangular Bézier Patches

Definition 9.3 (Triangular Bézier Patch)Given: degree�, parameter domain� �� ��������, points��� with � � � �. Then:

� ��� ��

������

� ������������ (9.6)

is calledtriangular Bézier patchover the triangle�.

The points��� are calledcontrol pointsor Bézier points. They form thecontrol net.

����

����

����

����

����

��������

����

����

����

����

����

����

���� ����

����

Figure 9.4: Triangular control nets for� � � and� �

Theorem 9.5 (Control Points and Polar Form)Given: triangular Bézier patch� ��� �

������� �

������������. Then:

��� � ��5� � � � � 5� �� ��

� >� � � � � >� �� �

� +� � � � � +� �� ��

� (9.7)

Sketch of Proof: Let !� "� - the barycentric coordinates of� such that� � !� " � - �.Assume that� � �, then

� ��� � ���� �� �� � ! ���� �� �� " ���� �� �� - ���� �� �� � � � �

��

������

��

�� � ����5� � � � � 5� �� �

� >� � � � � >� �� �

� +� � � � � +� �� ��

��

Theorem 9.6 (Shape Properties of Triangular Bézier Patches)(a) convex hull property:� ��� � convex hull of���� for � � ��������.

(b) end point interpolation:� ��� � ����, � ��� � ����, � ��� � ����.

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

+��� � �!������ � ����������� � ��������(d) The boundary curves are Bézier curves formed by the boundary control points.

(e) affine invariance

Page 108: Geometric Modelling

9 Triangular Bézier Patches 96

9.4 Algorithms for Triangular Bézier Patches

9.4.1 The de Casteljau Algorithm

To evaluate� ���, we need the barycentric coordinates!� "� - of �.

Algorithm 9.1 (de Casteljau for Bézier 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 Bézier patches

9.4.2 Degree Elevation

As an example, we first consider here the degree elevation from quadratic to cubic triangularBézier patches:

� ��� ��

������

� ������ ���

���

������

� ������

����

To find the����, we need a mapping for the polar forms������ ��� � ������ ��� ���:

������ ��� ��� ��

�������� ��� ������ ��� ������ ���� (9.9)

Page 109: Geometric Modelling

97 9.4 Algorithms for Triangular Bézier Patches

It is easy to see that this is symmetric, multiaffine and diagonal, so�� is a polar form.Example:

����� � ��������� ��

��� �������� � ������� � ����

����� � ��������� � ������� � ����

����� � ��������� � ������� � ����

����� � ��������� ��

��������� � �������� �

�����

�����

����� � ��������� ��

��������� ������� �������� �

������ ���� �����

���� � ����� ����� ���� ����� ���� � �����

���� ����

���� � �����

����� �����

����� �����

�����

Figure 9.6: Degree elevation� � �� � �

Algorithm 9.2 (Degree elevation)Given: Bézier triangle� ��� �

�������

� ������ ���

Find: control points���� such that� ��� ��

��������

� ��������

����

���� ��

� ���������� ������� � �������� (9.10)

9.4.3 Subdivision

There are two possibilities to perform a subdivision for triangular Bézier patches:

– 1st possibility: divide�������� into two triangles (“1-to-2 split”).

E. g. dividing the line segment�� with � gives

���������������������������

Page 110: Geometric Modelling

9 Triangular Bézier Patches 98

– 2nd possibility: divide�������� into four triangles (“1-to-4 split”, see figure 9.7).

$ (

1

$ (

1�1�

1�

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

Figure 9.8: A control net and the first 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 twosubdivided triangles (see figure 9.5).

Algorithm 9.4 (1-to-4 split, Farin-Prautzsch method)Perform four 1-to-2 splits with de Casteljau (see figure 9.9).

Instead of subsequently using the de Casteljau algorithm for subdivision, it is also possible topre-calculate the split points using polar forms:

Page 111: Geometric Modelling

99 9.4 Algorithms for Triangular Bézier Patches

$ (

1�

$ (

1�

1� $ (

1�

1�

1�

$ (

1�

1�

1�

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� ��� � at a certain point� in direction 8� ��4�� 4$� is

(�

(8�� # �

���

� �� � 8��� � ����

� 4�(�

(� 4$

(�

(

– total derivative: the Jacobian matrix

D% ��� �

�(�

(�����

(�

(���

�For bivariate functions, the Jacobian matrix is a�� � matrix with� the dimension of thespace�� � �� ��� � D% � �����.

Page 112: Geometric Modelling

9 Triangular Bézier Patches 100

9.5 ��-Continuity of Triangular Bézier Patches

Given: two Bézier triangles� and) which have the parameter domains�% � �������� and�� � ��������.

$

(

1

Figure 9.10: Attaching two Bézier triangles continuously

How to determine that� and) are��-continuous along the edge��? Assume� � �� a pointon the edge incartesiancoordinates� � ���� �$� (and assume that� and) are also given incartesian representation).

– � � �: � ��� � )���.

– � � �: �� and(�

(��()

(�and

(�

(�()

(.

– � � �: �� and(��

(���(�)

(���(��

(��(�)

(�and

(��

(� (�(�)

(� (

– In general:(��

(�� (�

(�)

(�� (for all � � �.

��-continuity can be characterized using polar forms. Assume� and* are polar forms of� and).

– � � �:

���� � � � ��� � *��� � � � ���

���� � � � ����� � *��� � � � �����...���� � � � ��� � *��� � � � ���

– � � �:

���� � � � ��� �� � *��� � � � ��� ��

���� � � � ����� �� � *��� � � � ����� ��...

Page 113: Geometric Modelling

101 9.5��-Continuity of Triangular Bézier Patches

���� � � � ��� �� � *��� � � � ��� ��

for all � � �� . An equivalent condition for��-continuity:�� holds and the above equa-tions hold for� � �.

– � � �:

���� � � � ��� �� ��

��� � � � ��� �� �

� ��� ��� � *��� � � � ��� �� ��

��� � � � ��� �� �

� ��� ���

for all ��� �� � �� . Equivalent:�� holds and�� � � and�� � �.

In general:

Theorem 9.7The Bézier triangles� and) with the parameter domains�% � �������� and�� ��������� are��-continuous if

���� � � � ��� �� ��

��� � � � ��� �� �

��� � � � ��� �� ��

� � *��� � � � ��� �� ��

��� � � � ��� �� �

��� � � � ��� �� ��

� (9.11)

for all � % � and� � �� %.Geometric interpretation (for� � �):

� � E� " � - � is a representation of� in barycentric coordinates with respect to��������. Then:

���� � � � ����� � � � ����� � *��� � � � ����� � � � ����� �

� E *��� � � � ����� � � � ����� " *��� � � � ����� � � � ����� - *��� � � � ����� � � � ������

Figure 9.11: “Diamond condition” for� �

These quadrilaterals (highlighted in figure 9.11) are affine images of the parameter quadrilateral���������, therefore they have to beplanar (“diamond condition”).

Page 114: Geometric Modelling

9 Triangular Bézier Patches 102

9.6 Interpolation with piecewise Bézier Triangles (Split Surfaces)

One application of triangular Bézier patches is the interpolation of scattered data points usingsmooth triangular surfaces.Given: data points���� ��� � � � � ���� �� and corresponding data values��� � � � � ��.

Find: a smooth (i. e.��) scalar function� � �� � � that interpolates the given data, i. e.����� �� � ��.

Note that there exist many approaches to solve this problem.

General procedure:

– 1st step: triangulate the set of data points, e. g. using Delaunay triangulation (see lectureon Graphical Algorithms for details).

– 2nd step: split each triangle. We want to discuss here two methods of splitting, the

– Clough-Tochermethod that gives three cubic Bézier patches and the

– Powell-Sabinmethod that gives six quadratic Bézier patches.

– 3rd step: estimate the normal vectors (or partial derivatives) at each data point. These areused to determine the control points.

9.6.1 Clough-Tocher

Figure 9.12: Clough-Tocher split surface scheme

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

– �: given data points���� �� ���.

– Æ: specified by the directional derivatives obtained in 3rd step.

– �: Assume that the orthogonal derivative along an edge is linear and linearly interpolatethe orthogonal derivative at the end points.

Page 115: Geometric Modelling

103 9.6 Interpolation with piecewise Bézier Triangles (Split Surfaces)

– �: “diamond condition” at the interior edges for� �-continuity

– : choose the barycenter of the triangle.

9.6.2 Powell-Sabin

Figure 9.13: Powell-Sabin split surface scheme

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

– �: given data points���� �� ���.

– Æ: specified by the directional derivatives obtained in 3rd step.

– �: “diamond condition” at the outer edges for� �-continuity

– �: “diamond condition” at the interior edges for� �-continuity

– : 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).

Page 116: Geometric Modelling

9 Triangular Bézier Patches 104

Page 117: Geometric Modelling

105

10 Triangle meshes

Triangle meshes are used for modelling geometric objects. The representation of triangles issupported by the graphics hardware and there are efficient algorithms.Triangle meshes consist of:

– a set ofverticesF � ��� � � ��

– a set ofedgesA � 6��� 6� ! � � ��� � ! �� �– a set oftriangles + � ��������� ��� ! ���� � �� � ��� � �� ! �� � �� with� �� �� �

10.1 Basics

Notations:

– For vertices� the edges6 and triangles� with � � 6 resp.� � � are calledadjacent.

– For edges6 � �� � all triangles� with 6 " � are calledadjacent.

– (1-)neighbourhoodof a vertice: all adjacent triangles and the edges and vertices theyconsist of (see Figure 10.1)

– 2-neighbourhoodof a vertice: neighbourhood of the neighbourhood (see Figure 10.1)

– n-neighbourhood: neighbourhood of the (�� �)-neighbourhood

– valence7$ 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 considermanifoldtriangulation, i. e. triangle meshes with the following properties:

Page 118: Geometric Modelling

10 Triangle meshes 106

(1) The intersection of two different triangles is

– a common edge,

– a common vertice or

– empty. (see Figure 10.2)

Figure 10.2: not possible in manifold triangulations

Page 119: Geometric Modelling

107 10.1 Basics

(2) Edges have

– oneadjacent triangle� border edge

– odertwo 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:7$ � ��adjacent triangles� �

– closed fan(see Figure 10.3), the vertice is a inner vertice:7$ � ��adjacent triangles�

Figure 10.3: open and closed fan

(4) orientable surfaces, i.e.

– the normals can be oriented constantly

– noMoebius 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

F � ��� �� ��� ���� ������ ������� ��� ����������A � �� ��� �� ��� �� ��� �� ��� �� ��� �� ���+ � �� �� ��� �� �� ��� �� �� ��� �� �� ���

Page 120: Geometric Modelling

10 Triangle meshes 108

Figure 10.5: Tetrahedron

Theorem 10.1 (EULER formula for general polyhedrons)If F is the number of vertices,A the number of edges,� the number of faces,) the genus of thesurface (number of holes (see Figure 10.6)) and� the number of border polygons die Anzahlder Randpolygone, we have:

F � A � � ����)�� �

Figure 10.6: Two-torus: surface of genus 2

Example:

– sphere:) � �� � � � � F � A � � �

– tetrahedron:) � �� � � �� F � �� A � �� � � � � �� � � � �

– torus:) � �� � � � � F � A � � �

Page 121: Geometric Modelling

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.2For large triangle meshes holds:� � �F� A � �F

Proof:

i) Each triangle has 3 edges, each inner edge belongs to 2 triangles.� �� � �A � � � �F

ii) F � A � � � (because the genus and the number of border polygons is vanishing inlarge triangle meshes)� F � A �

�A � � � F � �

�A

10.2 Computer representation of triangle meshes

The information of triangle meshes consists of

– geometry: whereare the vertices, edges and triangles?

– topology: howare the vertices connected to edges and triangles?

This information should be suitably stored for the application and as efficient as possible.

Remark:In the following holds:

Below there are presented three possible representations of triangle meshes in the computer:

(1) explicit representationFor all triangles��� the vertices�� � � are stored.� �� � � � � � ��� floats

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

(2) "’shared vertex"’ or "’indexed face set"’

– list of coordinates of all vertices� �� floats

– list of all triangles by referencing the vertex list, i. e. for��� we store��� � �� ��� integers

Remark:

– Efficient because geometry and topology is separated. Therefore it is suitable for archivingthe data.

– Edges are only stored implicitly. Explicit access is difficult.

Page 122: Geometric Modelling

10 Triangle meshes 110

– Frequent operations are expensive (e. g. access to the neighbour of a vertex).

– Vertices of the triangles are normally stored counter clockwise.

(3) extended shared vertex

– list of vertices with reference toone adjacent triangle. (convention for border ver-tices: right border triangle)� �� floats �� 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 trianglemeshes. E. g. neighbour vertices can be found easily because of the stored lists.

Example: tetrahedron

(1) explicit data structure

� � �

0 1.0, 1.0, 1.0 -1.0, 1.0, -1.0 -1.0, -1.0, 1.0

1 1.0, 1.0, 1.0 -1.0, -1.0, 1.0 1.0, -1.0, -1.0

2 1.0, 1.0, 1.0 1.0, -1.0, -1.0 -1.0, 1.0, -1.0

3 1.0, -1.0, -1.0 -1.0, -1.0, 1.0 -1.0, 1.0, -1.0

(2) shared vertex structure

� �

0 1.0 1.0 1.0

1 -1.0 1.0 -1.0

2 -1.0 -1.0 1.0

3 1.0 -1.0 -1.0

� � �

0 0 1 2

1 0 2 3

2 0 3 1

3 3 2 1

Page 123: Geometric Modelling

111 10.3 Parametrization of triangle meshes

(3) extended shared vertex structure

� � %

0 1.0 1.0 1.0 0

1 -1.0 1.0 -1.0 0

2 -1.0 -1.0 1.0 0

3 1.0 -1.0 -1.0 1

� � � �� �� ��

0 0 1 2 3 1 2

1 0 2 3 3 2 0

2 0 3 1 3 0 1

3 3 2 1 0 2 1

10.3 Parametrization of triangle meshes

Given: data points� � ��

Find: parameter values�� � �� for which the angles and splitting ratios of the triangle mesh arepreserved.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 fixed along the edges at the neighbour points. Thesprings are idealised and have the minimum size 0. The mesh is getting flat and the springs areas minimal tensed as possible.Parameterization of data points by spring modells requires the minimization of a quadratic func-tional. That corresponds to solving a linear system of equations.The spring equation is:

� ��

����/

B����� � ����

Minimization:

(�

(���

����/

B�(

(������ � ����

(

(������ � ���� �

������ � �� � � � �� � ��������� � �� � � � � � � ����� � sonst

(�

(���

���$�

B���� � �� �� �

Page 124: Geometric Modelling

10 Triangle meshes 112

� ���

��$�

B� ��

��$�

B�� � �

� ���

��$�

B� ��

��������� �����

B�� ��

�������������

B��

� @ � � � �

with

@� �

���

���$�B�� � � �

�B� � � ����� � sonst

" � �

����

...

��...

���� " �� �

��������������

B��

Remark:& 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 followingpossibilities.

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 borderpolygon is not convex necessariliy.

10.3.3 Parametrization of the inner vertices

Given: vertices� � ��

Find: parameter values�� � �� , which fulfill the following:

(1) identity property: parameterization is identical with the triangle mesh, that has beenpressed into the plane.

(2) regularity resp. no convolutions

Page 125: Geometric Modelling

113 10.3 Parametrization of triangle meshes

Choice of theB�:

a)

B� ��

��� � ��� are called

��� � � uniformparametrization

� � �#� zentripetalparametrization

� � � chordalparametrization

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

b) discret harmonicparameterization

B� ��

���%� �% ��

Disadvantage: parameterized triangle mesh might be convoluted.The parameterization fulfills (1), but not (2).

c) shape preservingparameterization: fulfills (1) and (2)

i) Flattening of the 1-neighbourhood of a inner point v by exponential map (see Fig-ure 10.3.3 (a) and (b)):

� �

��

�and &� � ��4� � ��

��� "�

� �"�

with "� � !������

0 � ! ��:����� 0�

and 0� � ��4�� � 4����

ii) determineB� by averaging the barycentric coordinates (see Section 9.1)For each&� we find one, so that� � �&�� &� &���,i. e. � � - �� &� -

�& -

���&�� with - �� -

� -

��� � �

all other- �� � � � � �� �� � �(see Figure 10.3.3 (c))Finally: B$�� �

��

���� -

DiesesB$�� ist dasB�� zwischen den Punkten� � und� � 4�.Es ist klar, dass

i)

� ������

B$�� � &� � denn f"ur alle� gilt � ���

��

- �&

Page 126: Geometric Modelling

10 Triangle meshes 114

ii)

�����

B$�� ��

�����

����

- � ��

����

�����

- �� �� ���

� �

� � ist damit Konvexkombination der&�Remark:Diese'� sind i. d. R.nicht symmetrisch, d. h.'� �� '�.

��

��

��

��

��

��

��

����

����

����

����

(c)(a) (b)

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

Page 127: Geometric Modelling

115

11 Subdivision Surfaces

Motivation: Comparison TP-Surfaces - Triangle Meshes

TP-Surfaces Triangle Meshes

memory requirements + -

smooth surface + -

display on screen - +

free forms - +

complex forms - +

Subdivision surfaces are a compromise between TP-surfaces and triangle meshes. In the fol-lowing, 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 ofthe 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.

Page 128: Geometric Modelling

11 Subdivision Surfaces 116

Remark:

– The more subdivision steps, the smaller the triangles (and the smoother the surface).

– In the limit (after� subdivision steps): smooth surface

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:

– efficient calculation of even and odd vertices

– simplicity and locality of this rules

– affine invariance� convex combinations

– continuity of the limit surface

Page 129: Geometric Modelling

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. Evenand odd vertices in regular triangle meshes are calculated with the following masks:

at the boarder:

even vertices:

at the boarder:

���

���

���

��� �even

����

���

���

�even

��

odd vertices:

���odd

��

��

��

�odd

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 � � valence of�0$0�

and� � ��

���� �

�� �

��� �#

���

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 irreg-ular vertices it is��-continuous. You can see a triangle mesh and three Loop-Subdivision stepsin the Figures 11.4 und 11.5.

Page 130: Geometric Modelling

11 Subdivision Surfaces 118

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

Page 131: Geometric Modelling

119 11.1 Approximative schemes: Loop-Subdivision

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

Page 132: Geometric Modelling

11 Subdivision Surfaces 120

11.2 Interpolatory schemes: Modified Butterfly-Subdivision

Butterfly-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 areinterpolated.Inner points:

(1) regular neighbour vertices

��

� ���

��

� ���

� ���

��

� ���

��

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

(2) one irregular neighbour vertice

k = 3: �� � ���� ���� � � �

��

k = 4: �� � ��� �� � ��

�� ���� � �k � 5: �� � �

��� �� ��#

� �

��� ��:�

��

��

����

��������

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 theresults

Remark:Case 3 is only possible in the first subdivision step.

Page 133: Geometric Modelling

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 Butterfly-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 subdivisionmatrix the position of the vertices on the limit surface and propositions about the continuity ofthe 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 vectorsare applied. These formulas for the calculation of the shifted vertices���

�� � ���� � ���

� can bedisplayed 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 todiagonalize the subdivision matrix S:

> � 5 �B �5��

Page 134: Geometric Modelling

11 Subdivision Surfaces 122

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

Page 135: Geometric Modelling

123 11.3 Limit points for approximative subdivision

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

Page 136: Geometric Modelling

11 Subdivision Surfaces 124

R: matrix consisting of eigenvectorsD: eigenvalues of the diagonal matrix

5 �

���� �� ��� � �

� � ��

��� B �

���� � �

� ��

� � ��

��� 5�� �

��� � � �

�� � �

�� � ��

���

� >� � > � � � � � > � �5B5��� � �5� �� �B5��� � � � � � �5B5��� � 5B�5��

>� � 5B�5�� � 5 � � # ����

B�� �5�� �

� 5

���# ���� ��

# �������

��# ����

���

�����5�� �

� 5

����

���5�� � �

���� � �

� � �

� � �

���

� �� ��

����

���

���

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:

> ��

��

�������������

�� � � � � � �

� � � � � � �

� � � � � � �

� � � � � � �

� � � � � � �

� � � � � � �

� � � � � � �

�������������

Page 137: Geometric Modelling

125 11.3 Limit points for approximative subdivision

In the same way as for curves we diagonalize the subdivision matrix. The eigenvalues of thematrix 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 forEigenvalues�(�� � �(�� � � � � � �(�� of the subdivision matrix

– (� � � ��-continuous

– (� � (� ��� ��-continuous

– (� � (� � (� � �� ��-continuous

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