You are on page 1of 287

Geometric Modeling

(WS 2016/17)

Martin Held

FB Computerwissenschaften
Universitt Salzburg
A-5020 Salzburg, Austria
held@cosy.sbg.ac.at

January 27, 2017

UNIVERSITAT SALZBURG
Computational Geometry and Applications Lab
Personalia
Instructor (VO+PS): M. Held.
Email: held@cosy.sbg.ac.at.
Base-URL: http://www.cosy.sbg.ac.at/held.
Office: Universitt Salzburg, Computerwissenschaften, Rm. 1.20,
Jakob-Haringer Str. 2, 5020 Salzburg-Itzling.
Phone number (office): (0662) 8044-6304.
Phone number (secr.): (0662) 8044-6328.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 2
Formalia
URL of course (VO+PS): Base-URL/teaching/geom_mod/geom_mod.html.

Lecture times (VO): Friday 1210 1345 .


Venue (VO): T01, Computerwissenschaften, Jakob-Haringer Str. 2.
Lecture times (PS): Friday 1110 1200 .
Venue (PS): T01, Computerwissenschaften, Jakob-Haringer Str. 2.

Note PS is graded according to continuous-assessment mode!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 3
Electronic Slides and Online Material
In addition to these slides, you are encouraged to consult the WWW home-page of
this lecture:
http://www.cosy.sbg.ac.at/held/teaching/geom_mod/geom_mod.html.
In particular, this WWW page contains links to online manuals, slides, and code.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 4
A Few Words of Warning
I hope that these slides will serve as a practice-minded introduction to various aspects
of geometric modeling. I would like to warn you explicitly not to regard these slides as
the sole source of information on the topics of my course. It may and will happen that
Ill use the lecture for talking about subtle details that need not be covered in these
slides! In particular, the slides wont contain all sample calculations, proofs of
theorems, demonstrations of algorithms, or solutions to problems posed during my
lecture. That is, by making these slides available to you I do not intend to encourage
you to attend the lecture on an irregular basis.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 5
Acknowledgments
These slides are a revised and extended version of slides originally prepared by
Dominik Kaaser, Kamran Safdar, and Marko ulejic.
This revision and extension was carried out by myself, and I am responsible for all
errors.

Salzburg, July 2016 Martin Held

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 6
Legal Fine Print and Disclaimer
To the best of our knowledge, these slides do not violate or infringe upon somebody
elses copyrights. If copyrighted material appears in these slides then it was
considered to be available in a non-profit manner and as an educational tool for
teaching at an academic institution, within the limits of the fair use policy. For
copyrighted material we strive to give references to the copyright holders (if known).
Of course, any trademarks mentioned in these slides are properties of their respective
owners.
Please note that these slides are copyrighted. The copyright holder(s) grant you the
right to download and print it for your personal use. Any other use, including non-profit
instructional use and re-distribution in electronic or printed form of significant portions
of it, beyond the limits of fair use, requires the explicit permission of the copyright
holder(s). All rights reserved.
These slides are made available without warrant of any kind, either express or
implied, including but not limited to the implied warranties of merchantability and
fitness for a particular purpose. In no event shall the copyright holder(s) and/or their
respective employers be liable for any special, indirect or consequential damages or
any damages whatsoever resulting from loss of use, data or profits, arising out of or in
connection with the use of information provided in these slides.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 7
Recommended Textbooks I

N.M. Patrikalakis, T. Maekawa, W. Cho.


Shape Interrogation for Computer Aided Design and Manufacturing.
Springer, 2nd corr. edition, 2010; ISBN 978-3642040733.
http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/
H. Prautzsch, W. Boehm, M. Paluszny.
Bzier and B-spline Techniques.
Springer, 2002; ISBN 978-3540437611.
R.H. Bartels, J.C. Beatty, B.A. Barsky.
An Introduction to Splines for Use in Computer Graphics and Geometric
Modeling.
Morgan Kaufmann, 1995; ISBN 978-1558604001.
M. Botsch, L. Kobbelt, M. Pauly, P. Alliez, B. Levy.
Polygon Mesh Processing.
A K Peters/CRC Press, 2010; ISBN 978-1568814261.
http://www.pmp-book.org/
G.E. Farin, J. Hoschek.
Handbook of Computer Aided Geometric Design.
North-Holland, 2002; ISBN 978-0444511041.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 8
Recommended Textbooks II
M.E. Mortenson.
Mathematics for Computer Graphics Applications.
Industrial Press, 2nd rev. edition, 1999; ISBN 978-0831131111.
A. Dickenstein, I.Z. Emiris (eds.).
Solving Polynomial Equations: Foundations, Algorithms, and Applications.
Springer, 2005; ISBN 978-3-540-27357-8.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 9
Table of Content

Introduction

Mathematics for Geometric Modeling

Bzier Curves and Surfaces

B-Spline Curves and Surfaces

Approximation and Interpolation

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 10
Introduction
Motivation
Notation

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 11
Motivation: Evaluation of a Polynomial
I Assume that we have an intuitive understanding of polynomials and consider a
polynomial in x of degree n with coefficients a0 , a1 , . . . , an R, with an 6= 0:
n
X
p(x) := ai x i = a0 + a1 x + a2 x 2 + . . . + an1 x n1 + an x n .
i=0

I A straightforward polynomial evaluation of p for a given parameter x0 i.e., the


computation of p(x0 ) results in k multiplications for a monomial of degree k ,
plus a total of n additions.
I Hence, we would get
n(n + 1)
0 + 1 + 2 + ... + n =
2
multiplications (and n additions).
I Can we do better?
I Yes, we can: Horners Algorithm consumes only n multiplications and n additions
to evaluate a polynomial of degree n!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 13
Motivation: Smoothness of a Curve
I What is a characteristic difference between the three curves shown below?

I Answer: The green curve has tangential discontinuities at the vertices, the blue
curve consists of straight-line segments and circular arcs and is
tangent-continuous, while the red curve is a cubic B-spline and is
curvature-continuous.
I By the way, when precisely is a geometric object a curve?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 14
Motivation: Tangent to a Curve
I What is a parameterization of the tangent line at a point (t0 ) of a curve ?

(t0 )

I Answer: A parameterization of the tangent line ` that passes through (t0 ) is


given by

`() = (t0 ) + 0 (t0 ) with R.

I How can we obtain 0 (t) for : R Rd ?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 15
Motivation: Bzier Curve
I How can we model a smooth polynomial curve in R2 by specifying so-called
control points. (E.g., the points p0 , p1 , . . . , p10 in the figure.)
p9 p8

p2 p7
p3 p10
p6

p1 p5
p4
p0

I One (widely used) option is to generate a Bzier curve. (The figure shows a
Bzier curve of degree 10 with 11 control points.)
I What is the degree of a Bzier curve? Which geometric and mathematical
properties do Bzier curves exhibit?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 16
Motivation: B-Spline Curve
I How can we model a polynomial curve in R2 by specifying so-called control
points such that a modification of one control point affects only a small portion
of the curve?

I Answer: Use B-spline curves.


I Which geometric and mathematical properties do B-spline curves exhibit?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 17
Motivation: NURBS
I Is it possible to parameterize a circular arc by means of a polynomial or rational
term?
I Yes, this is possible:

1 t2
 
2t
,
1 + t2 1 + t2

I More generally, NURBS can be used to model all types of conics by means of
rational parameterizations.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 18
Motivation: Approximation of a Continuous Function
I How can we approximate a continuous function by a polynomial?
I Answer: We can use a Bernstein approximation.
I Sample Bernstein approximations of a continuous function:
1  
f : [0, 1] R f (x) := sin (x) + sin 6x + x 2
5

1.0 1.0

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0.2 0.4 0.6 0.8 1.0 0.2 0.4 0.6 0.8 1.0

I One can prove that the Bernstein approximation Bn,f converges uniformly to f on
the interval [0, 1] as n increases, for every continuous function f .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 19
Approximation of Polygonal Profiles
I How can we solve the following approximation problem?
I For a set of planar (polygonal) profiles,

I and an approximation threshold given,

I compute a smooth approximation such that the input topology is maintained.

I Approximations can be obtained by biarc or B-spline curves, based on tolerance


zones generated by means of Voronoi diagrams.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 20
Notation
I The set {1, 2, 3, . . .} of natural numbers is denoted by N, with N0 := N {0},
while Z denotes the integers (positive and negative) and R the reals. The
non-negative reals are denoted by R+ +
0 , and the positive reals by R .
I Open or closed intervals I R are denoted using square brackets: e.g.,
I1 = [a1 , b1 ] or I2 = [a2 , b2 [, with a1 , a2 , b1 , b2 R, where the right-hand [
indicates that the value b2 is not included in I2 .
I We use , , and letters in italics to denote scalar values: s, t, u.
I Points are also denoted by letters written in italics: p, q or, occasionally, P, Q. We
do not distinguish between a point and its position vector.
I The coordinates of a vector are denoted by using indices (or numbers): e.g.,
v = (vx , vy ), or v = (v1 , v2 , . . . , vn ).
I In order to state v Rn in vector form we will mix column and row vectors freely
unless a specific form is required, such as for matrix multiplication.
I The dot product of two vectors v and w is denoted by hv , wi.
I The vector cross-product (in R3 ) is denoted by a cross: v w.
I The length of a vector v is denoted by kv k.
I The straight-line segment between the points p and q is denoted by pq, or simply
by pq.
I Bold capital letters, such as M, are used for matrices.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 22
Mathematics for Geometric Modeling
Polynomials
Elementary Differential Calculus
Elementary Differential Geometry of Curves
Elementary Differential Geometry of Surfaces

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 23
Polynomials

Definition 1 (Monomial, Dt.: Monom)


A (real) monomial in m variables x1 , x2 , . . . , xm is a product of a coefficient c R
and powers of the variables xi with exponents ki N0 :
m
Y k k k
c xi i = c x1 1 x2 2 . . . xmkm .
i=1
Pm
The degree of the monomial is given by i=1 ki .

Definition 2 (Polynomial, Dt.: Polynom)


A (real) polynomial in m variables x1 , x2 , . . . , xm is a finite sum of monomials in
x1 , x2 , . . . , xm .
A polynomial is univariate if m = 1, bivariate if m = 2, and multivariate otherwise.

Definition 3 (Degree, Dt.: Grad)


The degree of a polynomial is the maximum degree of its monomials.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 25
Polynomials
I A (univariate) polynomial over R with variable x is a term of the form

an x n + an1 x n1 + + a1 x + a0 ,

with coefficients a0 , . . . , an R and an 6= 0.


I It is a convention to drop all monomials whose coefficients are zero.
I Univariate polynomials are usually written according to a decreasing order of
exponents of their monomials. In that case, the first term is the leading term that
indicates the degree of the polynomial; its coefficient is the leading coefficient.
Definition 4
Two polynomials are equal if and only if the sequences of their coefficients
(arranged in some specific order) are equal.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 26
Polynomial Arithmetic
I Instead of R any commutative ring (R, +, ) and symbols x, y , . . . that are not
contained in R would do.

a2,3 x 2 y 3 + a1,1 xy + a1,0 x + a0,0

with a2,3 , a1,1 , a1,0 , a0,0 R.


Lemma 5
The set of all polynomials with coefficients in the commutative ring (R, +, ) and a
symbol (variable) x 6 R forms a commutative ring, the ring of polynomials over R,
commonly denoted by R[x].

I Multivariate polynomials can also be seen as univariate polynomials with


coefficients out of a ring of polynomials. E.g.,

a2,3 x 2 y 3 + a1,1 xy + a1,0 x + a0,0 = (a2,3 x 2 )y 3 + (a1,1 x)y + (a1,0 x + a0,0 )

is an element of R[x, y ] := (R[x])[y ].

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 27
Polynomial Arithmetic
I We define the addition of polynomials based on the pairwise addition of
corresponding coefficients:
n
! n
! n
X i
X i
X
ai x + bi x := (ai + bi )x i
i=0 i=0 i=0

I The multiplication of polynomials is based on the multiplication within the


commutative ring R, distributivity, and the rules

ax = xa and x m x k = x m+k

for all a R and m, k N:


n
! m
n X
m
X i
X j
X
ai x bj x := (ai bj )x i+j
i=0 j=0 i=0 j=0

I Elementary properties of polynomials: One can prove easily that the addition,
multiplication and composition of two polynomials as well as their derivative and
antiderivative (indefinite integral) again yield a polynomial.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 28
Polynomials: Vector Space

Theorem 6
The univariate polynomials of R[x] form an infinite vector space over R. The
so-called power basis of this vector space is given by the monomials 1, x, x 2 , x 3 , . . ..

I Again, instead of R any commutative ring (R, +, ) and symbols x1 , x2 , . . . that are
not contained in R would do.
I The power basis is not the only meaningful basis of the polynomials R[x]: See,
e.g., the Bernstein basis polynomials that are used to form Bzier curves.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 29
Polynomials

Definition 7 (Polynomial function; Dt.: Polynomfunktion)


A (univariate real) function f : R R in one argument x is a polynomial function if
there exist n N0 and a0 , a1 , . . . , an R such that

f (x) = an x n + an1 x n1 + + a1 x + a0 for all x R.

I As usual, two (polynomial) functions are identical if their values are identical for
all arguments in R.
I Note: Two different polynomials may result in the same polynomial function!
(E.g., over finite fields.)
I While some fields of mathematics (e.g., abstract algebra) make a clear distinction
between polynomials and polynomial functions, we will freely mix these two
terms. Also, unless noted explicitly, we will only deal with polynomials over R.
I Note: Polynomial functions may come in disguise: f (x) := cos(2 arccos(x)) is a
polynomial function, since we have f (x) = 2x 2 1 for all 1 x 1.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 30
Polynomials

Definition 8 (Polynomial equation)


A polynomial equation (aka algebraic equation) is an equation in which a
polynomial is set equal to another polynomial.

Definition 9 (Root, Dt.: Wurzel)


The (real) polynomial p in x has a root (aka zero) r R if (x r ) divides p.

I Hence, if fp is the polynomial function associated with the polynomial p and if r is


a root of p, then fp (r ) = 0.
Definition 10 (Multiplicity, Dt.: Vielfachheit)
A root r of a polynomial p in x is of multiplicity k if k N is the maximum integer
such that (x r )k divides p.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 31
Polynomials
I Polynomials of degree
0. are called constant polynomials,
1. are called linear polynomials,
2. are called quadratic polynomials,
3. are called cubic polynomials,
4. are called quartic polynomials,
5. are called quintic polynomials.
Theorem 11 (Abel-Ruffini (1823))
No algebraic closed-form solution for the roots of an arbitrary polynomial of degree
five or higher exists.

I A closed-form solution is any formula that can be evaluated in a finite number of


standard operations.
I Jacobi theta functions can be used for solving general quintic equations, and
highly unwieldly solutions based on hypergeometric functions are known for
polynomials of higher degree.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 32
Horners Algorithm for Evaluation of a Polynomial
I Consider a polynomial of degree n with coefficients a0 , a1 , . . . , an R, with
an 6= 0:
n
X
p(x) := ai x i = a0 + a1 x + a2 x 2 + . . . + an1 x n1 + an x n .
i=0

I A straightforward polynomial evaluation of p for a given parameter x0 results in k


multiplications for a monomial of degree k , plus a total of n additions.
I Hence, we would get
n(n + 1)
0 + 1 + 2 + ... + n =
2
multiplications (and n additions).
I Can we do better?
I Obviously, we can reduce the number of multiplications to O(n log n) by resorting
to exponentiation by squaring:
n1
(
n x (x 2 ) 2 if n is odd,
x = n
(x 2 ) 2 if n is even.
I Can we do even better?
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 33
Horners Algorithm for Evaluation of a Polynomial
I Horners Algorithm: The idea is to rewrite the polynomial such that
 
p(x) = a0 + x a1 + x a2 + . . . + x(an1 + x an ) . . .

and compute the result h0 = p(x0 ) as follows:

hn := an
hi := x hi+1 + ai for i = 0, 1, 2, ..., n 1

1 /** Evaluates a polynomial of degree n at point x


2 * @param p: array of n+1 coefficients
3 * @param n: the degree of the polynomial
4 * @param x: the point of evaluation
5 * @return the evaluation result
6 */
7 double evaluate(double *p, int n, double x)
8 {
9 double h = p[n];

11 for (int i = n - 1; i >= 0; --i)


12 h = x * h + p[i];

14 return h;
15 }

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 34
Horners Algorithm for Evaluation of a Polynomial

Lemma 12
Horners Algorithm consumes n multiplications and n additions to evaluate a
polynomial of degree n.

Caveat
Subtractive cancellation could occur at any time, and there is no easy way to
determine a priori whether and for which data it will indeed occur.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 35
Forward Differencing
I If a polynomial has to be evaluated at k + 1 evenly spaced points x0 , x1 , . . . , xk ,
with xi+1 = xi + for 0 i < k , then forward differencing is faster than Horners
Algorithm.
I Consider a polynomial of degree one:

p(x) = a0 + a1 x
I The difference in the function values p(xi ) and p(xi+1 ) of two neighboring points
xi and xi+1 is

:= p(xi+1 ) p(xi ) = p(xi + ) p(xi ) = a0 + a1 (xi + ) (a0 + a1 xi ) = a1 .

I Hence, to evaluate the polynomial at several points, we start with the evaluation
of p(x0 ) and recursively compute

p(xi+1 ) = p(xi + ) = p(xi ) + , with := a1 .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 36
Forward Differencing
I For a quadratic polynomial p(x) = a0 + a1 x + a2 x 2 the difference of the function
values of neighboring points is

1 (xi ) := p(xi+1 ) p(xi ) = p(xi + ) p(xi )


= a0 + a1 (xi + ) + a2 (xi + )2 (a0 + a1 xi + a2 xi2 )
= a1 + a2 2 + 2a2 xi

I As 1 (x) is itself a linear polynomial, it can also be evaluated using forward


differencing:

2 (x) = 1 (x + ) 1 (x) = 2a2 2

I This approach can be extended to polynomials of any degree.


I One can conclude that for a polynomial of degree n each successive evaluation
requires n additions.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 37
Differentiation of Functions of One Variable

Definition 13 (Derivative, Dt.: Ableitung)


Let S R be an open set. A (scalar-valued) function f : S R is differentiable at
an interior point x0 S if
f (x0 + h) f (x0 )
lim
h0 h
exists, in which case the limit is called the derivative of f at x0 , denoted by f 0 (x0 ).

Definition 14
Let S R be an open set. A (scalar-valued) function f : S R is differentiable on
S if it is differentiable at every point of S.
If f is differentiable on S and f 0 is continuous on S then f is continuously
differentiable on S. In this case f is said to be of differentiability class C 1 .

I By taking one-sided limits one can also consider one-sided derivatives on the
boundary of closed sets S.
I By applying differentiation to f 0 , a second derivative f 00 of f can be defined.
Inductively, we obtain f (n) by differentiating f (n1) .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 39
Differentiation of Functions of One Variable

Definition 15 (C k , Dt.: k -mal stetig differenzierbar )


Let S R be an open set. A function f : S R that has k successive derivatives is
called k times differentiable. If, in addition, the k -th derivative is continuous, then
the function is said to be of differentiability class C k .

Definition 16 (Smooth, Dt.: glatt)


Let S R be an open set. A function f : S R is called smooth if it has infinitely
many derivatives, denoted by the class C .

I We have C C i C j , for all i, j N0 if i > j.


I Notation:
I f (0) (x) := f (x) for convenience purposes.

I f 0 (x) = f (1) (x) = d f (x) = df (x).


dx dx
d2 d2f
I f 00 (x) = f (2) (x) =
dx 2
f (x) = dx 2 (x).
3 3
I f 000 (x) = f (3) (x) = d f (x) = d f (x).
dx 3 dx 3
n n
I f (n) (x) = d f (x) = d f (x).
dx n dx n

I If the k -th derivative of f exists then the continuity of f (0) , f (1) , . . . , f (k 1) is implied.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 40
Differentiation of Functions of One Variable

Theorem 17 (Chain Rule, Dt.: Kettenregel)


Suppose that f : S R is differentiable at x0 and g : f (S) R is differentiable at
f (x0 ). Then the composite function h := g f , defined as h(x) := g(f (x)), is
differentiable at x0 , and we have

h0 (x0 ) = g 0 (f (x0 )) f 0 (x0 ).

Theorem 18 (Rolles Theorem)


If f : [a, b] R is continuous on the closed interval [a, b] and differentiable on the
open interval ]a, b[, and if f (a) = f (b) then there exists c ]a, b[ such that f 0 (c) = 0.

Theorem 19 (Mean Value Theorem)


If f : [a, b] R is continuous on the closed interval [a, b] and differentiable on the
open interval ]a, b[, then there exists c ]a, b[ such that
f (b) f (a)
f 0 (c) = .
ba

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 41
Differentiation of Functions of One Variable

Definition 20
For n N consider n functions fi : S R (with 1 i n) and define f : S Rn as

f1 (x)
f2 (x)
f (x) := . .

..
fn (x)

Then the (vector-valued) function f is differentiable at an interior point x0 S if and


only if fi is differentiable at x0 , for all i {1, 2, . . . , n}. The derivative of f at x0 is
given by
0
f1 (x0 )
0
f2 (x0 )
f 0 (x0 ) := .. .

.
fn0 (x0 )

I All other definitions related to differentiability carry over from scalar-valued


functions to vector-valued functions of one variable in a natural way.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 42
Differentiation of Functions of Several Variables

Definition 21 (Partial derivative, Dt.: partielle Ableitung)


Let S Rm be an open set. The partial derivative of a (vector-valued) function
f : S Rn at point (a1 , a2 , . . . , am ) S with respect to the i-th coordinate xi is
defined as
f f (a1 , a2 , . . . , ai + h, . . . , am ) f (a1 , a2 , . . . , ai , . . . , am )
(a1 , a2 , . . . , am ) := lim ,
xi h0 h
if this limit exists.

I Hence, for a partial derivative with respect to xi we simply differentiate f with


respect to xi according to the rules for ordinary differentiation, while regarding all
other variables as constants.
I That is, for the purpose of the partial derivative with respect to xi we regard f as
univariate function in xi and apply standard differentiation rules.
f
I Some authors prefer to write fx instead of x .
I We will mix notations as we find it convenient.

Note
A function of m variables may have all first-order partial derivatives at a point
(a1 , . . . , am ) but still need not be continuous at (a1 , . . . , am ).
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 43
Differentiation of Functions of Several Variables
I Higher-order partial derivatives of f are obtained by repeated computation of a
partial derivative of a (higher-order) partial derivative of f .
I Does it matter in which sequence we compute higher-order partial derivatives?
Theorem 22
f 2f 2f
Suppose that , f
x y
, y x
exist on a neighborhood of (x0 , y0 ), and that y x
is
2f
continuous at (x0 , y0 ). Then xy
(x0 , y0 ) exists, and we have

2f 2f
(x0 , y0 ) = (x0 , y0 ).
xy y x

I Note the difference between the Leibniz notation and the subscript notation for
higher-order mixed partial derivatives!
2f f
(x, y ) := ( )(x, y ) but fxy (x, y ) := (fx )y (x, y )
xy x y
I Also, note that Theorem 22 does not imply that it could not be simpler to
2
f 2f
compute, say, y x rather than xy :
q p
f (x, y ) := xe2y + ey sin(y tan(log y )) + 1 + y 2 cos2 y
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 44
Differentiation of Functions of Several Variables

Definition 23 (Differentiable, Dt.: total differenzierbar )


A function f : S Rn of m variables is differentiable at a point
a := (a1 , . . . , am ) S if there exists an n m matrix J such that

f (x) f (a) J(x a)


lim = 0.
xa kx ak

Theorem 24
If a function f : S Rn of m variables is differentiable at a point a S then the
coefficients aij of the matrix J of Def. 23 are given by

fi
aij = (a) for i {1, 2, . . . , n} and j {1, 2, . . . , m}.
xj

The matrix J is called Jacobi matrix of f at a.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 45
Differentiation of Functions of Several Variables

Theorem 25
If a function f : S Rn of m variables is differentiable at a point a S then it is
continuous at a.

Theorem 26
f
If x , f , . . . , x
f
exist for a function f : S Rn of m variables on a neighborhood
1 x2 m
of a point a S and are continuous at a then f is differentiable at a.

Definition 27 (Continuously differentiable, Dt.: stetig differenzierbar )


We say that a function f : S Rn of m variables is continuously differentiable on an
open subset S of Rm if xf f
, x f
, . . . , xm
exist and are continuous on S.
1 2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 46
Curves
I Intuitively, a curve in R2 is generated by a continuous motion of a pencil on a
sheet of paper.
I A formal mathematical definition is not entirely straightforward, and the term
curve is associated with two closely related notions: kinematic and geometric.
I In the kinematic setting, a (parameterized) curve is a function of one real variable.
I In the geometric setting, a curve, also called an arc, is a 1-dimensional subset of
space.
I Both notions are related:
I The image of a parameterized curve describes an arc.

I Conversely, an arc admits a parameterization.

I Since the kinematic setting is easier to introduce, we resort to a kinematic


definition of curve.
I Note that fairly counter-intuitive curves exist: e.g., space-filling curves like the
Sierpinski curve.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 48
Caveat: Sierpinski Curves
I Sierpinski curves are a sequence of recursively defined continuous and closed
curves in R2 .
I Sierpinski curve of orders 13 :

I Their limit curve, the Sierpinski curve, is a space-filling curve: It fills the unit
square completely!
I The Euclidean length Ln of the n-th Sierpinski curve is
2 1 1
Ln = (1 + 2)2n (2 2) n .
3 3 2
Hence, it grows exponentially and unboundedly as n grows.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 49
Curves in Rn

Definition 28 (Curve, Dt.: Kurve)


Let I R be an interval of the real line. A continuous (vector-valued) mapping
: I Rn is called a parameterization of (I), and (I) is called the (parametric)
curve parameterized by .

I Well-known examples of parameterized curves include a straight-line segment, a


circular arc, and a helix.
I E.g., : [0, 1] R3 with

px + t (qx px )
(t) := py + t (qy py )
pz + t (qz pz )

maps [0, 1] to a straight-line segment from point p to q.


I Sometimes the interval I is called the domain of , and (I) is called image.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 50
Curves in Rn

Definition 29 (Start and end point)


If I is a closed interval [a, b], for some a, b R, then we call (a) the start point and
(b) the end point of the curve : I Rn .

Definition 30 (Closed, Dt.: geschlossen)


A parameterization : I Rn is said to be closed (or a loop) if I is a closed interval
[a, b], for some a, b R, and (a) = (b).

Definition 31 (Simple, Dt.: einfach)


A parameterization : I Rn is said to be simple if (t1 ) = (t2 ) for t1 6= t2 I
implies {t1 , t2 } = {a, b} and I = [a, b], for some a, b R.

I Hence, if : I Rn is simple then it is injective on int(I).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 51
Curves in Rn
I Frequently properties of curves can also be stated independently of a specific
parameterization. E.g., we can regard a curve C to be simple if there exists one
parameterization of C that is simple.
I Similarly, we will frequently speak about a closed curve rather than about a
closed parameterization of a curve.
I Hence, the distinction between a curve and (one of) its parameterizations is often
blurred.
I For the sake of simplicity, we will not distinguish between a curve C and one of its
parameterizations if the meaning is clear.
I Similarly, we will frequently call a curve.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 52
Differentiable Curves

Definition 32 (C r -parameterization)
If : I Rn is r times continuously differentiable then is called a parametric curve
of class C r , or a C r -parameterization of (I), or simply a C r -curve.
If I = [a, b], then is called a closed C r -parameterization if (k ) (a) = (k ) (b) for all
0 k r.

I One-sided differentiability is meant at the endpoints of I if I is a closed interval.


Definition 33 (Regular, Dt.: regulr )
A C r -curve : I Rn is called regular of order k if for all t I the vectors
{ 0 (t), 00 (t), . . . , (k ) (t)} are linearly independent, for some 0 < k r .
In particular, is called regular if 0 (t) 6= 0 for all t I.

Definition 34 (Singular, Dt.: singulr )


For a C 1 -curve : I Rn and t0 I, the point (t0 ) is called a singular point of if
0 (t0 ) = 0.

I Note: Regularity and singularity depend on the parameterization!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 53
Differentiable Curves

Definition 35 (Smooth curve, Dt.: glatte Kurve)


If : I Rn has derivatives of all orders then is (the parameterization of) a
smooth curve (or of class C ).

Definition 36 (Piecewise smooth curve, Dt.: stckweise glatte Kurve)


If I is the union of a finite number of sub-intervals over each of which : I Rn is
smooth then is piecewise smooth.

I Note: Smoothness depends on the parameterization!


I There do exist curves which are continuous everywhere but differentiable
nowhere.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 54
Equivalence of Parameterizations in Rn
I Note that parameterizations of a curve (regarded as a set C Rn ) need not be
unique: Two different parameterizations : I Rn and : J Rn may exist
such that C = (I) = (J).
   
cos 2 t cos 2 t
(t) := (t) :=
sin 2 t sin 2 t

y y

x x

Figure : (t) for t [0, 0.9] Figure : (t) for t [0, 0.9]

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 55
Equivalence of Parameterizations in Rn

Definition 37 (Reparameterization, Dt.: Umparameterisierung)


Let : I Rn and : J Rn both be C r -curves, for some r N0 . We consider
and as equivalent if a function : I J exists, such that

((t)) = (t) t I,

and
1. is continuous, strictly monotonously increasing and bijective,
2. both and 1 are r times continuously differentiable.
In this case the parametric curve is called a reparameterization of .

(I) = (J) Caveat


There is no universally accepted definition
of a reparameterization! Some authors
drop the monotonicity or the
differentiability of , while others even
t
J require to be smooth.
I

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 56
Equivalence of Parameterizations in Rn

Theorem 38
Let : J Rn be a reparameterization of : I Rn . If is regular then is
regular.

Proof : Let be regular. Hence, is at least a C 1 -curve such that 0 (t) 6= 0 for all
t I. Let : I J be the mapping from I to J that establishes the equivalence of
and . Hence, and 1 are continuous, strictly monotonously increasing, bijective
and at least once continuously differentiable.
Since (1 (u)) = u for all u J, the Chain Rule 17 implies
d 1 d 1
0 (1 (u)) (u) = 1, i.e., (u) 6= 0 for all u J.
du du
Since (u) = (1 (u)), we know that (u) is continuously differentiable, and once
again by applying the Chain Rule 17 we get
d 1
0 (u) = 0 (1 (u)) (u) 6= 0 for all u J.
| {z } |du {z }
6=0
6=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 57
Arc Length

Definition 39 (Decomposition, Dt.: Unterteilung)


Consider : I Rn , with I := [a, b]. A decomposition, P, of the closed interval I is
a sequence of m + 1 numbers t0 , t1 , t2 , . . . , tm , for some m N, such that

a = t0 < t1 < t2 < < tm = b.

The length LP () of the polygonal chain ((t0 ), (t1 ), (t2 ), . . . , (tm )) that
corresponds to the decomposition t0 , t1 , t2 , . . . , tm is given by
m1
X
LP () := k(tj+1 ) (tj )k
j=0

= k(t1 ) (t0 )k + k(t2 ) (t1 )k + + k(tm ) (tm1 )k.

We denote the set of all decompositions of [a, b] by P[a, b].

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 58
Arc Length

Definition 40 (Arc length, Dt.: Bogenlnge)


Consider : I Rn , with I := [a, b]. The arc length of (I) is given by

sup {LP () : P P[a, b]} ,

i.e., by the supremum (over all decompositions t0 , t1 , t2 , . . . , tm of I) of the length of


the polygonal chain defined by (t0 ), (t1 ), (t2 ), . . . , (tm ).

Definition 41 (Rectifiable, Dt.: rektifizierbar )


If the arc length of : I Rn is a finite number then (I) is called rectifiable.

Lemma 42
The arc length of a curve does not change for equivalent parameterizations.

Sketch of Proof : Suppose that (t) = ((t)) for all t I, for : J Rn . Every
decomposition t0 , t1 , t2 , . . . , tm of I maps to a decomposition (t0 ),(t1 ),(t2 ), . . . , (tm )
of J such that (ti ) = ((ti )) for all 1 i m. Hence, there is a bijection from the
set of decompositions of I to the set of decompositions of J, and it does not matter
which set is used for determining the supremum of all possible chain lengths.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 59
Arc Length: Non-Rectifiable Curve
I Curves exist that are non-rectifiable, i.e., for which there is no upper bound on the
length of their polygonal approximations.
I Example of a non-rectifiable curve: The graph of the function defined by f (0) := 0
and f (x) := x sin x1 for 0 < x a, for some a R+ . It defines a curve

t

(t) := f (t) .
1.0

0.5

0.5 1.0 1.5 2.0

- 0.5

- 1.0

1

The graph of f (x) := x sin x
for x [0, 2]

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 60
Arc Length: Non-Rectifiable Curve
I Curves exist that are non-rectifiable, i.e., for which there is no upper bound on the
length of their polygonal approximations.
I Example of a non-rectifiable curve: The graph of the function defined by f (0) := 0
and f (x) := x sin x1 for 0 < x a, for some a R+ . It defines a curve

t

(t) := f (t) .

0.2

0.1

0.1 0.2 0.3 0.4 0.5

- 0.1

- 0.2

1
for x [0, 12 ]

The graph of f (x) := x sin x

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 60
Arc Length: Non-Rectifiable Curve
I Curves exist that are non-rectifiable, i.e., for which there is no upper bound on the
length of their polygonal approximations.
I Example of a non-rectifiable curve: The graph of the function defined by f (0) := 0
and f (x) := x sin x1 for 0 < x a, for some a R+ . It defines a curve

t

(t) := f (t) .

0.006

0.004

0.002

0.005 0.010 0.015

- 0.002

- 0.004

- 0.006

1 1

The graph of f (x) := x sin x
for x [0, 32
]

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 60
Arc Length: Non-Rectifiable Curve
I Example of a non-rectifiable closed curve: The Koch snowflake [Koch 1904].

Koch snowflake, iteration 2

I The length of the curve after the n-th iteration is (4/3)n of the original triangle
perimeter. (Its fractal dimension is log 4/log 3 1.261.)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 61
Arc Length

Lemma 43
If : I Rn is a C 1 -curve then (I) is rectifiable.

Proof : Let t0 , t1 , t2 , . . . , tm be a decomposition P of I := [a, b]. Since k0 (t) exists and


is continuous on all of [a, b], we know that there exists Mk which serves as an upper
bound for |k0 | on [a, b], for all 1 k n. Hence,
m1
X m1
XX n
LP () = k(tj+1 ) (tj )k |k (tj+1 ) k (tj )|
j=0 j=0 k =1
m1 n
(?) XX
= |k0 (xkj )|(tj+1 tj ) for suitable xkj
j=0 k =1
m1
XX n n
X m1
X
Mk (tj+1 tj ) = Mk (tj+1 tj )
j=0 k =1 k =1 j=0
n
X
= (b a) Mk .
k =1

where equality at (?) holds due to Mean Value Theorem 19.


c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 62
Arc Length: Speed

Definition 44 (Speed, Dt.: Geschwindigkeit)


If : I Rn is a C 1 -curve then the vector 0 (t) is the velocity vector at parameter t,
and k 0 (t)k gives the speed at parameter t, for all t I.

Definition 45 (Natural parameterization)


A C 1 -curve : I Rn is called natural (or at unit speed) if k 0 (t)k = 1 for all t I.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 63
Arc Length

Theorem 46
Let : I Rn be a C 1 curve, with I := [a, b]. Then the arc length of (I) is given by
Z b
0
(u) du.
a

Corollary 47
Let : I Rn be a C 1 curve, and [a, b] I. Then the arc length of ([a, b]) is
given by
Z b
0
(u) du.
a

Definition 48 (Arc length function, Dt.: Bogenlngenfunktion)


Let : [a, b] Rn be a C 1 -curve. We define the arc-length function s : [a, b] R
as follows:
Z t
0
s(t) := (u) du.
a
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 64
Arc Length: Unit Speed

Theorem 49
If : I Rn , with I := [a, b], is a regular curve then there exists a
reparameterization that has unit speed.

Definition 50 (Arc-length parameterization, Dt.: Bogenlngenparameterisierung)


Let : [a, b] Rn be a regular curve. Then : [0, s(b)] R, as defined in
Theorem 49, is the arc-length parameterization of ([a, b]).

Lemma 51
If : [0, c] Rn is an arc-length parameterization then it has constant (unit) speed
and the length of the arc of from (a) to (b) equals b a, for all 0 a < b c.

Proof : By Cor. 47, the length of the arc of from (a) to (b) is given by
Z b Z b
0
(t) dt = 1 dt = b a.
a a

In particular, the parameterization has constant (unit) speed.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 65
Tangent Vector

(t0 ) (t1 )

I If (t0 ) is a fixed point on the curve , and (t1 ), with t1 > t0 , is another point,
then the vector from (t0 ) to (t1 ) approaches the tangent vector to at (t0 ) as
the distance between t1 and t0 is decreased.
I The infinite line through (t0 ) that is parallel to this vector is known as the tangent
line to the curve at point (t0 ).
I If we disregard the orientation of the tangent vector then we would like to obtain
the same result for the tangent line by considering a point (t1 ) with t1 < t0 .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 66
Tangent Vector

Definition 52 (Tangent vector )


Let : I Rn be a C 1 -curve. If 0 (t) 6= 0 for t I then 0 (t) forms the tangent
vector at the point (t) of .

I The tangent vector indicates the forward direction of relative to increasing


parameter values.
I If is at unit speed then 0 (t) forms a unit vector.
I A parameterization of the tangent line ` that passes through (t) is given by

`() = (t) + 0 (t) with R.

I If (t) = (x(t), y (t)) is a curve in R2 then the vector (y 0 (t), x 0 (t)) is normal on
the tangent line at (t).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 67
Frenet Frame for Curves in R3

Definition 53 (Frenet frame, Dt.: begleitendes Dreibein)


Let : I R3 be a C 2 curve that is regular of order two. Then the Frenet frame
(aka moving trihedron) at (t) is defined as an orthonormal basis of vectors
T (t), N(t), B(t) as follows:
0 (t)
T (t) := k 0 (t)k
unit tangent;
0
T (t)
N(t) := kT 0 (t)k
unit (principal) normal;

B(t) := T (t) N(t) unit binormal.

Lemma 54
Let : I R3 be a C 2 curve that is regular of order two, and define T , N, B as in
Def. 53. We get for all t I:
I N(t) is normal to T (t), and
I B(t) is a unit vector.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 68
Osculating Plane for a Curve in R3
I Let (t0 ) be a fixed point on , and two other points (t1 ) and (t2 ) that move
along .
I Obviously, (t0 ), (t1 ) and (t2 ) define a plane.
I As both (t1 ) and (t2 ) approach (t0 ), the plane determined by them
approaches a limiting position.
I This limiting plane is known as the osculating plane to the curve at point (t0 ).
Definition 55 (Osculating plane, Dt.: Schmiegeebene)
Let : I R3 be a C 2 curve that is regular of order two. The osculating plane at the
point (t) is the plane spanned by T (t) and N(t), as defined in Def. 53.

I Of course, the osculating plane contains the tangent line to at (t0 ).


I The osculating plane at the point (t0 ) contains also 00 (t0 ).
I Thus, the binormal is the normal vector of the osculating plane.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 69
Parametric Continuity of a Curve
I Consider two curves : [a, b] Rn and : [c, d] Rn .
I Suppose that (b) = (c) =: p.
I We are interested in checking how smoothly and joint at the point p.

Definition 56 (C k -continuous, Dt.: C k stetig)


Let : [a, b] Rn and : [c, d] Rn be C k -curves. If

(i) (b) = (i) (c) for all i {0, . . . , k }

then and are C k -continuous at point p := (b).

I Of course, one-sided derivatives are to be considered in Def. 56.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 70
Parametric Continuity of a Curve
I C 0 -continuity implies that the end point of one curve is the start point of the
second curve, i.e., they share a common joint.
I C 1 -continuity implies that the speed does not change at p.
I C 2 -continuity implies that the acceleration does not change at p.
I Parametric continuity is important for animations: If an object moves along with
constant parametric speed, then there should be no sudden jump once it moves
along .
Definition 57 (Curvature continuous, Dt.: krmmungsstetig)
Let : [a, b] R3 and : [c, d] Rn be C 2 -curves, with (b) = (c) =: p. If the
curvatures of and are equal at p then and are said to be curvature
continuous at p.

Caveat
C 1 -continuity plus curvature continuity need not imply C 2 -continuity!
I Unfortunately, this important fact is missed frequently, and curvature continuity is
often (wrongly) taken as a synonym for C 2 -continuity . . .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 71
Problems with Parametric Continuity
I Note that parametric continuity depends on the particular parameterizations of
and .
I Consider three collinear points p, q, and r which define two straight-line
segments joined at their common endpoint q:
(t) := p + t(q p), t [0, 1]
(t) := q + (t 1)(r q), t [1, 2]

p q r

I Of course, and are C 0 -continuous at q.


I However, 0 (1) = q p while 0 (1) = r q. Thus, in general, and will not be
C 1 -continuous at q.
I C 1 -continuity at q could be achieved by resorting to arc-length parameterizations
for and :
t
(t) := p + (q p), t [0, kq pk]
kq pk
t kq pk
(t) := q + (r q), t [kq pk , kq pk + kr qk]
kr qk

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 72
Geometric Continuity
I G0 -continuity equals C 0 -continuity: The curves and share a common joint p.
Definition 58 (G 1 -continuous, Dt.: G 1 stetig)
Let : [a, b] Rn and : [c, d] Rn be C 1 -curves, with (b) = (c) =: p. If

0 6= 0 (b) = 0 (c) for some R+

then and are G1 -continuous at p.

I G1 -continuity means that and share the tangent line at p.


I Higher-order geometric continuities are a bit tricky to define formally for k 2.
I G2 -continuity means that and share the tangent line and also the same
center of curvature at p.
I In general, Gk -continuity exists at p if and can be reparameterized such that
they join with C k -continuity at p.
I C k -continuity implies Gk -continuity.
I Note: Reflections on a surface (e.g., a car body) will not appear smooth unless
G2 -continuity is achieved.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 73
Parametric Surface in R3

Definition 59 (Parametric surface)


Let R2 . A continuous mapping : R3 is called a parameterization of
(), and () is called the (parametric) surface parameterized by .

I For instance, every point on the surface of Earth can be described by the
geographic coordinates longitude and latitude.
I Note that parameterizations of a surface (regarded as a set S R3 ) need not be
unique: two different parameterizations and may exist such that
S = (1 ) = (2 ).
I For simplicity, we will not distinguish between a surface and one of its
parameterizations if the meaning is clear.

(u, v)
()

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 75
Sample Parametric Surface: Frustum of a Paraboloid

: [0, 1] [0, 2] R3

u cos v
(u, v ) := u sin v
2u 2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 76
Sample Parametric Surface: Torus

: [0, 2]2 R3

(2 + cos v ) cos u
(u, v ) := (2 + cos v ) sin u
sin v

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 77
Basic Definitions for Parametric Surfaces

Definition 60 (Regular parameterization, Dt.: regulre (od. zulssige) Param.)


Let R2 . A continuous mapping : R3 in the variables u and v is called a
regular parameterization of () if
1. is differentiable on ,

2. u
(u0 , v0 ) and v
(u0 , v0 ) are linearly independent for all (u0 , v0 ) in .


I Note that u
(u0 , v0 ) and v
(u0 , v0 ) are linearly independent if and only if


(u0 , v0 ) (u0 , v0 ) 6= 0.
u v
Definition 61 (Singular point, Dt.: singulrer Punkt)
Let R2 . A point (u0 , v0 ) is a singular point of a differentiable
parameterization : R3 if u
(u0 , v0 ) and
v
(u0 , v0 ) are linearly dependent.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 78
Curves on Surfaces
I Consider a planar parametric C 1 curve with coordinates (u(t), v (t)), for
t I R, in the parametric domain of a parametric surface : R3 .
Then : I R3 with (t) := u(t), v (t) is a parametric curve on the surface

I

().
I Suppose that is differentiable on . Differentiating (t) (by means of a
multi-dimensional analogue of the Chain Rule 17) with respect to t yields the
tangent vector of the curve on the surface:

0 (t) = (u(t), v (t)) u 0 (t) + (u(t), v (t)) v 0 (t)
u v

I Hence, the tangent vector at (t) is a linear combination of



(u(t), v (t)) and (u(t), v (t)).
u v

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 79
Curves on Surfaces
I Suppose that = [umin , umax ] [vmin , vmax ]
I If we fix v := v0 [vmin , vmax ] and let u vary, then (u, v0 ) depends on one
parameter; it is called an isoparametric curve or, more specifically, the
u-parameter curve.
I Likewise, we can fix u := u0 [umin , umax ] and let v vary to obtain the
v -parameter curve (u0 , v ).
I Tangent vectors for the u-parameter and v -parameter curves are computed by
partial derivatives of with respect to u and v , respectively:

(u, v ) for v = v0
u

(u, v ) for u = u0
v

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 80
Curves on Surfaces
I The parameterization of the unit sphere is given by

cos u cos v

(u, v ) := sin u cos v with (u, v ) [0, 2[[ , ].
2 2
sin v

I We get

sin u cos v0

(u, v0 ) = cos u cos v0
u
0

and

cos u0 sin v

(u0 , v ) = sin u0 sin v .
v
cos v


I Note that u
(u0 , v0 )
v
(u0 , v0 ).

I Also, for v0 := 2 . Hence, the north and south
note that u (u, v0 ) vanishes
poles are singular points of this parameterization.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 81
Tangent Plane and Normal Vector
I Recall that the tangent vector at a point (t) of a parametric curve on a surface
() is given by partial derivatives of . This motivates the following definition.
Definition 62 (Tangent plane, Dt.: Tangentialebene)
Consider a regular parameterization : R3 of a surface S. For (u, v ) , the
tangent plane (u, v ) of S at (u, v ) is the plane through (u, v ) that is spanned by
the vectors

(u, v ) and (u, v ).
u v

Definition 63 (Normal vector, Dt.: Normalvektor )


Consider a regular parameterization : R3 of a surface S. For (u, v ) , the
normal vector N(u, v ) of S at (u, v ) is given by

N(u, v ) := (u, v ) (u, v ).
u v

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 82
Bzier Curves and Surfaces
Bernstein Basis Polynomials
Bzier Curves
Bzier Surfaces

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 83
Bernstein Basis Polynomials

Definition 64 (Bernstein basis polynomials)


The n + 1 Bernstein basis polynomials of degree n, for n N0 , are defined as
!
n k
Bk ,n (x) := x (1 x)nk for k {0, 1, . . . , n}.
k

I For convenience purposes, we define Bk ,n (x) := 0 for k < 0 or k > n.


I We use the convention 00 := 1.
I B0,0 (x) = 1.
I B0,1 (x) = 1 x and B1,1 (x) = x.
I B0,2 (x) = (1 x)2 and B1,2 (x) = 2x(1 x) and B2,2 (x) = x 2 .

I Introduced by Sergei N. Bernstein in 1911 for a constructive proof of Weierstrass


Approximation Theorem 168.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 85
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 0 over the interval [0, 1]:

1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 86
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 1 over the interval [0, 1]:

1x x

1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 86
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 2 over the interval [0, 1]:

(1 x)2 2x(1 x) x2

1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 86
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 3 over the interval [0, 1]:

(1 x)3 3x(1 x)2 3x 2 (1 x) x3

1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 86
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 4 over the interval [0, 1]:

(1 x)4 4x(1 x)3 6x 2 (1 x)2 4x 3 (1 x) x4

1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 86
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 5 over the interval [0, 1]:

(1 x)5 5x(1 x)4 10x 2 (1 x)3 10x 3 (1 x)2 5x 4 (1 x) x5

1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 86
Recursion Formula for Bernstein Basis Polynomials

Lemma 65
For all n N and k N0 with k n, the Bernstein basis polynomial Bk ,n (x) of
degree n can be written as the sum of two basis polynomials of degree n 1:

Bk ,n (x) = x Bk 1,n1 (x) + (1 x) Bk ,n1 (x)

Proof : Let n N and k N0 with k n be arbitrary but fixed, and recall that
! ! ! !
def n k nk n n1 n1
Bk ,n (x) = x (1 x) and = + .
k k k 1 k

We get
! !
n1 k nk n1 k
Bk ,n (x) = x (1 x) + x (1 x)nk
k 1 k
! !
n 1 k 1 (n1)(k 1) n1 k
=x x (1 x) + (1 x) x (1 x)(n1)k
k 1 k
= x Bk 1,n1 (x) + (1 x) Bk ,n1 (x).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 87
Properties of Bernstein Basis Polynomials

Lemma 66
For all n N and k N0 with k n, the Bernstein basis polynomial Bk ,n1 can be
written as linear combination of Bernstein basis polynomials of degree n:
nk k +1
Bk ,n1 (x) = Bk ,n (x) + Bk +1,n (x).
n n

Lemma 67
For all n, k N0 with k n, the Bernstein basis polynomial Bk ,n is non-negative
over the unit interval:

Bk ,n (x) 0 for all x [0, 1].

Proof : Recall the definition of the Bernstein basis polynomials:


!
def n
Bk ,n (x) = (x) k (1 x)nk 0 for all x [0, 1].
k |{z} | {z }
0 0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 88
Properties of Bernstein Basis Polynomials

Lemma 68 (Partition of unity, Dt.: Zerlegung der Eins)


For all n N0 , the Bernstein basis polynomials of degree n form a partition of unity,
i.e., they sum up to one:
n
X
Bk ,n (x) = 1 for all x [0, 1].
k =0

Proof : Trivial for n = 0. Now recall the binomial theorem, for a, b R and n N:
n
!
n
X n k nk
(a + b) = a b
k
k =0

Then the claim is an immediate consequence by setting a := x and b := 1 x:


n
! n
X n k X
1 = (x + (1 x))n = x (1 x)nk = Bk ,n (x).
k
k =0 k =0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 89
Properties of Bernstein Basis Polynomials

Lemma 69
For all n N0 and any set of n + 1 points in R2 with position vectors
p0 , p1 , p2 , . . . , pn , the term

p0 B0,n (t) + p1 B1,n (t) + + pn Bn,n (t)

forms a convex combination of these points for all t [0, 1].

Proof : This is an immediate consequence of Lem. 67 and Lem. 68.


Corollary 70 (Convex hull property )
For all n N0 and any set of n + 1 points in R2 with position vectors
p0 , p1 , p2 , . . . , pn , the point

p0 B0,n (t) + p1 B1,n (t) + + pn Bn,n (t)

lies within CH({p0 , p1 , p2 , . . . , pn }) for all t [0, 1].

Proof : Recall that CH({p0 , p1 , p2 , . . . , pn }) equals the set of all convex combinations
of p0 , p1 , p2 , . . . , pn .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 90
Derivatives of Bernstein Basis Polynomials

Lemma 71
For n, k N0 and i N with i n, the i-th derivative of Bk ,n (x) can be written as a
linear combination of Bernstein basis polynomials of degree n i:
i
!
(i) n! X i
Bk ,n (x) = (1)ij Bk j,ni (x)
(n i)! j
j=0

Corollary 72
For n, k N0 , the first and second derivative of Bk ,n (x) are given as follows:

Bk0 ,n (x) = n Bk 1,n1 (x) Bk ,n1 (x)




Bk00,n (x) = n(n 1) Bk 2,n2 (x) 2Bk 1,n2 (x) + Bk ,n2 (x)


c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 91
Bernstein Basis Polynomials Form a Basis

Lemma 73
The n + 1 Bernstein basis polynomials B0,n , B1,n , . . . , Bn,n are linearly independent,
for all n N0 .

Proof : We do a proof by induction.


I.B.: The claim is obviously true for n = 0 and n = 1.
I.H.: Suppose that the claim is true for n 1 N0 , i.e., that n1
P
k =0 k Bk ,n1 (x) = 0
implies 0 = 1 = .P . . = n1 = 0.
I.S.: Suppose that nk=0 k Bk ,n (x) = 0 for some 0 , 1 , . . . , n R. Then we get
n n
Lem. 71
X X
0= k Bk0 ,n (x) = k n (Bk 1,n1 (x) Bk ,n1 (x))
k =0 k =0
n1 n1
!
X X
=n k +1 Bk ,n1 (x) k Bk ,n1 (x)
k =0 k =0
n1
X
=n k Bk ,n1 (x) with k := k +1 k for 0 k n 1.
k =0

The I.H. implies 0 = 1 = n1 = 0 and, thus, 0 = 1 = n , which implies


0 = 1 = n = 0. (Recall Partition of Unity, Lem. 68.)
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 92
Bernstein Basis Polynomials Form a Basis

Lemma 74
For all n, i N0 , with i n, we have
X n k

i i
x = n Bk ,n (x).

k =i i

Proof : Let n, i N0 be arbitrary but fixed, with i n. We have


ni
!
X ni k
x i = x i 1 = x i (x + (1 x))ni = x i x (1 x)nik
k
k =0
ni
! n
!
X ni X ni
= x k +i (1 x)n(k +i) = x k (1 x)nk
(k + i) i k i
k =0 k =i
ni ni
n
 ! n

X k i n k X k i
= n
 x (1 x)nk = n
 Bk ,n (x)
k
k k
k =i k =i
n k

Lem 75
X
i
= n Bk ,n (x).

k =i i

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 93
Bernstein Basis Polynomials Form a Basis

Lemma 75
For all n, k , i N0 , with i k n,
ni
 k

k i i
n
 = n .

k i

Proof : Let n, k , i N0 arbitrary but fixed with i k n. We have


ni
 (ni)! (ni)! k! k! k

k i (k i)!(nk )! (k i)! (k i)! (k i)!i! i
n
 = n!
= n!
= n!
= n!
= n .

k k !(nk )! k! (ni)! (ni)!i! i

Theorem 76
The Bernstein basis polynomials of degree n form a basis of the vector space of
polynomials of degree up to n over R, for all n N0 .

Proof : This is an immediate consequence of either Lem. 73 or Lem. 74.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 94
Basis Conversions
I Suppose that we are given a polynomial in Bernstein basis, i.e., a Bernstein
polynomial as a linear combination of Bernstein basis polynomials, and that we
want to find the equivalent in power basis, and vice versa.
I Bernstein basis: I Power basis:
n
X n
X
Bn (x) = k Bk ,n (x) Pn (x) = k x k
k =0 k =0
I Given either the values for k or k , we want to find the corresponding values in
the other basis.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 95
Basis Conversions Using Taylor Series Expansion
I Basis conversions between power and Bernstein basis can be done using
Taylor/Maclaurin series expansion:
(i)
Bn00 (0)x 2 B (0)x i
Bn (x) = Bn (0) + Bn0 (0)x + + ... + n + ...
2 i!

I A polynomial in Bernstein basis is equivalent to a polynomial in power basis if


and only if
(i)
Bn (0)x i
= i x i i = 0, 1, . . . , n
i!

I Thus,
(i)
Bn (0)
i = i = 0, 1, . . . , n.
i!
I One can set up a recurrence formula for computing i .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 96
Basis Conversions Using the Binomial Theorem
I The appropriate values of i can also be computed directly based on the
definition of the Bernstein polynomials and the Binomial Theorem:

! !
n k n k
Bk ,n (x) = x (1 x)nk = x (1)nk (x 1)nk
k k
! nk
!
n k X nk
= x (1) nk
x i (1)nk i
k i
i=0
! nk ! nk
! !
n k X nk X n nk
= x (1)i x i = (1)i x i+k
k i k i
i=0 i=0
n
! ! n
! !
X ik n nk i Lem 75
X ik n i
= (1) x = (1) xi
k i k i k
i=k i=k

I Hence, we get the following formula for the coefficient i of x i :


n
! ! !
ik n i i
X
i = k (1) with := 0 if i < k .
i k k
k =0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 97
Bzier Curves
I Discovered in the late 1950s by Paul de Casteljau at Citron and in the early
1960s by Pierre E. Bzier at Renault, and first published by Bzier in 1962.
(Citron allowed de Casteljau to publish his results in 1974 for the first time.)
I The idea is to specify a curve by using points which control its shape: control
points. The figure shows a Bzier curve of degree 10 with 11 control points.
p9 p8

p2 p7
p3 p10
p6

p1 p5
p4
p0

I Bzier curves formed the foundations of Citrons UNISURF CAD/CAM system.


I TrueType fonts use font descriptions made of composite quadratic Bzier curves;
PostScript, METAFONT, and SVG use composite Bziers made of cubic Bzier
curves.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 99
Bzier Curves

Definition 77 (Bzier curve)


Suppose that we are given n + 1 control points with position vectors p0 , p1 , . . . , pn
in the plane R2 , for n N. The Bzier curve B : [0, 1] R2 defined by p0 , p1 , . . . , pn
is given by
n
X
B(t) := Bi,n (t)pi for t [0, 1],
i=0

n
i
where Bi,n (t) = i
t (1 t)ni is the i-th Bernstein basis polynomial of degree n.

I The weighted average of all control points gives a location on the curve relative to
the parameter t. The weights are given by the coefficients Bi,n .
I The polygonal chain p0 , p1 , p3 , . . . , pn1 , pn is called the control polygon, and its
individual segments are referred to as legs.
I Although not explicitly required, it is generally assumed that the control points are
distinct, except for possibly p0 and pn being identical.
I Of course, the same definition and the subsequent math can be applied to
p0 , p1 , . . . , pn Rd for some d N with d > 2.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 100
Properties of Bzier Curves

Lemma 78
A Bzier curve defined by n + 1 control points is (coordinate-wise) a polynomial of
degree n.

Proof : It is the sum of n + 1 Bernstein basis polynomials of degree n.


Lemma 79 (Convex hull property )
A Bzier curve lies completely inside the convex hull of its control points.

Proof : This is nothing but a re-formulation of Cor. 70.


Lemma 80
A Bzier curve starts in the first control point and ends in the last control point.

Proof : Recall that


(
1 for i = 0,
Bi,n (0) =
0 for i > 0.

Hence, B(0) = B0,n (0)p0 = p0 . Similarly for Bi,n (1) and B(1).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 101
Properties of Bzier Curves

Lemma 81 (Variation diminishing property )


If a straight line intersects the control polygon of a Bzier curve k times then it
intersects the actual Bzier curve at most k times.

Lemma 82 (Affine invariance)


Any Bzier representation is affinely invariant, i.e., given any affine map , the
image curve (B) of a Bzier curve B : [0, 1] R2 with control points p0 , p1 , . . . , pn
has the control points (p0 ), (p1 ), . . . , (pn ) over [0, 1].

Sketch of Proof : Recall that all points of a Bzier curve are given by convex (i.e.,
affine) combinations of the control points.
Lemma 83 (Symmetry property )
The following identity holds:
n
X n
X
Bi,n (t)pi = Bi,n (1 t)pni .
i=0 i=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 102
Modifying a Control Point
I Suppose that we shift one control point pj to a new location pj + v .
p9 p8
p2 p3 p7
p10
p6
p1
p5
p4
p0 v
p4 + v
I The corresponding Bzier curve B is transformed to B? as follows:

j1
! n
?
X X
B (t) = Bi,n (t)pi + Bj,n (t)(pj + v ) + Bi,n (t)pi =
i=0 i=j+1
n
X
= Bi,n (t)pi + Bj,n (t)v = B(t) + Bj,n (t)v
i=0

I Now recall that Bj,n (t) 6= 0 for all t with 0 < t < 1. Hence, a modification of just
one control point results in a global change of the entire Bzier curve.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 103
Evaluation of a Bzier Curve
I For 0 < t < 1 we can locate a point q on a line segment pr such that it divides
the line segment into portions of relative length t and 1 t, i.e., according to the
ratio t : 1 t.
I Of course, q is given by

q = (1 t)p + tr .

I Similarly, we can compute a point on a Bzier curve such that the curve is split
into portions of relative length t and 1 t.
I On every leg p
j1 pj of the control polygon we compute a point p1j which
divides it according to the ratio t : 1 t.
I In total we get n new points which define a new polygonal chain with n 1

legs.
I This new polygonal chain can be used to construct another polygonal chain

with n 2 legs.
I This process can be repeated n times, i.e., until we are left with a single

point.
I It was proved by de Casteljau that this point corresponds to the point B(t)

sought.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 104
De Casteljaus Algorithm
I Sample run of de Casteljaus algorithm for t := 1/4.
I The points are indexed in the form i, j, where i denotes the number of the
iteration and j + 1 denotes the leg defined by the control points pi,j and pi,j+1 .
p2 p3

p1 p5

p0 p4

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 105
De Casteljaus Algorithm
I Sample run of de Casteljaus algorithm for t := 1/4.
I The points are indexed in the form i, j, where i denotes the number of the
iteration and j + 1 denotes the leg defined by the control points pi,j and pi,j+1 .
p2 p3

p0 =: p00
p1 p1 =: p01 p5
p2 =: p02
p3 =: p03
p4 =: p04
p0 p5 =: p05 p4

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 105
De Casteljaus Algorithm
I Sample run of de Casteljaus algorithm for t := 1/4.
I The points are indexed in the form i, j, where i denotes the number of the
iteration and j + 1 denotes the leg defined by the control points pi,j and pi,j+1 .
p2 p3
p12

p13

p11
p0 =: p00
p10 p5
p1 p1 =: p01
p11
p2 =: p02
p12
p3 =: p03
p10 p13
p4 =: p04 p14
p0 p14 p4
p5 =: p05

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 105
De Casteljaus Algorithm
I Sample run of de Casteljaus algorithm for t := 1/4.
I The points are indexed in the form i, j, where i denotes the number of the
iteration and j + 1 denotes the leg defined by the control points pi,j and pi,j+1 .
p2 p22 p3
p12

p13
p21
p23
p11
p0 =: p00
p10 p5
p1 p1 =: p01 p20
p11
p2 =: p02 p21
p20 p12
p3 =: p03 p22
p10 p13
p4 =: p04 p23 p14
p0 p14 p4
p5 =: p05

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 105
De Casteljaus Algorithm
I Sample run of de Casteljaus algorithm for t := 1/4.
I The points are indexed in the form i, j, where i denotes the number of the
iteration and j + 1 denotes the leg defined by the control points pi,j and pi,j+1 .
p2 p22 p3
p12
p32 p13
p31
p21
p23
p11
p0 =: p00
p10 p5
p1 p1 =: p01 p20
p30 p11 p30
p2 =: p02 p21
p20 p12 p31
p3 =: p03 p22
p10 p13 p32
p4 =: p04 p23 p14
p0 p14 p4
p5 =: p05

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 105
De Casteljaus Algorithm
I Sample run of de Casteljaus algorithm for t := 1/4.
I The points are indexed in the form i, j, where i denotes the number of the
iteration and j + 1 denotes the leg defined by the control points pi,j and pi,j+1 .
p2 p22 p3
p12
p32 p13
p31 p41
p21
p23
p11
p40 p0 =: p00
p10 p5
p1 p1 =: p01 p20
p30 p11 p30
p2 =: p02 p21 p40
p20 p12 p31
p3 =: p03 p22 p41
p10 p13 p32
p4 =: p04 p23 p14
p0 p14 p4
p5 =: p05

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 105
De Casteljaus Algorithm
I Sample run of de Casteljaus algorithm for t := 1/4.
I The points are indexed in the form i, j, where i denotes the number of the
iteration and j + 1 denotes the leg defined by the control points pi,j and pi,j+1 .
p2 p22 p3
p12
p32 p13
p31 p41
p21
p23
p11 p50
p40 p0 =: p00
p10 p5
p1 p1 =: p01 p20
p30 p2 p11 p30
=: p02 p21 p40
p20 p12 p31 p50
p3 =: p03 p22 p41
p10 p13 p32
p4 =: p04 p23 p14
p0 p14 p4
p5 =: p05

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 105
De Casteljaus Algorithm
I Numerically very stable, since only convex combinations are used!

1 /** Evaluates a Bezier curve at parameter t by applying de Casteljaus algorithm


2 * @param p: array of n+1 control points
3 * @param n: the degree of the Bezier curve
4 * @param t: the parameter
5 * @return the evaluation result
6 */
7 point DeCasteljau(point *p, int n, double t)
8 {
9 double h = p[n];
10 int i, j;

12 for (int i = 1; i <= n; ++i)


13 for (int j = 0; j <= n-i; ++j)
14 p[j] = (1-t) * p[j] + t * p[j+1];
15 return p[0];
16 }

p0 =: p00
p10
p1 =: p01 p20
p11 p30
p2 =: p02 p21 p40
p12 p31 p50
p3 =: p03 p22 p41
p13 p32
p4 =: p04 p23
p14
p5 =: p05

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 106
De Casteljaus Algorithm: Correctness

I The point p10 is obtained as


p0 =: p00
p10
p10 = (1 t)p00 + tp01 . p1 =: p01 p20
p11 p30
p2 =: p02 p21 p40
I Hence, the contribution of p01 p12 p31 p50
p3 =: p03 p22 p41
to p10 is tp01 . p13 p32
p4 =: p04 p23
I Since p20 is obtained as p14
p5 =: p05
p20 = (1 t)p10 + tp11 ,

the contribution of p01 to p20


via p10 is

(1 t)p10 = t(1 t)p01 .


I Similarly, the contribution of
p01 to p20 via p11 is

t(1 t)p01 .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 107
De Casteljaus Algorithm: Correctness

I Each path from p0i to pn0 is


constrained to a diamond p0 =: p00
p10
shape anchored at p0i and p1 =: p01 p20
p11 p30
pn0 . p2 =: p02 p21 p40
p12 p31 p50
I An inductive argument shows p3 =: p03 p22 p41
p13 p32
that each path from p0i to pn0 p4 =: p04 p23
p14
consists of i north-east p5 =: p05
arrows, i.e., multiplications by
t, and n i south-east
arrows, i.e., multiplications by
(1 t).
I Thus, the contribution of p0i
to pn0 is

t i (1 t)ni p0i ,

along each path from p0i to


pn0 .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 108
De Casteljaus Algorithm: Correctness

I How many different paths


exist from p0i to pn0 ? This is p0 =: p00
p10
equivalent to asking how p1 =: p01 p20
p11 p30
many different ways exist to p2 =: p02 p21 p40
p12 p31 p50
place i north-east arrows on p3 =: p03 p22 p41
p13 p32
a total of n possible p4 =: p04 p23
p14
positions?, and
 the answer p5 =: p05
is given by ni .
I Thus, the total contribution of
p0i to pn0 , along all paths
from p0i to pn0 , is
!
n
t i (1 t)ni p0i .
i

This is, however, precisely


the weight of p0i in the
definition of a Bzier curve
(Def. 77).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 109
Evaluation of a Bzier Curve Using Horners Scheme
I Horners scheme can also be used for evaluating a Bzier curve.
I After rewriting B(t) as
n n
!
X X n i
B(t) = Bi,n (t)pi = t (1 t)ni pi
i
i=0 i=0
n
! i !
n
X n t
= (1 t) pi ,
i 1t
i=0

one evaluates the sum for the value t


1t
, and then multiplies by (1 t)n .
I This method becomes unstable if t is close to one. In this case, one can resort to
Lem. 83, which gives the identity
n
! i !
n
X n 1t
B(t) = t pni .
i t
i=0

I In any case, Horners scheme tends to be faster but numerically more


problematic than de Casteljaus algorithm.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 110
Bernstein Polynomials and Polar Forms

Theorem 84
Let n, d N. For every polynomial function F : R Rd there exists exactly one
symmetric and multi-affine function f : Rn Rd , which is called the polar form (aka
blossom, Dt.: Polarform) of F , such that
1. for all i {1, 2, . . . , n}, all xP
1 , x2 , . . . , xn R, all k N, all y1 , y2 , . . . , yk R and
all 1 , 2 , . . . , k R with kj=1 j = 1

k
X k
X
f (x1 , x2 , . . . , xi1 , j yj , xi+1 , . . . , xn ) = j f (x1 , x2 , . . . , xi1 , yj , xi+1 , . . . , xn )
j=1 j=1

2. for all i, j {1, 2, . . . , n}

f (x1 , x2 , . . . , xi1 , xi , xi+1 , . . . , xj1 , xj , xj+1 , . . . , xn ) =


f (x1 , x2 , . . . , xi1 , xj , xi+1 , . . . , xj1 , xi , xj+1 , . . . , xn ),
3. for all x R

F (x) = f (x, x, . . . , x ), i.e., F is the diagonal of f .


| {z }
n times

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 111
Bernstein Polynomials and Polar Forms
Lemma 85
Pn
Let n N and a0 , a1 , . . . , an R, and F (x) := i=0 ai x i . Then f : Rn R

n
X 1 X Y
f (x1 , x2 , . . . , xn ) := ai 
n xj

i=0 i I{1,...,n} jI
|I|=i

is the polar form of F .

ai F (x) f (x1 , . . . , xn )
n=1 a0 := 1, a1 := 0 1 1
a0 := 0, a1 := 1 x x1
n=2 a0 := 1, a1 := 0, a2 := 0 1 1
1
a0 := 0, a1 := 1, a2 := 0 x 2
(x1 + x2 )
a0 := 0, a1 := 0, a2 := 1 x2 x1 x2
n=3 a0 := 1, a1 := 0, a2 := 0, a3 := 0 1 1
1
a0 := 0, a1 := 1, a2 := 0, a3 := 0 x 3
(x 1 + x2 + x3 )
a0 := 0, a1 := 0, a2 := 1, a3 := 0 x2 1
3
(x1 x 2 + x 1 x3 + x2 x3 )
a0 := 0, a1 := 0, a2 := 0, a3 := 1 x3 x1 x2 x3

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 112
Bernstein Polynomials and Polar Forms
1 (x +x )
x
 
2 1 2
I Let F (x) := 1 x2 . Hence f (x1 , x2 ) = 1x x , and we get
2 2 1 2
! ! !
1
0 2 1
f (0, 0) = f (0, 1) = = f (1, 0) f (1, 1) = 1 .
0 0 2

I Furthermore, F (t) = f (t, t), with


f (t, t) = f ((1 t) 0 + t 1, t) = (1 t)f (0, t) + tf (1, t)
= (1 t)[(1 t) f (0, 0) + t f (0, 1))] + t[(1 t) f (1, 0) + t f (1, 1))]
= (1 t)2 f (0, 0) + 2t(1 t)f (0, 1) + t 2 f (1, 1)
= B0,2 (t)f (0, 0) + B1,2 (t)f (0, 1) + B2,2 (t)f (1, 1).

I Hence, there is a close connection between the polar form and the Bernstein
polynomials: f (0, 0), f (0, 1), f (1, 1) form the coefficients (i.e., control points) of F
relative to the Bernstein basis.
I Polar forms are useful because they provide a uniform and simple means for
computing values of a polynomial using a variety of representations (Bzier,
B-spline, NURBS, etc.).
I For this reason, some authors prefer to introduce Bzier curves in their polar
form.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 113
Bernstein Polynomials and Polar Forms

Lemma 86
Every polynomial can be expressed in Bezier form. That is, for every polynomial
P : R R2 of degree n there exist control points p0 , p1 , . . . , pn R2 such that the
Bzier curve defined by them matches P|[0,1] .

Sketch of Proof : Let f be the polarform of P, and let

pk := f (0, . . . , 0, 1, . . . , 1) for k = 0, 1, . . . , n.
| {z } | {z }
nk k

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 114
Geometric Interpretation of Polar Forms
1 (x +x )
x
 
2 1 2
I Let F (x) := 1 x2 , and t := 0.6. Recall that f (x1 , x2 ) = 1x x .
2 2 1 2
I We get:
! ! !
1
1
2
t 2
+ 21 t t
f (t, 0) = f (1, t) = 1
f (t, t) = 1 2
0 2
t 2
t

f (1, 1) f (0, 0) f (0, 1) f (1, 1)


1t t 1t t
f (1, t)
f (t, t) f (0, t) f (1, t)
1t t
f (t, t)
f (0, 0) f (t, 0) f (1, 0) = f (0, 1)

I This geometric interpretation matches the de Casteljau algorithm!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 115
Derivatives of a Bzier Curve

Lemma 87
Let B be a Bzier curve of degree n with n + 1 control points p0 , p1 , . . . , pn . Its first
derivative, which is sometimes called hodograph, is a Bzier curve of degree n 1,
n1
X
B0 (t) = Bi,n1 (t)(n(pi+1 pi )),
i=0

whose n control points are given by n(p1 p0 ), n(p2 p1 ), , n(pn pn1 ).

Proof : Since the control points are constants, computing the derivative of a Bzier
curve is reduced to computing the derivatives of the Bernstein basis polynomials.
n
! n n
!
0 d X X 0 Cor . 72
X
B (t) = Bi,n (t)pi = Bi,n (t)pi = n (Bi1,n1 (t) Bi,n1 (t))pi
dt
i=0 i=0 i=0
n n1
!
X X
=n Bi1,n1 (t)pi Bi,n1 (t)pi
i=1 i=0
n1 n1
! n1
X X X
=n Bi,n1 (t)pi+1 Bi,n1 (t)pi = Bi,n1 (t)(n(pi+1 pi ))
i=0 i=0 i=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 116
Derivatives of a Bzier Curve

Lemma 88
A Bzier curve is tangent to the control polygon at the endpoints.

Proof : This is readily proved by computing B0 (0) and B0 (1).


I Hence, joining two Bzier curves in a G1 -continuous way is easy.
I Let p0 , p1 , . . . , pn and p0? , p1? , . . . , pm
?
be the control points of two Bzier curves B
1
and B . In order to achieve C -continuity, we need (in addition to pn = p0? )
?

B0 (1) = (B? )0 (0) i.e., n(pn pn1 ) = m(p1? p0? ).

I This has an interesting consequence for closed Bzier curves with


p0 = B(0) = B(1) = pn :
I We get G1 -continuity at p0 if p0 , p1 , pn1 are collinear.
I We get C 1 -continuity at p0 if p1 p0 = pn pn1 .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 117
Subdivision of a Bzier Curve
I One can subdivide an n-degree Bzier curve B into two curves, at a point B(t0 )
for a given parameter t0 , such that the newly obtained Bzier curves B1 and B2
have their own set of control points and are of degree n each:
I First, we use de Casteljaus algorithm to compute B(t ).
0
I The subdivided control polygon can then be used to generate the new

control polygons for B1 and B2 .


I Note that B and B join in a G 1 -continuous way.
1 2

p2 p22 p3
p12
p32 p13
p31 p41
p21
p23
p11 p50
p40 p0 =: p00
p10 p5
p1 p1 =: p01 p20
p30 p2 p11 p30
=: p02 p21 p40
p20 p12 p31 p50
p3 =: p03 p22 p41
p10 p13 p32
p4 =: p04 p23 p14
p0 p14 p4
p5 =: p05

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 118
Subdivision of a Bzier Curve

Lemma 89
Let p0 , p1 , . . . , pn be the control points of the Bzier curve B, and let pi,j denote the
control points obtained by de Casteljaus algorithm for some t0 ]0, 1[. We define
new control points as follows:

pi? := pi,0 for i = 0, 1, . . . , n


pi?? := pni,i for i = 0, 1, . . . , n

Let B? (B?? , resp.) denote the Bzier curve defined by p0? , p1? , . . . , pn?
(p0?? , p1?? , . . . , pn?? , resp.). Then B? and B?? join in a tangent-continuous way at point
pn? = p0?? , and we have

B? = B|[0,t0 ] and B?? = B|[t0 ,1] .

I Note: With every subdivision the control polygons get closer to the Bzier curve.
And the approximation is very fast: For k subdivision steps, the maximum
distance between the control polygons and the curve is
c
< for some positive constant c.
2k

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 119
Degree Elevation of a Bzier Curve
I An increase of the number of control points of a Bzier curve increases the
flexibility in designing shapes.
I The key goal is to preserve the shape of the curve. (Recall that Bzier curves
change globally if one control point is relocated!)
I Of course, adding one control point means increasing the degree of a Bzier
curve by one.
I Let p0 , p1 , . . . , pn be the old control points, and p0? , p1? , . . . , pn? , pn+1
?
be the new
control points, and denote the Bzier curves defined by them by B and B? .
I How can we guarantee B(t) = B? (t) for all t [0, 1]?
I Obviously, we will need

p0 = p0? ?
and pn = pn+1

in order to ensure that at least the start and end points of B and B? match.
I In the sequel, we will find it convenient to extend the index range of the control
points of B and introduce (arbitrary) points p1 and pn+1 . (Both points will be
multiplied with factors that equal zero, anyway.)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 120
Degree Elevation of a Bzier Curve
I Standard equalities:
! ! !
n+1 n+1 n i
(1 t) Bi,n = (1 t) t (1 t)ni
i i i
! ! !
n n+1 i n
= t (1 t)n+1i = Bi,n+1
i i i
and
! ! !
n+1 n+1 n i
t Bi,n = t t (1 t)ni
i +1 i +1 i
! ! !
n n + 1 i+1 n
= t (1 t)ni = Bi+1,n+1
i i +1 i

I Hence,
n+1i i +1
(1 t) Bi,n = Bi,n+1 , and t Bi,n = Bi+1,n+1 .
n+1 n+1

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 121
Degree Elevation of a Bzier Curve
n
X n
X
B(t) = Bi,n (t)pi = ((1 t) + t) Bi,n (t)pi
i=0 i=0
n
X n
X n
X n
X
= (1 t) Bi,n (t)pi + t Bi,n (t)pi = (1 t) Bi,n (t)pi + t Bi,n (t)pi
i=0 i=0 i=0 i=0
n n
X n+1i X i +1
= Bi,n+1 (t)pi + Bi+1,n+1 (t)pi
n+1 n+1
i=0 i=0
n+1 n
X n+1i X i +1
= Bi,n+1 (t)pi + Bi+1,n+1 (t)pi
n+1 n+1
i=0 i=1
n+1 n+1
X n+1i X i
= Bi,n+1 (t)pi + Bi,n+1 (t)pi1
n+1 n+1
i=0 i=0
n+1   n+1
X i n+1i X
= Bi,n+1 (t) pi1 + pi = Bi,n+1 (t)pi? =: B? (t)
n+1 n+1
i=0 i=0

with
i n+1i
pi? := pi1 + pi , i = 0, . . . , n + 1.
n+1 n+1

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 122
Degree Elevation of a Bzier Curve

Lemma 90
Let p0 , p1 , . . . , pn be the control points of the degree-n Bzier curve B. If we use
   
i i
pi? := pi1 + 1 pi for i = 0, 1, , n + 1
n+1 n+1

as control points for the Bzier curve B? of degree n + 1, then

B(t) = B? (t) for all t [0, 1].

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 123
Degree Elevation of a Bzier Curve
I Note that all newly created control points lie on the edges of the previous control
polygon.
I Effectively, the corners of the previous control polygon are cut off.
I Degree elevation can be used repeatedly, e.g., in order to arrive at the same
degrees for two Bzier curves that join.
I As the degree keeps increasing, the control polyon approaches the Bzier curve
and has it as a limiting position.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 124
Bzier Surfaces

Definition 91 (Bzier surface)


Suppose that we are given a set of (n + 1) (m + 1) control points in R3 , with
0 i n and 0 j m, where the control point on the i-th row and j-th column is
denoted by pi,j . The Bzier surface S : [0, 1] [0, 1] R3 defined by pi,j is given by
n X
X m
S(u, v ) := Bi,n (u)Bj,m (v )pi,j for (u, v ) [0, 1] [0, 1],
i=0 j=0

d
 k
where Bk ,d (x) = k
x (1 x)dk is the k -th Bernstein basis polynomial of degree
d.

I Since Bi,n (u) and Bj,m (v ) are polynomials of degree n and m, this is called a
Bzier surface of degree (n, m).
I The set of control points is called a Bzier net or control net.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 126
Properties of Bzier Surfaces

Lemma 92
For all n, m N0 and all 0 i n and 0 j m, and all (u, v ) [0, 1] [0, 1], the
term Bi,n (u)Bj,m (v ) is non-negative.

Lemma 93 (Partition of unity )


For all m, n N0 , the sum of all Bi,n (u)Bj,m (v ) is one:
n X
X m
Bi,n (u)Bj,m (v ) = 1 for all (u, v ) [0, 1] [0, 1].
i=0 j=0

Proof : We have for all m, n N0 and all (u, v ) [0, 1] [0, 1]



X n Xm n
X Xm Xn
Bi,n (u)Bj,m (v ) = Bi,n (u) Bj,m (v ) = Bi,n (u) = 1
i=0 j=0 i=0 j=0 i=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 127
Properties of Bzier Surfaces

Lemma 94 (Convex hull property )


A Bzier surface lies completely inside the convex hull of its control points.

Proof : Recall that S(u, v ) is the linear combination of all its control points with
non-negative coefficients whose sum is one.
Lemma 95
A Bzier surface passes through the four corners p0,0 , pn,0 , p0,m and pn,m .

Proof : Recall that


( (
1 for i = 0, 1 for j = 0,
Bi,n (0) = and Bj,m (0) =
0 for i > 0, 0 for j > 0.

Hence, S(0, 0) = B0,n (0)B0,m (0)p0,0 = p0,0 . Similarly for the other corners.
Lemma 96
Applying an affine transformation to the control points results in the same
transformation as obtained by transforming the surfaces equation.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 128
Isoparametric Curves of Bzier Surfaces

Lemma 97
Consider a Bzier surface S : [0, 1] [0, 1] R3 defined by (n + 1) (m + 1)
control points pi,j , with 0 i n and 0 j m, and let v0 [0, 1] be fixed. Then
C : [0, 1] R3 defined as
n X
X m
C(u) := Bi,n (u)Bj,m (v0 )pi,j for u [0, 1]
i=0 j=0

is a Bzier curve defined by the n + 1 control points q0 , q1 , . . . , qn R3 , where


m
X
qi := Bj,m (v0 )pi,j for 0 i n.
j=0

Proof : We have for all u [0, 1]



n X
X m n
X Xm n
X
C(u) = Bi,n (u)Bj,m (v0 )pi,j = Bi,n (u) Bj,m (v0 )pi,j = Bi,n (u)qi .
i=0 j=0 i=0 j=0 i=0

I Analogously for fixed u0 .


c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 129
Isoparametric Curves of Bzier Surfaces

Corollary 98
The boundary curves of a Bzier surface are Bzier curves defined by the
boundary points of its control net.

Lemma 99 (Tangency in the corner points)


Consider a Bzier surface S : [0, 1] [0, 1] R3 defined by (n + 1) (m + 1)
control points pi,j , with 0 i n and 0 j m. The tangent plane at
S(0, 0) = p0,0 is spanned by the vectors p1,0 p0,0 and p0,1 p0,0 .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 130
Bzier Surface as Tensor-Product Surface
I A Bzier surface is generated by multiplying two Bzier curves: tensor product
surface.
Lemma 100
Consider a Bzier surface S : [0, 1] [0, 1] R3 defined by (n + 1) (m + 1) control
points pi,j , with 0 i n and 0 j m. Then S is a tensor-product surface:

p0,0 p0,1 p0,m



B0,m (v )
p1,0 p1,1 p1,m B1,m (v )
S(u, v ) = (B0,n (u), B1,n (u), . . . , Bn,n (u)) . .. .. ..

.. ..
. . . .
pn,0 pn,1 pn,m Bm,m (v )

Proof : Just do the math!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 131
B-Spline Curves and Surfaces
Shortcomings of Bzier Curves
B-Spline Basis Functions
B-Spline Curves
B-Spline Surfaces
Non-Uniform Rational B-Spline Curves and Surfaces

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 132
Shortcomings of Bzier Curves
I Modifying the vertex pj of a Bzier curve causes a global change of the entire
curve:
p9 p8
p2 p3 p7
p10
p6
p1
p5
p4
p0 v
p4 + v

B? (t) = B(t) + Bj,n (t)v

I But Bj,n (t) 6= 0 for all t with 0 < t < 1!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 134
Shortcomings of Bzier Curves
I While it is easy to join two Bzier curves with G1 continuity, achieving C 2 or even
higher continuity is quite cumbersome.

p3

p1
p2 , p3 = p0 , p1 collinear

p1

p0 p3 = p0

p2 p2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 135
Shortcomings of Bzier Curves
I While it is easy to join two Bzier curves with G1 continuity, achieving C 2 or even
higher continuity is quite cumbersome.
I Even worse, changing the common end point of two consecutive Bzier curves
destroys G1 continuity.

p3

p1

p1
p3 = p0

p0

p2 p2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 135
Shortcomings of Bzier Curves
I While it is easy to join two Bzier curves with G1 continuity, achieving C 2 or even
higher continuity is quite cumbersome.
I This will be easier for B-spline curves. (Depicted are two cubic B-splines.)

p3

p1

p1

p0 p3 = p0

p2 p2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 136
Shortcomings of Bzier Curves
I While it is easy to join two Bzier curves with G1 continuity, achieving C 2 or even
higher continuity is quite cumbersome.
I This will be easier for B-spline curves. (Depicted are two cubic B-splines.)

p3

p1

p1 p3 = p0

p0

p2 p2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 136
Shortcomings of Bzier Curves
I It is fairly difficult to squeeze a Bzier curve close to a sharp corner of the control
polygon.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 137
Shortcomings of Bzier Curves
I Adding additional control vertices hardly helps but increases the degree of the
Bzier curve, which may result in oscillation and cause numerical instability.

three new vertices

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 137
Introduction to B-Splines
I Curves consisting of just one segment have several drawbacks:
I To satisfy all given constraints, often a high polynomial degree is required.

I The number of control points is directly related to the degree.

I Interactive shape design is inaccurate or requires high computational costs.

I The solution is to use a sequence of polynomial or rational curves to form one


continuous curve: spline.
I Historically, the term spline (Dt.: Straklatte) was used for elastic wooden strips in
the shipbuilding industry, which pass through given constrained points called
ducks such that the strain of the strip is minimized.
ducks

I Mathematical splines were introduced by Isaac Jacob Schoenberg in 1946.

Warning
The terminology and the definitions used for B-splines vary from author to author!
Thus, make sure to check carefully the definitions given in textbooks or research
papers.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 139
Introduction to B-Splines

Definition 101 (Spline)


A curve C(t) : [a, b] R2 is called a spline of degree k (and order k + 1), for k N,
if there exist
I m polynomials P1 , P2 , . . . , Pm of degree k , for m N, and
I m + 1 parameters t0 , ..., tm R
such that
1. a = t0 < t1 < . . . < tm1 < tm = b,
2. C|[ti1 ,ti ] = Pi |[ti1 ,ti ] for all i {1, 2, . . . , m}.

P4 (t)
C(t) P3 (t)
P1 (t)
P2 (t) P5 (t)

a = t0 t1 t2 t3 t4 t5 = b

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 140
Introduction to B-Splines
I The numbers t0 , ..., tm are called breakpoints or knots.
I The definition implies

Pi (ti ) = Pi+1 (ti ) for all i {1, 2, . . . , m 1}.


I Special case k = 1: We get a polygonal curve.

I The polynomials join with some unknown degree of continuity at the breakpoints.
(We have at least C 0 -continuity.)
I Obvious problem: How can we achieve a reasonable degree of continuity?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 141
Knot Vector

Definition 102 (Knot vector, Dt.: Knotenvektor )


In general, a knot vector is a sequence of non-decreasing real numbers.
A finite knot vector is a sequence of m + 1 real numbers := (t0 , t1 , t2 , . . . , tm ), for
some m N, such that ti ti+1 for all 0 i < m.
An infinite knot vector is a sequence of real numbers := (t0 , t1 , t2 , . . .) such that
ti ti+1 for all i N0 .
A bi-infinite knot vector is a sequence of real numbers
:= (. . . , t2 , t1 , t0 , t1 , t2 , . . .) such that ti ti+1 for all i Z.
The numbers ti are called knots, and the i-th knot span is given by the (half-open)
interval [ti , ti+1 [ R.

2nd knot span


z}|{
t0 t1 t2 t3 t4

I For (bi)infinite knot vectors we assume supi ti = and infi ti = .


I For some of the subsequent definitions we will find it convenient to deal with
(bi)infinite knot vectors. With some extra care for boundary conditions one could
replace all (bi)infinite knot vectors by finite knot vectors.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 142
Knot Vector

Definition 103 (Multiplicity of a knot, Dt.: Vielfachheit eines Knotens)


Let be a finite or (bi)infinite knot vector. If a knot ti appears exactly k > 1 times in
, for a permissible value of i Z, i.e., if ti1 < ti = ti+1 = = ti+k 1 < ti+k , then ti
is a multiple knot of multiplicity k . Otherwise, if ti appears only once in then ti is a
simple knot.

Definition 104 (Uniform knot vector )


A finite or (bi)infinite knot vector is uniform if there exists c R+ such that
ti+1 ti = c for all (permissible) values of i Z, except for possibly the first and last
knots of higher multiplicity in case of a finite knot sequence. Otherwise, the knot
vector is non-uniform.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 143
B-Spline Basis Functions
I We define the B-spline basis functions analytically, using the recurrence formula
by de Boor, Cox and Mansfield.
Definition 105 (B-spline basis function)
Let be a finite or (bi)infinite knot vector. For all (permissible) i Z and k N0 , the
i-th B-spline basis function, Ni,k , (t), of degree k (and order k + 1) relative to is
defined as,
if k = 0,

1 if ti t < ti+1 ,
Ni,0, (t) =
0 otherwise,

and if k > 0 as
t ti ti+k +1 t
Ni,k , (t) = Ni,k 1, (t) + Ni+1,k 1, (t).
ti+k ti ti+k +1 ti+1

0
I In case of multiple knots, indeterminate terms of the form 0
are taken as zero!
I Alternatively, one can demand ti < ti+k for all (permissible) i Z.
I Aka: Normalized B(asic)-Spline Blending Functions.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 144
B-Spline Basis Functions
I Plugging into the definition yields
t ti ti+2 t
Ni,1, (t) = Ni,0, (t) + Ni+1,0, (t)
ti+1 ti ti+2 ti+1


0 if t 6 [ti , ti+2 [,

tti

= ti+1 ti
if t [ti , ti+1 [,


ti+2 t

if t [ti+1 , ti+2 [.
t t
i+2 i+1

I The functions Ni,1, are called hat functions or chapeau functions. They are
widely used in signal processing and finite-element techniques.
I Note that Ni,1, is continuous at ti+1 .
I For a uniform knot vector with c := ti+1 ti this simplifies to


0 if t 6 [ti , ti+2 [,

1
Ni,1, (t) = c
(t ti ) if t [ti , ti+1 [,


1
(t t)
c i+2
if t [ti+1 , ti+2 [.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 145
B-Spline Basis Functions
I Basis functions Ni,k , .

1
N1,0 Ni,0 is a step function that is 1 in
the interval [ti , ti+1 [
t0 t1 t2 t3 t4 t5

1
N1,1 Ni,1 is a piecewise linear function
that is non-zero on two knot spans
[ti , ti+2 [ and goes from 0 to 1 and
t0 t1 t2 t3 t4 t5 back

1
N1,2 Ni,2 is a piecewise quadratic
function that is non-zero on three
knot spans [ti , ti+3 [
t0 t1 t2 t3 t4 t5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 146
Sample B-Spline Basis Functions
I Basis functions of degree 0:

1 1
N0,0 N1,0

t0 t1 t2 t3 t4 t5 t0 t1 t2 t3 t4 t5

1 1
N2,0 N3,0

t0 t1 t2 t3 t4 t5 t0 t1 t2 t3 t4 t5

1 1
N4,0

t0 t1 t2 t3 t4 t5 t0 t1 t2 t3 t4 t5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 147
Sample B-Spline Basis Functions
I Basis functions of degree 1:

1 1
N0,1 N1,1

t0 t1 t2 t3 t4 t5 t0 t1 t2 t3 t4 t5

1 1
N2,1 N3,1

t0 t1 t2 t3 t4 t5 t0 t1 t2 t3 t4 t5

t0 t1 t2 t3 t4 t5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 147
Sample B-Spline Basis Functions
I Basis functions of degree 2:

1 1
N0,2 N1,2

t0 t1 t2 t3 t4 t5 t0 t1 t2 t3 t4 t5

1
N2,2

t0 t1 t2 t3 t4 t5

t0 t1 t2 t3 t4 t5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 147
Sample B-Spline Basis Functions
I Uniform knot vector (0, 19 , 92 , 39 , 49 , 95 , 69 , 79 , 98 , 1) with ten knots.
1.0 1.0

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

N0,0 , N1,0 , . . . , N8,0 N0,1 , N1,1 , . . . , N7,1


1.0 1.0

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

N0,2 , N1,2 , . . . , N6,2 N0,3 , N1,3 , . . . , N5,3


c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 148
Sample B-Spline Basis Functions
I Clamped uniform knot vector (0, 0, 0, 51 , 25 , 53 , 45 , 1, 1, 1) with ten knots.
1.0 1.0

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

N2,0 , N3,0 , . . . , N6,0 N1,1 , N2,1 , . . . , N5,1


1.0 1.0

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

N0,2 , N1,2 , . . . , N6,2 N0,3 , N1,3 , . . . , N5,3


c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 149
Sample B-Spline Basis Functions
I Non-uniform knot vector (0, 16 , 31 , 12 , 12 , 21 , 12 , 32 , 56 , 1) with ten knots.
1.0 1.0

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

N0,0 , N1,0 , N2,0 , N6,0 , N7,0 , N8,0 N0,1 , N1,1 , N2,1 , N5,1 , N6,1 , N7,1
1.0 1.0

0.8 0.8

0.6 0.6

0.4 0.4

0.2 0.2

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

N0,2 , N1,2 , N2,2 , N4,2 , N5,2 , N6,2 N0,3 , N1,3 , . . . , N5,3


c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 150
Properties of B-Spline Basis Functions
I It is common to omit the explicit mentioning of the dependency of Ni,k , on , and
to write simply Ni,k .
I For k > 0, each Ni,k , (t) is a linear combination of two B-spline basis functions of
degree k 1: Ni,k 1, (t) and Ni+1,k 1, (t).
I This suggests a recursive analysis of the dependencies.

N0,0
N0,1
N1,0 N0,2
N1,1 N0,3
N2,0 N1,2 N0,4
N2,1 N1,3
N3,0 N2,2
N3,1
N4,0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 151
Properties of B-Spline Basis Functions
I It is common to omit the explicit mentioning of the dependency of Ni,k , on , and
to write simply Ni,k .
I For k > 0, each Ni,k , (t) is a linear combination of two B-spline basis functions of
degree k 1: Ni,k 1, (t) and Ni+1,k 1, (t).
I Ni,k , (t) depends on Ni,0, (t), Ni+1,0, (t), . . . , Ni+k ,0, (t).

N0,0 Ni,k
N0,1
N1,0 N0,2
N1,1 N0,3
N2,0 N1,2 N0,4
N2,1 N1,3
N3,0 N2,2
N3,1
N4,0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 151
Properties of B-Spline Basis Functions
I It is common to omit the explicit mentioning of the dependency of Ni,k , on , and
to write simply Ni,k .
I For k > 0, each Ni,k , (t) is a linear combination of two B-spline basis functions of
degree k 1: Ni,k 1, (t) and Ni+1,k 1, (t).
I Ni,k , (t) is non-zero only for t [ti , ti+k +1 [.

[t0 , t1 [ N0,0 Ni,k


N0,1
[t1 , t2 [ N1,0 N0,2
N1,1 N0,3
[t2 , t3 [ N2,0 N1,2 N0,4
N2,1 N1,3
[t3 , t4 [ N3,0 N2,2
N3,1
[t4 , t5 [ N4,0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 151
Properties of B-Spline Basis Functions

Lemma 106 (Local support)


Let := (. . . , t2 , t1 , t0 , t1 , t2 , . . .) be a (bi)infinite knot vector. For all (permissible)
i Z and k N0 we have

Ni,k , (t) = 0 if t
/ [ti , ti+k +1 [.

Proof : We do a proof by induction on k . Let i Z be arbitrary but fixed.


I.B.: By definition, this claim is correct for k = 0.
I.H.: Suppose that it is true for all basis functions of degree k 1, for some arbitrary
but fixed k N. I.e., Ni,k 1, (t) = 0 if t
/ [ti , ti+k [.
I.S.: Recall that
t ti ti+k +1 t
Ni,k , (t) = Ni,k 1, (t) + Ni+1,k 1, (t).
ti+k ti ti+k +1 ti+1
Hence, Ni,k , (t) = 0 if t
/ ([ti , ti+k [[ti+1 , ti+k +1 [), i.e., if t
/ [ti , ti+k +1 [.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 152
Properties of B-Spline Basis Functions

Lemma 107 (Non-negativity )


We have Ni,k , (t) 0 for all (permissible) i Z and k N0 , and all real t.

Proof : Again we do a proof by induction on k . Let i Z be arbitrary but fixed.


I.B.: By definition, this claim is correct for k = 0.
I.H.: Suppose that it is true for all basis functions of degree k 1, for some arbitrary
but fixed k N.
I.S.: Lemma 106 tells us that Ni,k , (t) = 0 if t
/ [ti , ti+k +1 [. Hence, we can focus on
t [ti , ti+k +1 [ and get
t ti ti+k +1 t
Ni,k , (t) = Ni,k 1, (t) + Ni+1,k 1, (t)
ti+k ti | {z } ti+k +1 ti+1 | {z }
0 (I.H.) 0 (I.H.)
| {z } | {z }
0 for t[ti ,ti+k +1 [ 0 for t[ti ,ti+k +1 [

0.

Lemma 108
All B-spline basis functions are right-side continuous.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 153
Properties of B-Spline Basis Functions

Lemma 109
Let := (. . . , t2 , t1 , t0 , t1 , t2 , . . .) be a (bi)infinite knot vector. For all (permissible)
i Z and k N0 , the basis functions

Nik ,k , , Nik +1,k , , . . . , Ni,k ,

are the only (at most) k + 1 basis functions of degree k that are (possibly) non-zero
over the interval [ti , ti+1 [.

[t0 , t1 [ N0,0
N0,1
[t1 , t2 [ N1,0 N0,2
N1,1 N0,3
[t2 , t3 [ N2,0 N1,2 N0,4
N2,1 N1,3
[t3 , t4 [ N3,0 N2,2
N3,1
[t4 , t5 [ N4,0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 154
Properties of B-Spline Basis Functions

Lemma 110
Let := (. . . , t2 , t1 , t0 , t1 , t2 , . . .) be a (bi)infinite knot vector. For all (permissible)
i Z and k N0 , the basis functions

Nik ,k , , Nik +1,k , , . . . , Ni,k ,

are the only (at most) k + 1 basis functions of degree k that are (possibly) non-zero
over the interval [ti , ti+1 [.

Proof : The Local Support Lemma 106 tells us that

Nj,k , (t) = 0 if t
/ [tj , tj+k +1 [

and, thus, possibly non-zero only if t [tj , tj+k +1 [.


Hence, Nj,k , (t) 6= 0 over [ti , ti+1 [ only if i j and i + 1 j + k + 1, i.e., if j i and
j i k . Thus,

Nik ,k , , Nik +1,k , , . . . , Ni,k ,

are the only candidate B-spline basis functions to be non-zero over [ti , ti+1 [.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 154
Properties of B-Spline Basis Functions

Lemma 111
All B-spline basis functions of degree k are piecewise polynomials of degree k .

1
N1,2

t0 t1 t2 t3 t4 t5

Lemma 112
All B-spline basis functions of degree k are k r times continuously differentiable
at a knot of multiplicity r , and k 1 times continuously differentiable everywhere
else. The first derivative of Ni,k is given as follows:

0 k k
Ni,k (t) = Ni,k 1 (t) Ni+1,k 1 (t)
ti+k ti ti+k +1 ti+1

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 155
Properties of B-Spline Basis Functions

Lemma 113
For a uniform knot vector all B-spline basis functions of the same degree are
shifted copies of each other: For all (permissible) i Z and k N0 we have
Ni,k , (t) = N0,k , (t i c), where c := t1 t0 .

Lemma 114 (Partition of unity )


m
Let = (t0 , t1 , t2 , . . . , tm ) be a finite knot vector, and k N0 with k < 2
. Then,

X1
mk
Ni,k , (t) = 1 for all t [tk , tmk [.
i=0

Corollary 115
Let = (t0 , t1 , t2 , . . . , tn+k +1 ) be a finite knot vector, for some k N0 with k n.
Then,
n
X
Ni,k , (t) = 1 for all t [tk , tn+1 [.
i=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 156
Properties of B-Spline Basis Functions
Proof of Lemma 114 (Partition of Unity) : We do a proof by induction on k .
I.B.: By definition, this claim is correct for k = 0.
I.H.: Suppose that it is true forP degree k 1, for some arbitrary but fixed k N such
that k < m2 . I.e., suppose that mk i=0 Ni,k 1, (t) = 1 for all t [tk 1 , tmk +1 [.
I.S.: Recall that (by Lem. 106)
N0,k 1, (t) = 0 for t
/ [t0 , tk [ and Nmk ,k 1, (t) = 0 for t
/ [tmk , tm [.
Let t [tk , tmk [ be arbitrary but fixed. Applying the recursion yields
X1
mk X1  t ti
mk
ti+k +1 t

Ni,k , (t) = Ni,k 1, (t) + Ni+1,k 1, (t)
ti+k ti ti+k +1 ti+1
i=0 i=0

X1
mk
t ti X2 ti+k +1 t
mk
= Ni,k 1, (t) + Ni+1,k 1, (t)
ti+k ti ti+k +1 ti+1
i=1 i=0

X1
mk
t ti X1
mk
ti+k t
= Ni,k 1, (t) + Ni,k 1, (t)
ti+k ti ti+k ti
i=1 i=1

X1
mk mk
X t[tk 1 ,tmk +1 [
= Ni,k 1, (t) = Ni,k 1, (t) = 1.
i=1 i=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 157
B-Spline Curves

Definition 116 (B-spline curve)


For n N and k N0 with k n, consider a set of n + 1 control points with position
vectors p0 , p1 , . . . , pn in the plane, and let := (t0 , t1 , . . . , tn+k +1 ) be a knot vector.
Then the B-spline curve of degree k (and order k + 1) relative to with control
points p0 , p1 , . . . , pn is given by
n
X
P(t) := Ni,k , (t)pi for t [tk , tn+1 [,
i=0

where Ni,k , is the i-th B-spline basis function of degree k relative to .

I The degree k is (except for k n) independent of the number n + 1 of control


points!
I The restriction of t to the interval [tk , tn+1 [ guarantees that the basis functions sum
up to 1 for all (permissible) values of t . (Recall the Partition of Unity, Cor. 115.)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 159
Clamped and Unclamped B-Spline Curves

Definition 117 (Clamped B-spline)


Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn , over the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n. If t0 = t1 = . . . = tk < tk +1 and tn < tn+1 = . . . = tn+k +1 then we
say that the knot vector and the B-spline curve are clamped.

I Recall that the Partition of Unity (Cor. 115) holds for all t [tk , tn+1 [.
I Typically, for a clamped knot vector,

0 = t0 = t1 = . . . = tk and tn+1 = . . . = tn+k +1 = 1.

Lemma 118
Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn , over the clamped knot vector := (t0 , t1 , . . . , tn+k +1 ), for
n N and k N0 with k n. Then P starts in p0 and ends in pn .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 160
Clamped and Unclamped B-Spline Curves
0 0 2 4 6 8 8
      
I Control points: { 0
, 2
, 3
, 0
, 3
, 2
, 0
}.

1 1 3 2 1 3 7 4 9
uniform unclamped cubic B-spline: = (0, , , , , , , , , , 1)
10 5 10 5 2 5 10 5 10

uniform clamped cubic B-spline: = (0, 0, 0, 0, 41 , 12 , 34 , 1, 1, 1, 1).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 161
Proof of Lemma 118
We prove P(tk ) = p0 . Recall that N0,k (t) is non-zero only for t [t0 , tk +1 [.

[t0 , t1 [ N0,0 Ni,k


N0,1
[t1 , t2 [ N1,0 N0,2
N1,1 N0,3
[t2 , t3 [ N2,0 N1,2 N0,4
N2,1 N1,3
[t3 , t4 [ N3,0 N2,2
N3,1
[t4 , t5 [ N4,0

However, for a clamped knot vector with t0 = t1 = . . . = tk < tk +1 we have


N0,0 (t) = N1,0 (t) = . . . = Nk 1,0 (t) = 0 for all t, and Nk ,0 (tk ) = 1.
The recursion formula for the B-spline basis functions yields
Ni,j (t) = 0 for all i, j with i + j = k 1 and for all t.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 162
Proof of Lemma 118
Applying the standard recursion for the B-spline basis functions at parameter tk ,
tk ti ti+k +1 tk
Ni,k (tk ) = Ni,k 1 (tk ) + Ni+1,k 1 (tk ),
ti+k ti ti+k +1 ti+1
for i = 0 (and subsequently for i = j and k j for j {1, . . . , k 1}) yields
tk t0 tk +1 tk
N0,k (tk ) = N0,k 1 (tk ) + N1,k 1 (tk )
tk t0 tk +1 t1
tk +1 tk
= N1,k 1 (tk ) = N1,k 1 (tk )
tk +1 tk
tk t1 tk +1 tk
= N1,k 2 (tk ) + N2,k 2 (tk )
tk t1 tk +1 t2
= N2,k 2 (tk ) = = Nk ,0 (tk )
= 1.

Hence, due to the Partition of Unity (Cor. 115), Ni,k (tk ) = 0 for i > 0 and we get
n
X
Ni,k (tk )pi = N0,k (tk )p0 = p0 .
i=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 163
Generation of Knot Vector
I Suppose that a B-spline curve over [0, 1] has n + 1 control points {p0 , p1 , . . . , pn }
and degree k .
I We need m + 1 knots, where m = n + k + 1.
I If the B-spline curve is clamped then we get

t0 = t1 = . . . = tk = 0 and tn+1 = tn+2 = . . . = tn+k +1 = 1.

I The remaining n k knots can be spaced uniformly or non-uniformly.


I For uniformly spaced internal knots the interval [0, 1] is divided into n k + 1
subintervals. In this case the knots are given as follows:

t0 = t1 = . . . = tk = 0

j
tk +j = for j = 1, 2, . . . , n k
nk +1

tn+1 = tn+2 = . . . = tn+k +1 = 1

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 164
Generation of Knot Vector
I Suppose that n = 6, i.e., that we have seven control points p0 , . . . , p6 and want to
construct a clamped cubic B-spline curve. (Hence, k = 3.)
I We have in total m + 1 = n + k + 2 = 6 + 3 + 2 = 11 knots and get
1 2 3
:= (0, 0, 0, 0, , , , 1, 1, 1, 1)
| {z } 4 4 4 | {z }
k +1=4 k +1=4

as uniform knot vector.


For {p0 , . . . , p6 } = { 00 , 0.2
  2 3 3 5
 7

I
2
, 3 , 2 , 0 , 0
, 1
} we get the following clamped,
cubic and C 2 -continuous B-spline curve:
p2
p1 t4 p3
t5
p6
t6
p0 p4 p5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 165
Properties of B-Spline Curves

Lemma 119
The lower the degree of a B-spline curve, the closer it follows its control polygon.

Sketch of Proof : The lower the degree, the fewer control points contribute to P(t).
For k = 1 it is simply the convex combination of pairs of control points.
I Clamped
n   uniform B-spline of degree 10 for a control polygon with 14 vertices:
1 1 3
 5 6 5 3 3 11 8 8 10 4 1o
1
, 3 , 5 , 5 , 4 , 2 , 2 , 1 , 1 , 3 , 5 , 6 , 7 , 5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 166
Properties of B-Spline Curves
Lemma 120 (Variation diminishing property )
If a straight line intersects the control polygon of a B-spline curve m times then it
intersects the actual B-spline curve at most m times.

Lemma 121 (Affine invariance)


Any B-spline representation is affinely invariant, i.e., given any affine map , the
image curve (P) of a B-spline curve P with control points p0 , p1 , . . . , pn has the
control points (p0 ), (p1 ), . . . , (pn ).

Proof : Consider an affine map : R2 R2 . Hence, (x) = A x + v , for some 2 2


matrix A, and x, v R2 . We get
n
! n
!
X X
(P(t)) = Ni,k (t)pi = A Ni,k (t)pi + v
i=0 i=0
n
X n
X n
X
= Ni,k (t)A pi + Ni,k (t)v = Ni,k (t)(A pi + v )
i=0 i=0 i=0
n
X
= Ni,k (t)(pi ).
i=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 167
Properties of B-Spline Curves

Lemma 122
Let P be a clamped B-spline curve of degree k over [0, 1] defined by k + 1 control
points with position vectors p0 , p1 , . . . , pk and the knot vector := (t0 , t1 , . . . , t2k +1 ),
for k N0 . Then P is a Bzier curve of degree k .

I Note: This implies 0 = t0 = t1 = . . . = tk and 1 = tk +1 = . . . = t2k = t2k +1 .


I Clamped (uniform)
n B-spline of degree 3 for knot vector (0, 0, 0, 0, 1, 1, 1, 1) and
   o
control polygon 00 , 13 , 33 , 40 :

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 168
Derivatives of B-Spline Curves

Lemma 123
Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn , and the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n. Then
n1
X
P 0 (t) = Ni+1,k 1 (t)qi for t [tk , tn+1 [,
i=0

where
k
qi := (pi+1 pi ) for i {0, 1, . . . , n 1}
ti+k +1 ti+1
and the knot vector remains unchanged.

Sketch of Proof : This is a consequence of Lem. 112 and some (lengthy) analysis.

I Since the first derivative of a B-spline curve is another B-spline curve, one can
apply this technique recursively to compute higher-order derivatives.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 169
Derivatives of B-Spline Curves

Lemma 124
Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the clamped knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N
and k N0 with k n. Then, for the new knot vector 0 := (t1 , t2 , . . . , tn+k 1 , tn+k ),
n1
X
P 0 (t) = Ni,k 1, 0 (t)qi for t [tk , tn+1 [,
i=0

where
k
qi := (pi+1 pi ) for i {0, 1, . . . , n 1}.
ti+k +1 ti+1

Sketch of Proof : One can show that Ni+1,k 1, (t) is equal to Ni,k 1, 0 (t) for all
t [tk , tn+1 [.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 170
Derivatives of B-Spline Curves

Corollary 125
A clamped B-spline curve is tangent to the first leg and the last leg of its control
polygon.

Sketch of Proof : Recall that, by Lem. 124, the first derivative of a clamped B-spline
curve P of degree k is a clamped B-spline curve of degree k 1 over essentially the
same knot vector but with new control points of the form
k
qi := (pi+1 pi ) for i {0, 1, . . . , n 1}.
ti+k +1 ti+1
Hence, by arguments similar to those used in the proof of Lem. 118, one can show
that P 0 (tk ) starts in q0 and, thus, the tangent of P in the start point P(tk ) is parallel to
p1 p0 .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 171
Strong Convex Hull Property

Lemma 126 (Strong convex hull property )


Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n. For i N with k i n, we have

P|[ti ,ti+1 [ CH({pik , pik +1 , . . . , pi1 , pi }).

Proof : Lemma 109 tells us that Nik ,k , Nik +1,k , . . . , Ni1,k , Ni,k are the only B-spline
basis functions that can be non-zero over [ti , ti+1 [, for k i n, while all other basis
functions are zero (Lem. 107). Together with Cor. 115 we get
n
X i
X
1= Nj,k (t) = Nj,k (t) for all t [ti , ti+1 [.
j=0 j=ik

Hence,
n
X i
X
P(t) = Nj,k (t)pj = Nj,k (t)pj for all t [ti , ti+1 [
j=0 j=ik

is a convex combination of pik , pik +1 , . . . , pi1 , pi .


c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 172
Strong Convex Hull Property

Lemma 126 (Strong convex hull property )


Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n. For i N with k i n, we have

P|[ti ,ti+1 [ CH({pik , pik +1 , . . . , pi1 , pi }).

p2

p1
p3

p6
p0 p4
p5
Second knot span of a cubic B-spline contained in CH({p1 , p2 , p3 , p4 }).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 173
Local Control and Modification

Lemma 127 (Local control)


Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n. Then the B-spline curve P restricted to [ti , ti+1 [ depends only on
the positions of pik , pik +1 , . . . , pi1 , pi .

Proof : By Lem. 109, and as in the proof of Lem. 126,


i
X
P|[ti ,ti+1 [ (t) = Nj,k (t)pj .
j=ik

Lemma 128 (Local modification scheme)


Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n. Then a modification of the position of pi changes P only in the
parameter interval [ti , ti+k +1 [, for i {0, 1, . . . , n}.

Proof : The Local Support Lemma 106 tells us that


Ni,k (t) = 0 if t
/ [ti , ti+k +1 [.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 174
Local Control and Modification
I Clamped uniform B-spline of degree three with knot vector
:= (0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 11, 11)
for a control
n  polygon with 14 vertices:
1 1
 3 5 6 5 3 3 11 8 8 10 4 o
1
1
, 3 , 5 , 5 , 4 , 2 , 2 , 1 , 1 , 3 , 5 , 6 , 7 , 5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 175
Local Control and Modification
I Clamped uniform B-spline of degree three with knot vector
:= (0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 11, 11)
for a control
n  polygon with 14 vertices:
1 1
 3 5 6 5 3 1 11 8 8 10 4 o
1
1
, 3 , 5 , 5 , 4 , 2 , 2 , 4 , 1 , 3 , 5 , 6 , 7 , 5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 175
Multiple Control Points

Lemma 129 (Multiple control points)


Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n.
1. If k control points pik +1 , pik +2 , . . . , pi coincide, i.e., if
pik +1 = pik +2 = . . . = pi then P contains pi and is tangent to the legs
pik pik +1 and pi pi+1 of the control polygon, for i N with k i < n.
2. If k control points pik +1 , pik +2 , . . . , pi are collinear then P touches a leg of
the control polygon, for i N with k i < n.
3. If k + 1 control points pik , pik +1 , . . . , pi are collinear then P coincides with a
leg of the control polygon, for i N with k < i < n.

Sketch of Proof : This is a consequence of Lemma 109 and of the strong convex hull
property (Lem. 126).
I Note that this implies that a degree-k B-spline P starts at p0 if
p0 = p1 = . . . = pk 1 .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 176
Multiple Control Points
Clamped cubic B-spline with control points
! ! ! ! ! !
2 0 4 8 8 6
, , , , ,
0 4 5 4 2 0
and uniform knot vector (0, 0, 0, 0, 1, 2, 3, 3, 3, 3):

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 177
Multiple Control Points
Clamped cubic B-spline with control points
! ! ! ! ! ! ! !
2 0 4 4 4 8 8 6
, , , , , , ,
0 4 5 5 5 4 2 0
and uniform knot vector (0, 0, 0, 0, 1, 2, 3, 4, 5, 5, 5, 5):

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 177
Multiple Control Points
Clamped cubic B-spline with control points
! ! ! ! ! ! !
2 0 4 6 8 8 6
, , , 9 , , ,
0 4 5 2
4 2 0
and uniform knot vector (0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4):

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 177
Multiple Control Points
Clamped cubic B-spline with control points
! ! ! ! ! ! ! !
2 0 4 5 7 8 8 6
, , , 19 , 17 , , ,
0 4 5 4 4
4 2 0
and uniform knot vector (0, 0, 0, 0, 1, 2, 3, 4, 5, 5, 5, 5):

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 177
Multiple Knots

Lemma 130 (Multiple knots)


Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n. Let i N with k + 1 i n k . If ti is a knot of multiplicity k ,
i.e., if ti = ti+1 = . . . = ti+k 1 then P(ti ) = pi1 and P is tangent to the legs pi2 pi1
and pi1 pi of the control polygon.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 178
Multiple Knots
I Clamped uniform B-spline of degree three for a control polygon with nine vertices:
( ! ! ! ! ! ! ! ! !)
1 0 0 2 4 6 8 8 9
, , , , , , , ,
0 0 2 3 0 3 2 0 0

Knot vector:
:= (0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 6, 6, 6)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 179
Multiple Knots
I Clamped uniform B-spline of degree three for a control polygon with nine vertices:
( ! ! ! ! ! ! ! ! !)
1 0 0 2 4 6 8 8 9
, , , , , , , ,
0 0 2 3 0 3 2 0 0

Knot vector:
:= (0, 0, 0, 0, 1, 2, 2, 2, 3, 4, 4, 4, 4)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 179
Motivation for de Boors Algorithm
I Can we express P(t) in terms of Ni,0 (t)?
I We exploit the recursive definition of Ni,k in order to determine P(t) in terms of
Ni,k 1 (t), recalling that t [tk , tn+1 [.
n n  
X X t ti ti+k +1 t
P(t) = Ni,k (t)pi = Ni,k 1 (t) + Ni+1,k 1 (t) pi
ti+k ti ti+k +1 ti+1
i=0 i=0
n n
X t ti X ti+k +1 t
= Ni,k 1 (t)pi + Ni+1,k 1 (t)pi
ti+k ti ti+k +1 ti+1
i=0 i=0
n
t t0 X t ti
= N0,k 1 (t)p0 + Ni,k 1 (t)pi +
tk t0 ti+k ti
i=1
n1
tn+k +1 t X ti+k +1 t
Nn+1,k 1 (t)pn + Ni+1,k 1 (t)pi
tn+k +1 tn+1 ti+k +1 ti+1
i=0
n n
?
X t ti X ti+k t
= Ni,k 1 (t)pi + Ni,k 1 (t)pi1
ti+k ti ti+k ti
i=1 i=1
n   n
X ti+k t t ti X
= Ni,k 1 (t) pi1 + pi =: Ni,k 1 (t)pi,1 (t)
ti+k ti ti+k ti
i=1 i=1

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 180
Motivation for de Boors Algorithm
I Equality at ? holds since each basis function Ni,k is non-zero only over [ti , ti+k +1 [
(Local Support Lem. 106):

N0,k 1, (t) = 0 for t


/ [t0 , tk [ and Nn+1,k 1, (t) = 0 for t
/ [tn+1 , tn+k +1 [
I We have
ti+k t t ti
pi,1 (t) := pi1 + pi for 1 i n,
ti+k ti ti+k ti
thus expressing P(t) in terms of basis functions of degree k 1 and modified
(parameter-dependent!) new control points.
I Repeating this process yields
n
X
P(t) = Ni,k 2 (t)pi,2 (t),
i=2

where
ti+k 1 t t ti
pi,2 (t) := pi1,1 (t) + pi,1 (t) for 2 i n.
ti+k 1 ti ti+k 1 ti

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 181
De Boors Algorithm

Theorem 131 (de Boors algorithm)


Let P be a B-spline curve of degree k with control points p0 , p1 , . . . , pn and knot
vector := (t0 , t1 , . . . , tn+k +1 ). If we define

pi if j = 0,
pi,j (t) :=
(1 i,j ) pi1,j1 (t) + i,j pi,j1 (t) if j > 0,

where
t ti
i,j := ,
ti+k +1j ti
then
n
X
P(t) = Ni,0 (t)pi,k (t) for t [tk , tn+1 [.
i=k

Corollary 132
Let P be a B-spline curve of degree k with control points p0 , p1 , . . . , pn and knot
vector := (t0 , t1 , . . . , tn+k +1 ). If t [ti , ti+1 [, for i {k , k + 1, . . . , n}, then
P(t) = pi,k (t).
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 182
Sample Run of de Boors Algorithm
I Clamped uniform B-spline of degree three for seven control points:
( ! ! ! ! ! ! !)
0 0 2 4 6 8 8
, , , , , ,
0 2 3 0 3 2 0

Knot vector with eleven knots: := (0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4).


I B-spline curve with pi,0 (0.7), with 0.7 [t3 , t4 [:
( ! ! ! ! ! ! !)
0 0 2 4 6 8 8
, , , , , ,
0 2 3 0 3 2 0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 183
Sample Run of de Boors Algorithm
I Clamped uniform B-spline of degree three for seven control points:
( ! ! ! ! ! ! !)
0 0 2 4 6 8 8
, , , , , ,
0 2 3 0 3 2 0

Knot vector with eleven knots: := (0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4).


I B-spline curve with pi,1 (0.7), with 0.7 [t3 , t4 [:
( ! ! !)
0. 0.7 2.4667
, ,
1.4 2.35 2.3

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 183
Sample Run of de Boors Algorithm
I Clamped uniform B-spline of degree three for seven control points:
( ! ! ! ! ! ! !)
0 0 2 4 6 8 8
, , , , , ,
0 2 3 0 3 2 0

Knot vector with eleven knots: := (0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4).


I B-spline curve with pi,2 (0.7), with 0.7 [t3 , t4 [:
( ! !)
0.49 1.3183
,
2.065 2.3325

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 183
Sample Run of de Boors Algorithm
I Clamped uniform B-spline of degree three for seven control points:
( ! ! ! ! ! ! !)
0 0 2 4 6 8 8
, , , , , ,
0 2 3 0 3 2 0

Knot vector with eleven knots: := (0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4).


I B-spline curve with pi,3 (0.7), with 0.7 [t3 , t4 [:
( !)
1.0698
= {P(0.7)}
2.2523

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 183
De Boors Algorithm for Subdividing a B-Spline Curve
I Clamped uniform B-spline of degree three for seven control points:
( ! ! ! ! ! ! !)
0 0 2 4 6 8 8
, , , , , ,
0 2 3 0 3 2 0

Knot vector with eleven knots: := (0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4).


p2,0 p4,0
p2,1 p3,2
p3,1
p1,0 p3,3 p5,0
p2,2
p1,1

p0,0 p3,0 p6,0

I New control polygons for t ? := 0.7:

(p0,0 , p1,1 , p2,2 , p3,3 ) and (p3,3 , p3,2 , p3,1 , p3,0 , p4,0 , p5,0 , p6,0 )
I New knot vectors for t ? := 0.7:

(0, 0, 0, 0, 0.7, 0.7, 0.7, 0.7) and (0.7, 0.7, 0.7, 0.7, 1, 2, 3, 4, 4, 4, 4)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 184
De Boors Algorithm for Subdividing a B-Spline Curve

Definition 133
Let P be a clamped B-spline curve of degree k defined by n + 1 control points with
position vectors p0 , p1 , . . . , pn and the clamped knot vector := (t0 , t1 , . . . , tn+k +1 ),
for n N and k N0 with k n. For some t ? [ti , ti+1 [, with i {k , . . . , n}, we
define two new knot vectors ? , ?? and two new control polygons P ? , P ?? as
follows:
If t ? 6= ti then m := i else m := i 1.

? := (t0 , t1 , . . . , tm , t ? , . . . , t ? ) and ?? := (t ? , . . . , t ? , tm+1 , . . . , tn+k +1 ),


| {z } | {z }
(k +1) times (k +1) times

P ? (t ? ) := (p0,0 (t ? ), p1,0 (t ? ), . . . , pmk ,0 (t ? ), p1,1 (t ? ), p2,2 (t ? ), . . . , pk ,k (t ? )),

P ?? (t ? ) := (pk ,k (t ? ), pk ,k 1 (t ? ), . . . , pk ,1 (t ? ), pm,0 (t ? ), pm+1,0 (t ? ), . . . , pn,0 (t ? )),


where the new control points pi,j (t ? ) are obtained by de Boors algorithm (Thm 133).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 185
De Boors Algorithm for Subdividing a B-Spline Curve

Lemma 134
Let P be a clamped B-spline curve of degree k defined by n + 1 control points with
position vectors p0 , p1 , . . . , pn and the clamped knot vector := (t0 , t1 , . . . , tn+k +1 ),
for n N and k N0 with k n. (Hence, t0 = t1 = . . . = tk < tk +1 and
tn < tn+1 = . . . = tn+k +1 .) For some t ? [ti , ti+1 [, with i {k , . . . , n}, we define two
new knot vectors ? , ?? and two new control polygons P ? , P ?? as in Def. 133.
Then we get two new B-spline curves P ? and P ?? of degree k with control polygon
P ? (P ?? , resp.) and knot vector ? ( ?? , resp.) that join in a tangent-continuous way
at point pkk (t ? ) = P(t ? ), such that

P ? = P|[tk ,t ? [ and P ?? = P|[t ? ,tn+1 [ .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 186
De Boors Algorithm for Splitting a B-Spline Curve into Bzier Segments

Corollary 135
Let P be a clamped B-spline curve of degree k defined by n + 1 control points with
position vectors p0 , p1 , . . . , pn and the clamped knot vector := (t0 , t1 , . . . , tn+k +1 ),
for n N and k N0 with k n. (Hence, t0 = t1 = . . . = tk < tk +1 and
tn < tn+1 = . . . = tn+k +1 .) Subdividing P at the knot values {tk +1 , tk +2 , . . . , tn1 , tn },
as outlined in Def. 133, splits P into n k + 1 Bzier curves of degree k .

Proof : Lemma 134 ensures that each of the resulting curves is a B-spline curve of
degree k , where the m-th curve is defined over [tk +m , tk +m+1 [, for
m {0, 1, . . . , n k }. Each curve has knot vectors of length 2k + 2, with start and
end knots of multiplicity k + 1 but no interior knots. By Lem. 122, each resulting
B-spline curve is a Bzier curve of degree k .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 187
De Boors Algorithm for Splitting a B-Spline Curve into Bzier Segments
I Clamped uniform B-spline of degree three for seven control points:
( ! ! ! ! ! ! !)
0 0 2 4 6 8 8
, , , , , ,
0 2 3 0 3 2 0

Knot vector with eleven knots: := (0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4).


I Third Bzier segment over [2, 3].

I Note that the number of knots has increased drasticallly!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 188
Knot Insertion
I Suppose that we would like to insert a new knot t ? [tj , tj+1 [, for some
j {k , k + 1, . . . , n}, into the knot vector

:= (t0 , t1 , . . . , tj , tj+1 , . . . , tn+k +1 ),

thus transforming into a knot vector

? := (t0 , t1 , . . . , tj , t ? , tj+1 , . . . , tn+k +1 ).

I The fundamental equality m = n + k + 1, with m + 1 denoting the number of


knots, tells us that we will have to either increase the number n of control points
by one or to increase the degree k of the curve by one.
I Since an increase of the degree would change the shape of the B-spline globally,
we opt for increasing the number of control points (and modifying some of them).
I How can we modify the control points such that the shape of the curve is
preserved?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 189
Knot Insertion

Lemma 136 (Boehm 1980)


Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N and
k N0 with k n. Let t ? [tj , tj+1 [, for some j {k , k + 1, . . . , n}, and define a
knot vector ? as ? := (t0 , t1 , . . . , tj , t ? , tj+1 , . . . , tn+k +1 ). Then we have
n
X n+1
X
P(t) = Ni,k , (t)pi = Ni,k , ? (t)pi? =: P ? (t) for all t [tk , tn+1 [
i=0 i=0

if, for 0 i n + 1,

pi if i j k
pi? := (1 i )pi1 + i pi if j k + 1 i j
pi1 if i j + 1

and
t ? ti
i := for i {j k + 1, . . . , j}.
ti+k ti

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 190
Knot Insertion
I Clamped
n uniform B-spline of degree three for thirteen control points:
o
1
 
1 3
 5
 
6 5
 3
 3
 11
 
8

8 10
 4
 
1
1 , 3 , 5 , 5 , 4 , 2 , 2 , 1 , 1 , 3 , 5 , 6 , 7 , 5
Knot vector with 17 knots: := (0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 11, 11).

I New fourteen control points for 18 knots


n? := (0, 0, 0, 0, 1, 2, 3, 4, 4.2, 5, 6, 7, 8, 9, 10, 11, 11, 11, 11):
1
 
1 3
 5
 
6 5.2667
 4.2
 3
 3
 11
 8
 8
 10
 
4
o
1
1 , 3 , 5 , 5 , 4 , 2.5333 , 2 , 1.9333 , 1 , 1 , 3 , 5 , 6 , 7 , 5

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 191
Knot Insertion and Deletion
I The so-called Oslo algorithm, developed by Cohen et al. [1980], is more general
than Boehms algorithm: It allows the insertion of several (possibly multiple) knots
into a knot vector. (It is also substantially more complex, though.)
I An algorithm for the removal of a knot is due to Tiller [1992]. However, as pointed
out by Tiller, knot removal and degree reduction result in an overspecified
problem which, in general, can only be solved within some tolerance.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 192
Closed B-Spline Curves

Lemma 137
Let P be a B-spline curve of degree k defined by n + 1 control points with position
vectors p0 , p1 , . . . , pn and the uniform knot vector := (t0 , t1 , . . . , tn+k +1 ), for n N
and k N0 with k n. If

p0 = pnk +1 , p1 = pnk +2 , . . . , pk 2 = pn1 , pk 1 = pn

then P is C k 1 at the joining point P(tk ) = P(tn+1 ).

Lemma 138
Let P be a B-spline curve of degree k defined by n + 2 control points with position
vectors p0 , p1 , . . . , pn , pn+1 and the (possibly non-uniform and periodic) knot vector
:= (t0 , t1 , . . . , tn+k +1 , tn+k +2 ), for n N and k N0 with k n. If

p0 = pn+1 and t0 = tn+1 , t1 = tn+2 , . . . , tk = tn+k +1 , tk +1 = tn+k +2

then P is C k 1 at the joining point P(t0 ) = P(tn+1 ).

I Hence, wrapping around k control points or k + 2 knots achieves C k 1 -continuity


at the joining point.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 193
Closed B-Spline Curves via Wrapping of Control Points
I Uniform
n B-spline of degree three for nine control
o points:
4
 
4

0 0
 12
 12
 4
 4
 
0
3 , 0 , 0 , 7 , 7 , 2 , 3 , 0 , 0
1
Knot vector with 13 knots: := (0, , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 1).
12 12 12 12 12 12 12 12 12 12 12

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 194
B-Spline Surfaces

Definition 139 (B-spline surface)


For n, m N and k 0 , k 00 N0 with k 0 n and k 00 m, consider a set of
(n + 1) (m + 1) control points with position vectors pi,j R3 for 0 i n and
0 j m, and let := (s0 , s1 , . . . , sn+k 0 +1 ) and := (t0 , t1 , . . . , tm+k 00 +1 ) be two
knot vectors. Then the B-spline surface relative to and with control net (pi,j )n,m i,j=0
is given by
n X
X m
S(s, t) := Ni,k 0 , (s)Nj,k 00 , (t)pi,j for s [sk 0 , sn+1 [, t [tk 00 , tm+1 [,
i=0 j=0

where Ni,k 0 , is the i-th B-spline basis function of degree k 0 relative to , and Nj,k 00 ,
is the j-th B-spline basis function of degree k 00 relative to .

I Hence, a B-spline surface is another example of a tensor-product surface.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 196
Sample B-Spline Surfaces

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 197
Properties of B-Spline Surfaces

Lemma 140 (Non-negativity )


With the setting of Def. 139, we have Ni,k 0 , (s)Nj,k 00 , (t) 0 for all (permissible)
i, j Z and k 0 , k 00 N0 , and all s, t R.

Lemma 141 (Partition of unity )


With the setting of Def. 139, we have
n X
X m
Ni,k 0 , (s)Nj,k 00 , (t) = 1
i=0 j=0

for all s [sk 0 , sn+1 [, t [tk 00 , tm+1 [.

Lemma 142 (Strong convex hull property )


With the setting of Def. 139, for i, j N with k 0 i n and k 00 j m we have

S|[si ,si+1 [[tj ,tj+1 [ CH({pl 0 ,l 00 : i k 0 l 0 i j k 00 l 00 j}).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 198
Properties of B-Spline Surfaces

Lemma 143 (Local control)


With the setting of Def. 139, for i, j N with k 0 i n and k 00 j m we have that

S|[si ,si+1 [[tj ,tj+1 [ depends only on {pl 0 ,l 00 : i k 0 l 0 i j k 00 l 00 j}.

Lemma 144 (Local modification scheme)


With the setting of Def. 139, a modification of the position of pi,j changes S only in
the parameter domain [si , si+k 0 +1 [[tj , tj+k 00 +1 [, for i {0, 1, . . . , n} and
j {0, 1, . . . , m}.

Lemma 145 (Affine invariance)


Any B-spline representation is affinely invariant, i.e., given any affine map , the
image surface (S) of a B-spline surface S with control points pi,j has the control
points (pi,j ).

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 199
Evaluation of a B-Spline Surface
I Five easy steps to calculate a point on a B-spline patch for (s, t)
1. Find the knot span in which s lies, i.e., find i such that s [si , si+1 [.
2. Evaluate the non-zero basis functions Nik 0 ,k 0 (s), . . . , Ni,k 0 (s).
3. Find the knot span in which t lies, i.e., find j such that t [tj , tj+1 [.
4. Evaluate the non-zero basis functions Njk 00 ,k 00 (t), . . . , Nj,k 00 (t).
5. Multiply Ni 0 ,k 0 (s) with Nj 0 ,k 00 (t) and with the control point pi 0 ,j 0 , for
i 0 {i k 0 , . . . , i} and j 0 {j k 00 , . . . , j}.
I Alternatively, one can apply an appropriate generalization of de Boors algorithm.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 200
Motivation
I Can we use a B-spline curve to represent a circular arc?
( ! ! ! ! ! ! ! ! !)
1 1 0 1 1 1 0 1 1
, , , , , , , ,
0 1 1 1 0 1 1 1 0

I uniform knots, degree 10


I close to a circle, but still no circle!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 202
Non-Uniform Rational B-Splines

Definition 146 (NURBS curve)


For n N and k N0 with k n, consider a set of n + 1 control points with position
vectors p0 , p1 , . . . , pn in the plane, and let := (t0 , t1 , . . . , tn+k +1 ) be a knot vector.
Then the (non-uniform) rational B-spline curve of degree k (and order k + 1)
relative to with control points p0 , p1 , . . . , pn is given by
Pn
Ni,k (t)wi pi
N (t) := Pi=0 n for t [tk , tn+1 [,
i=0 Ni,k (t)wi

where Ni,k is the i-th B-spline basis function of degree k relative to , with the
weights wi > 0 for all i {0, 1, . . . , n}.

I If all wi := 1 then we obtain the standard B-spline curve. (Recall the Partition of
Unity, Cor. 115.)
I Both the numerator and the denominator are (piecewise) polynomials of degree
k . Hence, N is a piecewise rational curve of degree k .
I In general, the weights wi are required to be positive; a zero weight effectively
turns off a control point, and can be used for so-called infinite control points
[Piegl 1987].

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 203
Geometric Interpretation of NURBS

u
I We resort to homogeneous coordinates: For w 6= 0, v are the
w
homogeneous coordinates of yx , and yx are the inhomogeneous coordinates of
 

u
v x = u and y = v .
 
w w
w

wi xi
For pi := xyi R2 , let piw := wi yi R3 , for all i {0, 1, . . . , n}.

I
i
wi
I Now consider
Pn
n
X i=0 Ni,k (t)(wi xi )
n
N w (t) := Ni,k (t) piw = P
P
i=0 Ni,k (t)(wi yi )
.
n
i=0 i=0 Ni,k (t)wi

I Dividing the first two components of N w by its third component equals the
projection of N w to the plane w = 1.
I Hence, a NURBS curve in Rd is the projection of a B-spline curve in Rd+1 and,
thus, it inherits properties of B-spline curves.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 204
Geometric Interpretation of NURBS

Projection onto z = 1
A NURBS curve in Rd is the projection of a B-spline curve in Rd+1

(w0 x0 , w0 y0 , w0 )
z
(w3 x3 , w3 y3 , w3 )

z=1
(x3 , y3 , 1)
(w1 x1 , w1 y1 , w1 )
(x0 , y0 , 1) (w2 x2 , w2 y2 , w2 )
y
(x1 , y1 , 1) (x2 , y2 , 1)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 205
Geometric Interpretation of NURBS
I Rational (inhomogeneous) parameterization of the unit circle in the plane:

1 t2
x(t) :=
1 + t2
2t
y (t) :=
1 + t2
I Parameterization of the unit circle in the plane in homogeneous coordinates:

u(t) := 1 t 2
v (t) := 2t
w(t) := 1 + t 2

I Note: A projection tends to increase rather than decrease continuity!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 206
NURBS Basis Functions

Definition 147 (NURBS basis function)


For k N0 , weights wj > 0 for all j {0, 1, . . . , n} and all (permissible) i, we define
the i-th NURBS basis function of degree k as
Ni,k (t) wi
Ri,k (t) := Pn .
j=0 Nj,k (t) wj

I We can re-write the equation for N (t) as


n
X
N (t) = Ri,k (t) pi for t [tk , tn+1 [.
i=0

I Since NURBS basis functions in Rd are given by the projection of B-spline basis
functions in Rd+1 , we may expect that the properties of B-spline basis functions
carry over to NURBS basis functions.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 207
Properties of NURBS Basis Functions

Lemma 148
For n N and k N0 with k n, let := (t0 , t1 , t2 , . . . , tn+k +1 ) be a knot vector.
Then the following properties hold for all (permissible) values of i N0 :
Non-negativity:
Ri,k (t) 0 for all real t.

Local support:
Ri,k (t) = 0 if t
/ [ti , ti+k +1 [.

Local influence:
Rj,k non-zero over [ti , ti+1 [ j {i k , i k + 1, . . . , i}.

Partition of unity: n
X
Rj,k (t) = 1 for all t [tk , tn+1 [.
j=0

Continuity:
All NURBS basis functions of degree k are k r times continuously
differentiable at a knot of multiplicity r , and k 1 times continuously
differentiable everywhere else.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 208
Properties of NURBS Curves

Lemma 149
For n N and k N0 with k n, consider a set of n + 1 control points with position
vectors p0 , p1 , . . . , pn in the plane, and let := (t0 , t1 , . . . , tn+k +1 ) be a knot vector.
Then the following properties hold:
Clamped interpolation: If is clamped then the NURBS curve N starts in p0 and
ends in pn .
Variation diminishing property: If a straight line intersects the control polygon of
N m times then it intersects N at most m times.
Strong convex hull property: For i N with k i n, we have

N |[ti ,ti+1 [ CH({pik , pik +1 , . . . , pi1 , pi }).

Local control: The NURBS curve N restricted to [ti , ti+1 [ depends only on the
positions of pik , pik +1 , . . . , pi1 , pi .
Local modification scheme: A modification of the position of pi changes N only
in the parameter interval [ti , ti+k +1 [, for i {0, 1, . . . , n}.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 209
Properties of NURBS Curves

Lemma 150 (Projective invariance)


Any NURBS curve is projectively invariant, i.e., given any projective transformation
, the image curve (N ) of a NURBS curve N with control points p0 , p1 , . . . , pn has
the control points (p0 ), (p1 ), . . . , (pn ).

Lemma 151
For n N and k N0 with k n, consider a set of n + 1 control points with position
vectors p0 , p1 , . . . , pn in the plane, and let := (t0 , t1 , . . . , tn+k +1 ) be a knot vector
and w0 , w1 , . . . , wn be weights. Then the following properties hold for all
i {0, 1, . . . , n}:
1. The weight wi effects only the knot span [ti , ti+k +1 [.
2. If wi decreases (relative to the other weights) then the NURBS curve is pushed
away from pi .
3. If wi = 0 then pi does not contribute to the NURBS curve.
4. If wi increases (relative to the other weights) then the NURBS curve is pulled
towards pi .

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 210
Sample NURBS Curve
I Clamped uniform rational B-spline of degree three for a control polygon with nine
vertices:
( ! ! ! ! ! ! ! ! !)
1 0 0 2 4 6 8 8 9
, , , , , , , ,
0 0 2 3 0 3 2 0 0
Knot vector:
:= (0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 6, 6, 6)
Weights:
(1, 1, 1, 1, 1, 1, 1)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 211
Sample NURBS Curve
I Clamped uniform rational B-spline of degree three for a control polygon with nine
vertices:
( ! ! ! ! ! ! ! ! !)
1 0 0 2 4 6 8 8 9
, , , , , , , ,
0 0 2 3 0 3 2 0 0
Knot vector:
:= (0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 6, 6, 6)
Weights:
(1, 1, 1, 10, 1, 1, 1)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 211
Sample NURBS Curve
I Clamped uniform rational B-spline of degree three for a control polygon with nine
vertices:
( ! ! ! ! ! ! ! ! !)
1 0 0 2 4 6 8 8 9
, , , , , , , ,
0 0 2 3 0 3 2 0 0
Knot vector:
:= (0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 6, 6, 6)
Weights:
(1, 1, 1, 0.1, 1, 1, 1)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 211
Conics Modeled by NURBS
I NURBS can represent all conic curves (circle, ellipse, parabola, hyperbola)
exactly.
I Conics are quadratic curves.
I Hence, consider three control points p0 , p1 , p2 and the following quadratic
NURBS curve
P2
i=0 Ni,2 (t) wi pi
N2 (t) := P 2
with := (0, 0, 0, 1, 1, 1),
i=0 Ni,2 (t) wi

i.e., a rational Bzier curve of degree two over [0, 1].


I In expanded form we get

(1 t 2 )w0 p0 + 2t(1 t)w1 p1 + t 2 w2 p2


N2 (t) = .
(1 t 2 )w0 + 2t(1 t)w1 + t 2 w2

I Can we come up with conditions for w0 , w1 , w2 that allow to characterize the type
of curve represented by N2 ?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 212
Conics Modeled by NURBS

Lemma 152
The conic shape factor, , determines the type of conic represented by N2 :

<1 . . . N2 is an elliptic curve,
w12
:= =1 . . . N2 is a parabolic curve,
w0 w2
>1 . . . N2 is a hyperbolic curve.

I Clamped uniform rational B-spline N2 of


degree two with three control vertices
( ! ! !)
1 1 0
, ,
0 1 1
and knots

:= (0, 0, 0, 1, 1, 1)

and weights:
(1, 1/10, 1), hence < 1.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 213
Conics Modeled by NURBS

Lemma 153
The conic shape factor, , determines the type of conic represented by N2 :

<1 . . . N2 is an elliptic curve,
w12
:= =1 . . . N2 is a parabolic curve,
w0 w2
>1 . . . N2 is a hyperbolic curve.

I Clamped uniform rational B-spline N2 of


degree two with three control vertices
( ! ! !)
1 1 0
, ,
0 1 1
and knots

:= (0, 0, 0, 1, 1, 1)

and weights:
(1, 1, 1), hence = 1.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 213
Conics Modeled by NURBS

Lemma 154
The conic shape factor, , determines the type of conic represented by N2 :

<1 . . . N2 is an elliptic curve,
w12
:= =1 . . . N2 is a parabolic curve,
w0 w2
>1 . . . N2 is a hyperbolic curve.

I Clamped uniform rational B-spline N2 of


degree two with three control vertices
( ! ! !)
1 1 0
, ,
0 1 1
and knots

:= (0, 0, 0, 1, 1, 1)

and weights:
(1, 5, 1), hence > 1.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 213
Conics Modeled by NURBS

Lemma 155
The quadratic NURBS curve N2 represents a circular arc
I if the control points p0 , p1 , p2 form an isosceles triangle, and
I if the weights are set as follows:
kp0 p2 k
w0 := 1 w1 := w2 := 1
2 kp0 p1 k

I The weight w1 is related to the central angle


subtended by the arc: w1 = cos(/2).
I We can join four quarter-circle NURBS to form
a full circle.
I In this case, the isosceles triangles defining
the quarter circles need to add up to a square.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 214
Conics Modeled by NURBS
I It is also possible to construct a circle by a single NURBS curve.
( ! ! ! ! ! ! ! ! !)
1 1 0 1 1 1 0 1 1
, , , , , , , ,
0 1 1 1 0 1 1 1 0

Knots:
3 3
(0, 0, 0, , , , , , , 2, 2, 2)
2 2 2 2
Weights:
1 1 1 1
(1, , 1, , 1, , 1, , 1)
2 2 2 2

I Note: The positioning of the control


points ensures that the first derivative
is continuous, despite of double knots.
m
I Note: N (t) 6= (sin t, cos t) for t 6= 4
.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 215
Conics Modeled by NURBS
I Applying an affine transformation to the control points yields an ellipse.
( ! ! ! ! ! ! ! ! !)
2 2 0 2 2 2 0 2 2
, , , , , , , ,
0 1 1 1 0 1 1 1 0
1 1 1 1
Knots: (0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4) Weights: (1, , 1, , 1, , 1, , 1)
2 2 2 2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 216
Sample NURBS Surface

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 217
Approximation and Interpolation
Distance Measures
Interpolation of Point Data
Bernstein Approximation of Functions
Approximation of Polygonal Profiles

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 218
Hausdorff Distance
I Let A, B be two subsets of a metric space X and let d(p, q) denote the distance
between two elements p, q X . E.g., take Rn and the (standard) Euclidean
distance.
I How can we measure how similar A and B are?
I This is a frequently asked question in image processing, solid modeling,
computer graphics and computational geometry.
I Note that the classical minimin function
 
D(A, B) := inf inf d(a, b)
aA bB

is a very poor measure of similarity between A and B: One can easily get
D(A, B) = 0 although A and B need not be similar at all, according to any natural
human interpretation of similarity.
I So, can we do any better?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 220
Hausdorff Distance

Definition 156 (Hausdorff distance)


Let A, B be two non-empty subsets of a metric space X and let d be any metric on
X . The directed Hausdorff distance, h(A, B), from A to B is a maximin function,
defined as
 
h(A, B) := sup inf d(a, b) .
aA bB

The (symmetric) Hausdorff distance, H(A, B), between A and B is defined as

H(A, B) := max {h(A, B), h(B, A)} .

I Introduced by Felix Hausdorff in 1914.


I If both A and B are bounded then H(A, B) is guaranteed to be finite.
I For compact sets we can replace inf by min and sup by max.
I The function H defines a metric on the set of all non-empty compact subsets of a
metric space X .
I For sets of n points in R2 , the Hausdorff distance can be computed in time
O(n log n), using a Voronoi-based approach.
I A common variation is the Hausdorff distance under translation.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 221
Frchet Distance
I The Hausdorff distance does not capture any form of orientation or continuity, as
we might be interested in when matching curves or surfaces.
Definition 157 (Frchet distance)
Consider a closed interval I R and two curves , : I Rn . The Frchet distance
between (I) and (I) is defined as

Fr(, ) := inf max k((t)) ( (t))k ,


, tI

where , : I I range over all continuous and monotonously increasing functions


that map I to I such that (I) = I and (I) = I.

I Popular interpretation [Alt&Godau 1995]: Suppose that a person is walking a


dog. Assume the person is walking on one curve and the dog on another curve.
Both can adjust their speeds but are not allowed to move backwards.
I We can think of the parameter t as time: Then ((t)) is the position of the
person and ( (t)) is the position of the dog at time t. The length of the leash
between them at time t is the distance between ((t)) and ( (t)).
I Then the Frchet distance of the two curves is the minimum leash length
necessary to keep the person and the dog connected.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 222
Frchet Distance
I Note that we do not demand strict monotonicity for either or .
I While efficient algorithms are known for computing the Frchet distance of
polygonal curves, the same problem for triangulated surfaces is N P-hard.
I However, a variant, the so-called weak Frchet distance, can be computed in
polynomial time [Alt&Buchin 2010].

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 223
Interpolation Versus Approximation
I For m N0 , we are given m + 1 points q0 , q1 , . . . , qm Rn , possibly with
matching parameter values u0 < u1 < . . . < um .

I For an interpolation of q0 , q1 , . . . , qm I For an approximation of q0 , q1 , . . . , qm


we seek a curve C such that either we seek a curve C such that the
I C(x ) = q for arbitrary x R, for
i i i
distance between C and
all i {0, 1, . . . , m}, or q0 , q1 , . . . , qm is smaller than a
I C(u ) = q for all
i i
user-specified threshold relative to
i {0, 1, . . . , m}. some distance measure.

C C

u u
I Similarly for approximation/interpolation by a surface rather than curve.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 225
Lagrange Interpolation

Definition 158 (Lagrange polynomial)


For m N, consider m + 1 parameter values u0 < u1 < . . . < um and let
i {0, 1, . . . , m}. Then the i-th Lagrange polynomial of degree m is defined as
m
Y u uj
Li,m (u) := .
ui uj
j=0,i6=j

Definition 159 (Lagrange interpolation)


For m N, consider m + 1 parameter values u0 < u1 < . . . < um and m + 1 data
points q0 , q1 , . . . , qm . Then the Lagrange interpolation of q0 , q1 , . . . , qm is given by
m
X
L(u) := Li,m (u)qi .
i=0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 226
Lagrange Interpolation

Lemma 160
For m N, let L be defined for m + 1 parameter values u0 < u1 < . . . < um and
m + 1 data points q0 , q1 , . . . , qm , as given in Def. 159. Then L(uj ) = qj for all
j {0, 1, . . . , m}.

Proof : For all i {0, 1, . . . , m}, we have



0 if i 6= j,
Li,m (uj ) = ij =
1 if i = j.
Hence,
m
X
L(uj ) = Li,m (uj )qi = qj .
i=0

Corollary 161
For m N, the Lagrange polynomials L0,m , L1,m , . . . , Lm,m form a basis of the vector
space of all polynomials of degree at most m.

Sketch of Proof : Recall that exactly one polynomial of degree m interpolates m + 1


data points.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 227
Limits of Lagrange Interpolation
I Sampling of a function f and subsequent Lagrange interpolation may yield an
extremely poor approximation of f even if f is continuously differentiable.
1
I C. Runge: Consider f (x) := 1+x 2 and n + 1 uniform samples within [5, 5], with
n := 20.

1.0

0.5

-4 -2 2 4

-0.5

-1.0

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 228
B-Spline Interpolation
I Let k N0 and suppose that we are looking for n + 1 control points p0 , p1 , . . . , pn
and a knot vector := (t0 , t1 , . . . , tn+k +1 ) such that the B-spline curve B of degree
k defined by p0 , p1 , . . . , pn and interpolates q0 , q1 , . . . , qm , with B(ui ) = qi for all
i {0, 1, . . . , m} and some given u0 < u1 < . . . < um .
I If n = m, then we get the following system of equations:
N0,k (u0 ) Nn,k (u0 )

p0 q0
.. .. . .
.. = ..

. .
N0,k (un ) Nn,k (un ) pn qn
| {z } | {z } | {z }
=:N =:p =:q

I Hence, the interpolation problem can be solved if the (quadratic) collocation


matrix N is invertible.
Lemma 162 (Schnberg-Whitney )
The collocation matrix N is invertible if and only if if all its diagonal elements are
non-zero, i.e., if and only if ti ui < ti+k +1 , for all i {0, 1, . . . , n}.

I The matrix N is a sparse band matrix without negative elements. (Recall the
Local Support Lem. 106.)
I Fast and numerically reliable algorithms exist for computing the inverse of N.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 229
B-Spline Interpolation
I Most applications do not require specific parameter values ui .
I In such a case, one can fix the knots ti , and choose ui as follows
(Greville-abscissae):
k
1X
ui := ti+j for all i {0, 1, . . . , n}.
k
j=1

I Note that ti and ti+k +1 do not enter the definition of ui .


I Of course,
1
ti ti+1 (ti+1 + + ti+k ) ti+k ti+k +1 ,
k
thus meeting the Schnberg-Whitney condition of Lem. 162. Equality would only
occur if an inner knot has multiplicity k + 1. (But then the B-spline would be
discontinuous!)

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 230
Effects of Parameters and Knots
I Since a B-spline has continuous speed and acceleration (for k 3), it is obvious
that the parameter values ui should bear a meaningful relation to the distances
between the data points. Otherwise, overshooting is bound to occur!
I Consider

u0 := 0 and ui+1 := ui + i for all i {1, . . . , m 1},

with

i := kqi qi1 kp for some p [0, 1] and all i {1, . . . , m 1}.


I These parameter values are known as uniform if p = 0, centripetal if p = 21 , and
chordal if p = 1.
I Suitable knots that meet the Schnberg-Whitney conditions (Lem. 162) are
defined as follows:
1
ti := (uik + uik +1 + . . . + ui1 )
k

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 231
B-Spline Approximation
I If m > n, i.e., if there are more data points than control points, then the linear
system Np = q is over-determined and a solution need not exist.
I One popular option is a least-squares fit, which is achieved if

NT Np = NT q.
I Hence, if NT N is invertible then we get

p = (NT N)1 NT q.

I An extension of the Schnberg-Whitney Lem. 162 tells us that the matrix NT N is


invertible exactly if the Schnberg-Whitney conditions are met:
Lemma 163
The matrix NT N is invertible if and only if ti ui < ti+k +1 , for all i {0, 1, . . . , n}.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 232
Natural-Neighbor Interpolation
I Problem studied:
I Given: A set S of m + 1 sites p , p , . . . , pm R2 with associated (scalar or
0 1
vector-valued) data q0 , q1 , . . . , qm , and q CH(S).
I Sought: An estimate f (q) of the data at q, obtained by interpolation of

q0 , . . . , qm .

Natural-neighbor interpolation (NNI)


[Sibson 1981]: Use ratios of Voronoi areas
as weights i (q) in the interpolation:
m
X
f (q) := qi i (q).
i=0
q

Natural-neighbor extrapolation
[Bobach et al. 2009]: NNI outside of convex
hull.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 233
Natural-Neighbor Interpolation: Voronoi Diagram
I Consider a set S of m + 1 sites p0 , p1 , . . . , pm R2 .
I The Voronoi region VR(pi , S) of pi S relative to S is the set of all points of R
which are closer to pi than to any other point of S \ {pi }.
I Similarly for some other pj S.
I The Voronoi diagram VD(S) is given by the union of all boundaries of all Voronoi
regions of points of S.

Incremental Construction
The Voronoi diagram VD(S {q}) can be
obtained incrementally from VD(S).

Second-order Voronoi Region VR(q, pi, S 0) pi


Let S 0 := S {q}. The common
intersection of VR(pi , S) and VR(q, S 0 )
corresponds to the second-order Voronoi q
region VR(q, pi , S 0 ) of q and pi relative to
S 0 : It is the set of points which are closer to
q and pi than to any other point of
S 0 \ {pi , q}.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 234
Natural-Neighbor Interpolation

Definition 164 (NNI)


For a set S of m + 1 sites Theorem 165
p0 , p1 , . . . , pm R2 with associated Sibsons NNI interpolant is
(scalar or vector-valued) data I C 0 if q S,
q0 , q1 , . . . , qm , and q CH(S), I C 1 if q lies on a Delaunay
m
X circle of S, and
f (q) := qi i (q) I C otherwise.
i=1

gives the interpolated data for q obtained


by natural-neighbor interpolation (NNI),
with
|VR(q, pi , S 0 )|
i (q) := , VR(q, pi, S 0) pi
|VR(q, S 0 )|

where S 0 := S {q} and |VR(q, S 0 )|


denotes the area of the Voronoi region of q
q within S 0 , and |VR(q, pi , S 0 )|
corresponds to the area of the
second-order Voronoi region of q and pi .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 235
Bernstein Polynomials

Definition 166 (Bernstein polynomial)


A Bernstein polynomial of degree n is a linear combination of Bernstein basis
polynomials of degree n:
n
X
Bn (x) := i Bi,n (x), with 0 , 1 , . . . , n R.
i=0

I Hence, every polynomial (in power basis) can be seen as a Bernstein polynomial,
albeit with unknown scalars for the linear combination.
I Can we select i such that a decent approximation of a user-specified function is
achieved?

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 237
Bernstein Approximation

Definition 167 (Bernstein approximation)


Consider a continuous function f : [0, 1] R. The Bernstein approximation with
degree n of f is defined as
n  
X i
Bn,f (x) := f Bi,n (x).
n
i=0

I Hence, a Bernstein approximation is given by a Bernstein polynomial, with


weights i := f ni .
Theorem 168 (Weierstrass 1885, Bernstein 1911)
The Bernstein approximation Bn,f converges uniformly to the continuous function f
on the interval [0, 1]. That is, given a tolerance > 0, there exists n N such that

|f (x) Bn,f (x)| for all x [0, 1].

ta
I Since x := ba maps t [a, b] to x [0, 1], this approximation theorem extends
to continuous functions f : [a, b] R.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 238
Sample Bernstein Approximation
I Sample Bernstein approximation of a continuous function:
1
f : [0, 1] R f (x) :=
1 + (10x 5)2
1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

Degree 2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 239
Sample Bernstein Approximation
I Sample Bernstein approximation of a continuous function:
1
f : [0, 1] R f (x) :=
1 + (10x 5)2
1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

Degree 128

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 239
Sample Bernstein Approximation
I Sample Bernstein approximation of a continuous function:
1  
f : [0, 1] R f (x) := sin (x) + sin 6x + x 2
5

1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

Degree 2

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 240
Sample Bernstein Approximation
I Sample Bernstein approximation of a continuous function:
1  
f : [0, 1] R f (x) := sin (x) + sin 6x + x 2
5

1.0

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0

Degree 256

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 240
Approximation of Polygonal Profiles

Informal problem statement


I For a set of planar (polygonal) profiles P
I and an approximation threshold given,
I compute a smooth approximation such that the input topology is maintained.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 242
Sample Real-World Application: Tool-Path Generation
I Approximation of tool paths: Asymmetric tolerances may be required!
I In the example: 6 648 input line segments versus 252 circular arcs.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 243
Sample Real-World Application: Conversion of Scanned Data
I Scanned data tends to be noisy.
I In the example: 526 489 segments
(within 1 827 input polygons) versus
42 222 circular arcs or
14 462 cubic B-splines.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 244
Sample Real-World Application: Recovering PCB Data
I Huge(!) data sets; maintaining the input topology is imperative.
I In the (toy) example: 81 984 input line segments versus 1 000 output line
segments and 9 791 circular arcs.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 245
Specifying a Tolerance
I Intuitively, for an input profile P we
seek a tolerance zone, T Z(P, dl , dr ),
of P with left tolerance dl and right
tolerance dr .

I Non-trivial tolerances classified as


dl
I symmetric if d = d > 0,
l r dr
I asymmetric if d < 0 d or d 0 < d , and
l r l r
I one-sided if d < d < 0 or 0 < d < .
l r l r

asymmetric with dl < 0 < dr one-sided with 0 < dl < dr

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 246
Specifying a Tolerance
I It seems natural to pre-compute T Z(P, dl , dr ) prior to approximation.
I But: Individual tolerance zones of the input profiles may intersect arbitrarily!

dr
dl
dl
dr

I Hence, we need to compute the tolerance zones for all profiles P of the input P
at once!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 247
Cone of Influence

Definition 169 (Cone of influence)


The cone of influence, CI(s), of
I a straight-line segment s is the closure of the strip bounded by the normals
through its endpoints;
I a circular arc s is the closure of the cone bounded by the pair of rays
originating in the arcs center and extending through its endpoints;
I a point s is the entire plane.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 248
Signed Distance

Definition 170 (Signed distance)


We restrict our attention to the cone of influence of a site. Then, the signed
distance, ds (s, p), of a point p CI(s)
I to an oriented straight-line segment or circular arc s of P is given by the
standard (Euclidean) distance of p to s, multiplied by 1 if p is on the left side
of the supporting line or circle of s,
I to a vertex s of P we take the standard distance between p and s, and multiply
it by 1 if the ray from s to p is locally on the left side of s1 and s2 , where s1
and s2 are the sites of P that share s as a common vertex.

p s s p
s
| {z } p | {z }
s2 ds (s, p) > 0
ds (s, p) < 0 | {z }
ds (s, p) > 0 s1

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 249
Tolerance Zone

Definition 171 (Tolerance zone)


The tolerance zone of a site s of P is defined as

T Z site (s, P, dl , dr ) := {p VR(P, s) : dl < ds (s, p) < dr }.

The tolerance zone of P is defined as the union of all tolerance zones of all sites:
[
T Z(P, dl , dr ) := T Z site (s, P, dl , dr ) .
sP

dr
dl dr

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 250
Problem Statement
Given: Input
I Set P of (open or closed)

polygonal profiles that do


not intersect pairwise;
I Left approximation

tolerance dl and right


approximation tolerance
dr , with dl < dr .
Compute: Approximation A of P such that

I A consists of Gk curves,
for some k N,
I A T Z(P, dl , dr ),
I P T Z(A, dr , dl ) if
requested by user,
I all curves of A are simple
and pairwise disjoint,
I topology of A matches
topology of P.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 251
Tolerance Zone and Distance Measures
I Assume dl = dr > 0. We have

A T Z(P, dr , dr ) P T Z(A, dr , dr ) = H(A, P) dr ,

where H(A, P) denotes the Hausdorff distance between A and P.


I Assume dl = dr > 0. If each approximation curve A A is monotone relative
to its corresponding input curve P P, then

A T Z(P, dr , dr ) P T Z(A, dr , dr ) = Fr(A, P) dr ,

where Fr(A, P) denotes the Frchet distance between A and P, for each A A
and corresponding P P.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 252
Tolerance Zone and Distance Measures
I Omitting the second condition P T Z(A, dr , dl ) makes a difference!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 253
VD-Based Computation of the Tolerance Zone
I [Held&Heimlich 2008; Held&Kaaser 2014] use the Voronoi diagram of the input
to compute the boundary of the tolerance zone.

I Tolerance zone computation for an input profile:


1. Collect all nodes of Voronoi cells left of the profile.
2. Skip nodes that are further away than dl from the profile.
3. Remove trees within the tolerance zone and add spikes.
4. Repeat this procedure for the right side of the profile w.r.t. dr .

dl
dr

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 254
Offset Spikes
I Offset spikes ensure that the directed Hausdorff distance from the input to the
approximation curve does not exceed the user-specified maximum tolerance.
I Spikes are formed by portions of the Voronoi diagram; they can be computed in
linear time.

dl dl
d d > |dl |

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 255
Circular Biarcs

Definition 172 (Circular biarc)


Given are two points ps and pe together with two tangents ts and te . The (circular)
biarc between ps and pe consists of two circular arcs a1 and a2 such that
1. Arc a1 runs from ps to a joint pj ; arc a2 runs from pj to pe ;
2. Tangent vector of a1 in ps is aligned with ts ; tangent vector of a2 in pe is aligned
with te ;
3. The arcs a1 and a2 are G1 -continuous at the joint.

ts c2
a1
pj

ps a2
c1 te
pe

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 256
Circular Biarcs
I The joint pj is not uniquely determined.
Lemma 173
Consider two points ps and pe together with two tangents ts and te . Then all
possible joints for the biarcs defined by ps , pe , ts , te lie on a circle.

ts c2
a1
pj

ps a2
c1 te
pe

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 257
Approximation Nodes
I Which points and tangents shall be used for the approximation?
I Note: Input vertices
I do not lie in the tolerance zone for one-sided tolerances, and

I may be far away from good approximation curves for asymmetric

tolerances or if P T Z(A, dr , dl ) is not required!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 258
Approximation Nodes
1. [Held&Heimlich 2008] compute Voronoi diagram inside of the tolerance zone.
2. Place approximation nodes (a-nodes) on medial axis of the boundaries of the
components of the tolerance zone; tangents according to [Meek&Walton 1992]:
(ai ai1 )/||ai ai1 || + (ai+1 ai )/||ai+1 ai ||.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 259
Doubling-and-Bisection Heuristic for Biarc Approximation
I [Eibl&Held 2005] Doubling-and-bisection heuristic for finding maximal biarcs.
I Suppose we are to start in a-node a1 , with a-nodes numbered consecutively.
I Doubling: Successively try k := 1, 2, 3, . . . and check whether a valid biarc exists
(within the tolerance zone) between a1 and a2k .
I Bisection: If biarc to a2k is valid and biarc to a2k +1 is not valid then apply bisection
between a-node indices 2k and 2k +1 .
I Validity check for a biarc can be restricted to a strip within the tolerance band!

Theorem 174 (Held&Heimlich 2008)


Let n denote the number of vertices of a set P of polygonal profiles. Then a G1
biarc approximation within an (asymmetric) user-specified tolerance that preserves
the topology of P can be computed in O(n log n) time.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 260
Sample Biarc Approximation

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 263
Sample Biarc Approximation

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 264
Theoretical Results on Biarc Approximation

Theorem 175 (Drysdale&Rote&Sturm 2008)


Let n denote the number of vertices of one open polygon P, and assume that a
tolerance zone together with a-nodes are given. Then a G1 biarc approximation of
P that uses the minimum number of biarcs (relative to the a-nodes given) can be
computed in O(n2 log n) time.

Theorem 176 (Maier 2010)


Let n denote the number of vertices of one open polygon P, and assume that a
tolerance zone is given. Then a G1 biarc approximation of P that uses the minimum
number of biarcs can be computed in O(n2 ) time.

Theorem 177 (Maier&Pisinger 2013)


Let n denote the number of vertices of one closed polygon P, and assume that a
tolerance zone is given. Then a G1 biarc approximation of P that uses the minimum
number of biarcs can be computed in O(n3 ) time.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 265
Uniform Cubic B-Spline Approximation
I Since consecutive B-spline segments share a common set of control vertices
rather than only one a-node, there is no obvious way how a greedy scheme is
adapted to support a B-spline approximation.
I [Held&Kaaser 2014]: Recursive subdivision heuristic for finding maximal uniform
cubic B-splines.
I For every profile of P, compute an initial B-spline curve that consists of a small
number of segments.
I This initial approximation curve is then refined by subsequently adding a-nodes
as new control vertices until an approximation curve that fits through the
tolerance zone is obtained.

Theorem 178 (Held&Kaaser 2014)


Let n denote the number of vertices of a set P of polygonal profiles. Then a C 2
approximation by uniform cubic B-splines within an (asymmetric) user-specified
tolerance that preserves the topology of P can be computed in O(n log n) time.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 266
B-Spline Intersection Checking
I Use de Boors algorithm to subdivide a spline segment, and recurse on the two
halves. If the maximum intersection tolerance is reached then report an
intersection.
I One may have to check one B-spline segment ucbs for intersection with several
straight-line segments of the boundary of the tolerance zone.
I Recall that the B-spline subdivision follows a regular pattern.
I Hence, one might end up computing the same control vertices over and over
again.
I One can save computational time by storing the control vertices in a binary tree
T , where each node of T corresponds to one subdivision.
I During an intersection check with a line segment one starts at the root of T

and descends T in the same way as one recurses on portions of ucbs.


I If a particular intersection check requires a subdivision whose corresponding

control vertices are not stored in T then these vertices are computed and
stored.

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 268
Sample Approximation by Uniform Cubic B-Splines

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 269
Sample Approximation by Uniform Cubic B-Splines

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 270
Shortcomings of VD-Based Tolerance Zones
I The Voronoi diagram allows to filter noisy input without preprocessing, and the
tolerance zones allow to assert important properties of the approximation, but
VD-based tolerance zones need not support optimum approximations!

dl
dr dr
dl

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 271
Shortcomings of A-Nodes
I A-nodes are a convenient means for obtaining control points for B-splines or
support for biarcs, but an inappropriate placement of the a-nodes may cause the
number of approximation primitives to sky-rocket!

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 272
The End!
I hope that you enjoyed this course, and I wish you all the best for your future studies.

UNIVERSITAT SALZBURG
Computational Geometry and Applications Lab

c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2016/17) 273

You might also like