Академический Документы
Профессиональный Документы
Культура Документы
(WS 2018/19)
Martin Held
FB Computerwissenschaften
Universität Salzburg
A-5020 Salzburg, Austria
held@cosy.sbg.ac.at
UNIVERSITÄT SALZBURG
Computational Geometry and Applications Lab
Personalia
Instructor (VO+PS):
M. Held.
Email:
held@cs.sbg.ac.at.
Base-URL:
https://www.cosy.sbg.ac.at/˜held.
Office:
Universität 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 2018/19) 2/289
Formalia
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 3/289
Electronic Slides and Online Material
In addition to these slides, you are encouraged to consult the WWW home-page of
this lecture:
https://www.cosy.sbg.ac.at/˜held/teaching/geom_mod/geom_mod.html.
In
particular, this WWW page contains up-to-date information on the course, plus links to
online notes, slides and (possibly) sample code.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 4/289
A Few Words of Warning
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 5/289
Acknowledgments
A small portion of these slides is based on notes and slides originally prepared by
students — most notably Dominik Kaaser, Kamran Safdar, and Marko Šulejić — on
topics related to geometric modeling. I would like to express my thankfulness to all of
them for their help. This revision and extension was carried out by myself, and I am
responsible for all errors.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 6/289
Legal Fine Print and Disclaimer
To the best of my knowledge, these slides do not violate or infringe upon somebody
else’s 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 grants you the
right to download and print the slides for your personal use. Any other use, including
instructional use at non-profit academic institutions and re-distribution in electronic or
printed form of significant portions, beyond the limits of “fair use”, requires the explicit
permission of the copyright holder. 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 and/or his
respective employer 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 2018/19) 7/289
Recommended Textbooks I
G. Farin.
Curves and Surfaces for CAGD: A Practical Guide.
Morgan Kaufmann, 5th edition, 2002; ISBN 978-1-55860-737-8.
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.
H. Prautzsch, W. Boehm, M. Paluszny.
Bézier and B-spline Techniques.
Springer, 2002; ISBN 978-3540437611.
J. Gallier.
Curves and Surfaces in Geometric Modeling
Morgan Kaufmann, 1999; ISBN 978-1558605992.
http://www.cis.upenn.edu/~jean/gbooks/geom1.html
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/
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 8/289
Recommended Textbooks II
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, D. Hansford.
Practical Linear Algebra: A Geometry Toolbox.
A K Peters/CRC Press, 3rd edition, 2013; ISBN 978-1-4665-7956-9.
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 2018/19) 9/289
Table of Content
Introduction
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 10/289
Introduction
Motivation
Notation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 11/289
Motivation: Evaluation of a Polynomial
n(n + 1)
0 + 1 + 2 + ... + n =
2
multiplications (and n additions).
I Can we do better?
I Yes, we can: Horner’s Algorithm consumes only n multiplications and n additions
to evaluate a polynomial of degree n!
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 13/289
Motivation: Smoothness of a Curve
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 2018/19) 14/289
Motivation: Tangent to a Curve
γ(t0 )
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 15/289
Motivation: Bézier Curve
p2 p7
p3 p10
p6
p1 p5
p4
p0
I One (widely used) option is to generate a Bézier curve. (The figure shows a
Bézier curve of degree 10 with 11 control points.)
I What is the degree of a Bézier curve? Which geometric and mathematical
properties do Bézier curves exhibit?
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 16/289
Motivation: B-Spline Curve
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 17/289
Motivation: NURBS
1 − t2
2t
, for t ∈ R.
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 2018/19) 18/289
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 6πx + π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 2018/19) 19/289
Notation: Numbers and Sets
I Numbers:
I The set {1, 2, 3, . . .} of natural numbers is denoted by N, with N0 := N ∪ {0}.
I The set {2, 3, 5, 7, 11, 13, . . .} ⊂ N of prime numbers is denoted by P.
I The (positive and negative) integers are denoted by Z.
I Zn := {0, 1, 2, . . . , n − 1} and Z+ n := {1, 2, . . . , n − 1} for n ∈ N.
I The reals are denoted by R; 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 The set of all elements a ∈ A with property P(a), for some set A and some
predicate P, is denoted by
{x ∈ A : P(x)} or {x : x ∈ A ∧ P(x)}
or
{x ∈ A | P(x)} or {x | x ∈ A ∧ P(x)}.
I Quantifiers: The universal quantifier is denoted by ∀, and ∃ denotes the
existential quantifier.
I Bold capital letters, such as M, are used for matrices.
I The set of all (real) m × n matrices is denoted by Mm×n .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 21/289
Notation: Vectors
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 22/289
Notation: Sum and Product
n
Y 1 if n<m
ai := am if n=m
Qn−1
i=m ( i=m ai ) · an if n>m
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 23/289
Mathematics for Geometric Modeling
Factorial and Binomial Coefficient
Polynomials
Elementary Differential Calculus
Elementary Differential Geometry of Curves
Elementary Differential Geometry of Surfaces
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 24/289
Factorial and Binomial Coefficient
follows:
0 if k < 0,
!
n n!
:= k !·(n−k )!
if 0 ≤ k ≤ n,
k
0 if k > n.
n
I The binomial coefficient k
is pronounced as “n choose k ”; Dt.: “n über k ”.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 26/289
Factorial and Binomial Coefficient
n
I The following table contains the non-zero values of k
for 0 ≤ n, k ≤ 6.
k
n 0 1 2 3 4 5 6
0 1
1 1 1
2 1 2 1
3 1 3 3 1
4 1 4 6 4 1
5 1 5 10 10 5 1
6 1 6 15 20 15 6 1
I Trivial to observe:
I Each row begins and ends with 1.
I Initially each row contains increasing numbers till its middle but then the
numbers start to decrease.
I Each row’s first half is exactly the mirror image of its second half.
Lemma 3
Let n ∈ N0 and k ∈ Z.
! ! ! ! ! !
n n n n n n
= =1 = =n =
0 n 1 n−1 k n−k
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 27/289
Factorial and Binomial Coefficient
I All entries in this triangle, except for the left-most and right-most entries per row,
are the sum of the two entries above them in the previous row.
Theorem 4 (Khayyam, Yang Hui, Tartaglia, Pascal)
For n ∈ N and k ∈ Z,
! ! !
n n−1 n−1
= + .
k k −1 k
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 28/289
Factorial and Binomial Coefficient
or, equivalently,
n
!
X n n−i i
n
(a + b) = a b.
i
i=0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 29/289
Polynomials
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 31/289
Polynomials
an x n + an−1 x n−1 + · · · + a1 x + a0 ,
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 32/289
Polynomial Arithmetic
ax = xa and x m x k = x m+k
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.
I Same for multivariate polynomials.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 33/289
Polynomial Arithmetic
I Instead of R any commutative ring (R, +, ·) and symbols x, y , . . . that are not
contained in R would do. E.g.,
Lemma 9
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].
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 34/289
Polynomials: Vector Space
Theorem 11
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 , . . ..
p = an x n + an−1 x n−1 + · · · + a1 x + a0 ,
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 35/289
Polynomials: Roots
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 36/289
Polynomials: Roots
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 37/289
Polynomials: Roots
an x n + an−1 x n−1 + . . . + a1 x + a0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 38/289
Polynomials: Roots
Corollary 18
For a, b, c ∈ R, the roots r1 , r2 of the quadratic polynomial ax 2 + bx + c satisfy
b c
r1 + r2 = − r1 · r2 = .
a a
Corollary 19
For a, b, c, d ∈ R, the roots r1 , r2 , r3 of the cubic polynomial ax 3 + bx 2 + cx + d
satisfy
b c d
r1 + r2 + r3 = − r1 · r2 + r1 · r3 + r2 · r3 = r1 · r2 · r3 = − .
a a a
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 39/289
Polynomials: Function
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 over [−1, 1], since we have f (x) = 2x 2 − 1 for all x ∈ [−1, 1].
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 40/289
Horner’s Algorithm for Evaluation of a Polynomial
I Consider a polynomial p ∈ R[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 + . . . + an−1 x n−1 + an x n .
i=0
hn := an
hi := x0 · hi+1 + ai for i = 0, 1, 2, ..., n − 1
14 return h;
15 }
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 42/289
Horner’s Algorithm for Evaluation of a Polynomial
Lemma 21
Horner’s 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.
I Subtractive cancellation: Subtracting two nearly equal numbers (on a
conventional IEEE-754 floating-point arithmetic) may yield a result with few or no
meaningful digits. Aka: catastrophic cancellation.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 43/289
Forward Differencing
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 44/289
Forward Differencing
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 45/289
Differentiation of Functions of One Variable
Definition 23
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 (n−1) .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 47/289
Differentiation of Functions of One Variable
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 2018/19) 48/289
Differentiation of Functions of One Variable
f (b) − f (a)
f 0 (c) = .
b−a
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 49/289
Differentiation of Functions of One Variable
Definition 29
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)
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 2018/19) 51/289
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 31
∂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 ∂x∂y
(x0 , y0 ) exists, and we have
∂2f ∂2f
(x0 , y0 ) = (x0 , y0 ).
∂x∂y ∂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 )
∂x∂y ∂x ∂y
I Also, note that Theorem 31 does not imply that it could not be simpler to
2
f ∂2f
compute, say, ∂y∂ ∂x rather than ∂x∂y :
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 2018/19) 52/289
Differentiation of Functions of Several Variables
Theorem 33
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. 32 are given by
∂fi
aij = (a) for i ∈ {1, 2, . . . , n} and j ∈ {1, 2, . . . , m}.
∂xj
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 53/289
Differentiation of Functions of Several Variables
Theorem 34
If a function f : S → Rn of m variables is differentiable at a point a ∈ S then it is
continuous at a.
Theorem 35
∂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.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 54/289
Curves
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 56/289
Caveat: Sierpinski Curves
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 order-n Sierpinski curve is
2 √ 1 √ 1
Ln = (1 + 2)2n − (2 − 2) n .
3 3 2
Hence, its length grows exponentially and unboundedly as n grows.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 57/289
Curves in Rn
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 58/289
Curves in Rn
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 59/289
Curves in Rn
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 60/289
Differentiable Curves
Definition 41 (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.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 61/289
Differentiable Curves
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 62/289
Equivalence of Parameterizations in Rn
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 2018/19) 63/289
Equivalence of Parameterizations in Rn
β(φ(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 γ.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 64/289
Equivalence of Parameterizations in Rn
Theorem 47
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 26 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 26 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 2018/19) 65/289
Arc Length
The length LP (γ) of the polygonal chain (γ(t0 ), γ(t1 ), γ(t2 ), . . . , γ(tm )) that
corresponds to the decomposition t0 , t1 , t2 , . . . , tm is given by
m−1
X
LP (γ) := kγ(tj+1 ) − γ(tj )k
j=0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 66/289
Arc Length
Lemma 51
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 2018/19) 67/289
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
The graph of f (x) := x sin x
for x ∈ [0, 2]
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 68/289
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
1
for x ∈ [0, 21 ]
The graph of f (x) := x sin x
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 68/289
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.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 2018/19) 68/289
Arc Length: Non-Rectifiable Curve
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 2018/19) 69/289
Arc Length
Lemma 52
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,
m−1
X m−1
XX n
LP (γ) = kγ(tj+1 ) − γ(tj )k ≤ |γk (tj+1 ) − γk (tj )|
j=0 j=0 k =1
m−1 n
(?) XX
= |γk0 (xkj )|(tj+1 − tj ) for suitable xkj
j=0 k =1
m−1
XX n n
X m−1
X
≤ Mk (tj+1 − tj ) = Mk (tj+1 − tj )
j=0 k =1 k =1 j=0
n
X
= (b − a) Mk
k =1
Theorem 53
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 54
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 71/289
Arc Length: Unit Speed
Theorem 57
If γ : I → Rn , with I := [a, b], is a regular curve then there exists an equivalent
reparameterization γ̃ that has unit speed.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 72/289
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 2018/19) 73/289
Tangent Vector
Lemma 60
Let γ : I → R3 be a C 2 curve that is regular of order two, and define T , N, B as in
Def. 59. 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 2018/19) 75/289
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 ).
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 76/289
Curvature of Curves in R3
I The curvature at a given point of a curve is a measure of how quickly the curve
changes direction at that point relative to the speed of the curve.
Definition 62 (Curvature, Dt.: Krümmung)
Let γ : I → R3 be a C 2 curve that is regular. The curvature κ(t) of γ at the point γ(t)
is defined as
kγ 0 (t) × γ 00 (t)k
κ(t) := .
kγ 0 (t)k3
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 77/289
Curvature of Curves in R3
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 78/289
Curvature of Curves in R3 : Inflection
Lemma 65
Let γ : I → R3 be a C 2 -curve that is regular such that for all t ∈ I the second
derivative γ 00 does not vanish. Then γ(t) is a point of inflection of γ if and only if
γ 0 (t) and γ 00 (t) are collinear.
I Hence, at a point of inflection the radius of curvature is infinite and the circle of
curvature degenerates to the tangent.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 79/289
Curvature of Curves in R3
Lemma 66
Let γ : I → R3 be a C 3 -curve at unit speed that is regular of order two. Then the
following simplified formula holds:
κ(t) =
γ 00 (t)
kγ 0 (t) × γ 00 (t)k
κ(t) = .
kγ 0 (t)k3
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 80/289
Curvature of Curves in R2
Lemma 67
Let γ : I → R2 be a C 2 -curve that is regular, with γ(t) = (x(t), y (t)). Then κ(t) of γ
at the point γ(t) is given as
Corollary 68
Let γ : I → R2 be a C 2 -curve that is regular, with γ(t) = (t, y (t)). Then κ(t) of γ at
the point γ(t) is given as
|y 00 (t)|
κ(t) = .
((1 + (y 0 (t))2 )3/2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 81/289
Parametric Continuity of a Curve
β
γ
p
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 82/289
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 70 (Curvature continuous, Dt.: krümmungsstetig)
Let β : [a, b] → R3 and γ : [c, d] → R3 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 2018/19) 83/289
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 84/289
Geometric Continuity
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 85/289
Parametric Surface in R3
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 2018/19) 87/289
Sample Parametric Surface: Frustum of a Paraboloid
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 88/289
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 2018/19) 89/289
Basic Definitions for Parametric Surfaces
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 74 (Singular point, Dt.: singulärer 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 2018/19) 90/289
Curves on Surfaces
α(Ω).
I Suppose that α is differentiable on Ω. Differentiating γ(t) (by means of a
multi-dimensional analogue of the Chain Rule 26) 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
∂α ∂α
(u(t), v (t)) and (u(t), v (t)).
∂u ∂v
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 91/289
Curves on Surfaces
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 92/289
Curves on Surfaces
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 2018/19) 93/289
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 75 (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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 94/289
Bézier Curves and Surfaces
Bernstein Basis Polynomials
Bézier Curves
Bézier Surfaces
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 95/289
Bernstein Basis Polynomials
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 97/289
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 98/289
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 1 over the interval [0, 1]:
1−x x
1.0
0.8
0.6
0.4
0.2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 98/289
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 98/289
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 3 over the interval [0, 1]:
1.0
0.8
0.6
0.4
0.2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 98/289
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 4 over the interval [0, 1]:
1.0
0.8
0.6
0.4
0.2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 98/289
Bernstein Basis Polynomials
I All Bernstein basis polynomials of degree n = 5 over the interval [0, 1]:
1.0
0.8
0.6
0.4
0.2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 98/289
Recursion Formula for Bernstein Basis Polynomials
Lemma 78
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:
Proof : Let n ∈ N and k ∈ N0 with k ≤ n be arbitrary but fixed, and recall that
! ! ! !
Def. 77 n k n−k n Thm. 4 n − 1 n−1
Bk ,n (x) = x (1 − x) and = + .
k k k −1 k
We get
! !
n−1 k n−k n−1 k
Bk ,n (x) = x (1 − x) + x (1 − x)n−k
k −1 k
! !
n − 1 k −1 (n−1)−(k −1) n−1 k
=x x (1 − x) + (1 − x) x (1 − x)(n−1)−k
k −1 k
= x · Bk −1,n−1 (x) + (1 − x) · Bk ,n−1 (x).
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 99/289
Properties of Bernstein Basis Polynomials
Lemma 79
For all n ∈ N and k ∈ N0 with k ≤ n, the Bernstein basis polynomial Bk ,n−1 can be
written as linear combination of Bernstein basis polynomials of degree n:
n−k k +1
Bk ,n−1 (x) = Bk ,n (x) + Bk +1,n (x).
n n
Lemma 80
For all n, k ∈ N0 with k ≤ n, the Bernstein basis polynomial Bk ,n is non-negative
over the unit interval:
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 100/289
Properties of Bernstein Basis Polynomials
Proof : Trivial for n = 0. Now recall the Binomial Theorem 5, for a, b ∈ R and n ∈ N:
n
!
n
X n k n−k
(a + b) = a b
k
k =0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 101/289
Properties of Bernstein Basis Polynomials
Lemma 82
For all n ∈ N0 and any set of n + 1 points in R2 with position vectors
p0 , p1 , p2 , . . . , pn , the term
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 2018/19) 102/289
Derivatives of Bernstein Basis Polynomials
Lemma 84
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)i−j Bk −j,n−i (x)
(n − i)! j
j=0
Corollary 85
For n, k ∈ N0 , the first and second derivative of Bk ,n (x) are given as follows:
Bk00,n (x) = n(n − 1) Bk −2,n−2 (x) − 2Bk −1,n−2 (x) + Bk ,n−2 (x)
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 103/289
Bernstein Basis Polynomials Form a Basis
Lemma 86
The n + 1 Bernstein basis polynomials B0,n , B1,n , . . . , Bn,n are linearly independent,
for all n ∈ N0 .
Lemma 87
For all n, i ∈ N0 , with i ≤ n, we have
Xn k
xi = i
n Bk ,n (x).
k =i i
Theorem 88
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 .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 105/289
Bézier Curves
I Discovered in the late 1950s by Paul de Casteljau at Citroën and in the early
1960s by Pierre E. Bézier at Renault, and first published by Bézier in 1962.
(Citroën 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 Bézier curve of degree 10 with 11 control points.
p9 p8
p2 p7
p3 p10
p6
p1 p5
p4
p0
n
i
where Bi,n (t) = i
t (1 − t)n−i 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 , . . . , pn−1 , 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 2018/19) 108/289
Properties of Bézier Curves
Lemma 90
A Bézier curve defined by n + 1 control points is (coordinate-wise) a polynomial of
degree n.
Hence, B(0) = B0,n (0)p0 = p0 . Similarly for Bi,n (1) and B(1).
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 109/289
Properties of Bézier Curves
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 110/289
Properties of Bézier Curves
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 111/289
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 Bézier curve B is transformed to B? as follows:
j−1
! 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 Bézier curve.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 112/289
Evaluation of a Bézier 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 + t · r .
I Similarly, we can compute a point on a Bézier curve such that the curve is split
into portions of relative length t and 1 − t.
I On every leg pj−1 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 2018/19) 113/289
De Casteljau’s Algorithm
p1 p5
p0 p4
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 114/289
De Casteljau’s Algorithm
p0 =: p00
p1 p1 =: p01 p5
p2 =: p02
p3 =: p03
p4 =: p04
p0 p5 =: p05 p4
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 114/289
De Casteljau’s Algorithm
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 2018/19) 114/289
De Casteljau’s Algorithm
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 2018/19) 114/289
De Casteljau’s Algorithm
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 114/289
De Casteljau’s Algorithm
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 114/289
De Casteljau’s Algorithm
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 114/289
De Casteljau’s Algorithm
13 return p[0];
14 }
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 2018/19) 115/289
De Casteljau’s Algorithm: Correctness
t(1 − t) · p01 .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 116/289
De Casteljau’s Algorithm: Correctness
t i (1 − t)n−i · p0i ,
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 117/289
De Casteljau’s Algorithm: Correctness
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 118/289
Evaluation of a Bézier Curve Using Horner’s Scheme
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 119/289
Bernstein Polynomials and Polar Forms
Theorem 96
Let n, d ∈ N. For every polynomial function F : R → Rd of degree at most n 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 , . . . , xi−1 , αj yj , xi+1 , . . . , xn ) = αj f (x1 , . . . , xi−1 , yj , xi+1 , . . . , xn )
j=1 j=1
3. for all x ∈ R
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 120/289
Bernstein Polynomials and Polar Forms
Lemma 97
Pn
Let n ∈ N and a0 , a1 , . . . , an ∈ R, and F (x) := i=0 ai x i . Then f : Rn → R with
n
X 1 X Y
f (x1 , x2 , . . . , xn ) := ai
n xj
i=0 i I⊆{1,...,n} j∈I
|I|=i
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 2018/19) 121/289
Bernstein Polynomials and Polar Forms
1
x (x1 + x2 )
I Let F (x) := 1 2 . Hence f (x1 , x2 ) = 2
1 , and we get
2
x x x
2 1 2
1
0 2
1
f (0, 0) = f (0, 1) = = f (1, 0) f (1, 1) = 1 .
0 0 2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 122/289
Bernstein Polynomials and Polar Forms
Lemma 98
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
Bézier curve defined by them matches P|[0,1] .
pk := f (0, . . . , 0, 1, . . . , 1) for k = 0, 1, . . . , n.
| {z } | {z }
n−k k
I Polar forms are useful because they provide a uniform and simple means for
computing values of a polynomial using a variety of representations (Bézier,
B-spline, NURBS, etc.).
I For this reason, some authors prefer to introduce Bézier curves in their polar
form.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 123/289
Derivatives of a Bézier Curve
Lemma 99
Let B be a Bézier curve of degree n with n + 1 control points p0 , p1 , . . . , pn . Its first
derivative, which is sometimes called hodograph, is a Bézier curve of degree n − 1,
n−1
X
B0 (t) = Bi,n−1 (t)(n(pi+1 − pi )),
i=0
Proof : Since the control points are constants, computing the derivative of a Bézier
curve is reduced to computing the derivatives of the Bernstein basis polynomials.
n
! n n
!
0 d X X 0 Cor. 85
X
B (t) = Bi,n (t)pi = Bi,n (t)pi = n (Bi−1,n−1 (t) − Bi,n−1 (t))pi
dt
i=0 i=0 i=0
n n−1
!
X X
=n· Bi−1,n−1 (t)pi − Bi,n−1 (t)pi
i=1 i=0
n−1 n−1
! n−1
X X X
=n· Bi,n−1 (t)pi+1 − Bi,n−1 (t)pi = Bi,n−1 (t)(n(pi+1 − pi ))
i=0 i=0 i=0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 124/289
Derivatives of a Bézier Curve
Lemma 100
A Bézier curve is tangent to the control polygon at the endpoints.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 125/289
Subdivision of a Bézier Curve
I One can subdivide an n-degree Bézier curve B into two curves, at a point B(t0 )
for a given parameter t0 , such that the newly obtained Bézier curves B1 and B2
have their own set of control points and are of degree n each:
I First, we use de Casteljau’s algorithm to compute B(t0 ).
I The subdivided control polygon can then be used to generate the new
control polygons for B1 and B2 .
I Note that B1 and B2 join in a G1 -continuous way.
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 2018/19) 126/289
Subdivision of a Bézier Curve
Lemma 101
Let p0 , p1 , . . . , pn be the control points of the Bézier curve B, and let pi,j denote the
control points obtained by de Casteljau’s algorithm for some t0 ∈]0, 1[. We define
new control points as follows:
Let B? (B?? , resp.) denote the Bézier 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
I Note: With every subdivision the control polygons get closer to the Bézier curve.
And the approximation is very fast: For k subdivision steps, the maximum
distance ε between the resulting control polygon and the curve is
c
ε< for some positive constant c.
2k
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 127/289
Degree Elevation of a Bézier Curve
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 p−1 and pn+1 . (Both points will be
multiplied with factors that equal zero, anyway.)
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 128/289
Degree Elevation of a Bézier Curve
I Standard equalities:
! ! !
n+1 n+1 n i
(1 − t) · Bi,n (t) = (1 − t) t (1 − t)n−i
i i i
! ! !
n n+1 i n+1−i n
= t (1 − t) = Bi,n+1 (t)
i i i
and
! ! !
n+1 n+1 n i
t · Bi,n (t) = t t (1 − t)n−i
i +1 i +1 i
! ! !
n n + 1 i+1 n
= t (1 − t)n−i = Bi+1,n+1 (t)
i i +1 i
I Hence,
n+1−i i +1
(1 − t) · Bi,n (t) = Bi,n+1 (t) and t · Bi,n (t) = Bi+1,n+1 (t).
n+1 n+1
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 129/289
Degree Elevation of a Bézier 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+1−i 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+1−i 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+1−i X i
= Bi,n+1 (t)pi + Bi,n+1 (t)pi−1
n+1 n+1
i=0 i=0
n+1 n+1
X i n+1−i X
= Bi,n+1 (t) pi−1 + pi = Bi,n+1 (t)pi? =: B? (t)
n+1 n+1
i=0 i=0
with
i n+1−i
pi? := pi−1 + pi , i = 0, . . . , n + 1.
n+1 n+1
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 130/289
Degree Elevation of a Bézier Curve
Lemma 102
Let p0 , p1 , . . . , pn be the control points of the degree-n Bézier curve B. If we use
i i
pi? := pi−1 + 1 − pi for i = 0, 1, · · · , n + 1
n+1 n+1
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 131/289
Degree Elevation of a Bézier 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 Bézier curves that join.
I As the degree keeps increasing, the control polyon approaches the Bézier curve
and has it as a limiting position.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 132/289
Bézier Surfaces
d
k
where Bk ,d (x) := k
x (1 − x)d−k 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
Bézier surface of degree (n, m).
I The set of control points is called a Bézier net or control net.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 134/289
Properties of Bézier Surfaces
Lemma 104
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.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 135/289
Properties of Bézier Surfaces
Proof : Recall that S(u, v ) is the linear combination of all its control points with
non-negative coefficients whose sum is one.
Lemma 107
A Bézier surface passes through the four corners p0,0 , pn,0 , p0,m and pn,m .
Hence, S(0, 0) = B0,n (0)B0,m (0)p0,0 = p0,0 . Similarly for the other corners.
Lemma 108
Applying an affine transformation to the control points results in the same
transformation as obtained by transforming the surface’s equation.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 136/289
Isoparametric Curves of Bézier Surfaces
Lemma 109
Consider a Bézier 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
Corollary 110
The boundary curves of a Bézier surface are Bézier curves defined by the
boundary points of its control net.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 138/289
Bézier Surface as Tensor-Product Surface
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 139/289
B-Spline Curves and Surfaces
Shortcomings of Bézier 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 2018/19) 140/289
Shortcomings of Bézier Curves
I Modifying the vertex pj of a Bézier curve causes a global change of the entire
curve:
p9 p8
p2 p3 p7
p10
p6
p1
p5
p4
p0 v
p4 + v
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 142/289
Shortcomings of Bézier Curves
I While it is easy to join two Bézier curves with G1 continuity, achieving C 2 or even
higher continuity is quite cumbersome.
p∗3
p∗1
p2 , p3 = p∗0 , p∗1 collinear
p1
p0 p3 = p∗0
p2 p∗2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 143/289
Shortcomings of Bézier Curves
I While it is easy to join two Bézier 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 Bézier curves
destroys G1 continuity.
p∗3
p∗1
p1
p3 = p∗0
p0
p2 p∗2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 143/289
Shortcomings of Bézier Curves
I While it is easy to join two Bézier 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.)
p∗3
p∗1
p1
p0 p3 = p∗0
p2 p∗2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 144/289
Shortcomings of Bézier Curves
I While it is easy to join two Bézier 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.)
p∗3
p∗1
p1 p3 = p∗0
p0
p2 p∗2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 144/289
Shortcomings of Bézier Curves
I It is fairly difficult to squeeze a Bézier curve close to a sharp corner of the control
polygon.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 145/289
Shortcomings of Bézier Curves
I Adding additional control vertices hardly helps but increases the degree of the
Bézier curve, which may result in oscillation and cause numerical instability.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 145/289
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
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 2018/19) 147/289
Introduction to B-Splines
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 2018/19) 148/289
Introduction to B-Splines
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 2018/19) 149/289
Knot Vector
I For (bi)infinite knot vectors we assume supi→∞ ti = ∞ and inf i→−∞ 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 2018/19) 150/289
Knot Vector
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 151/289
B-Spline Basis Functions
I We define the B-spline basis functions analytically, using the recurrence formula
by de Boor, Cox and Mansfield.
Definition 117 (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
I In case of multiple knots, indeterminate terms of the form 00 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 2018/19) 152/289
B-Spline Basis Functions
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 [,
t−ti
= 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,τ (t) are called hat functions or chapeau functions. They are
widely used in signal processing and finite-element techniques.
I Note that Ni,1,τ (t) 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 2018/19) 153/289
B-Spline Basis Functions
1
N1,0 Ni,0 is a step function that is 1 over
the knot span [ti , ti+1 [
t0 t1 t2 t3 t4 t5
1
N1,1 Ni,1 is a piecewise linear function that
is non-zero over 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 over three knot spans
[ti , ti+3 [
t0 t1 t2 t3 t4 t5
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 154/289
Sample B-Spline Basis Functions
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 2018/19) 155/289
Sample B-Spline Basis Functions
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 2018/19) 155/289
Sample B-Spline Basis Functions
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 2018/19) 155/289
Sample B-Spline Basis Functions
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
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
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
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
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,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 2018/19) 159/289
Properties of B-Spline Basis Functions
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
k := 3
N4,0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 159/289
Properties of B-Spline Basis Functions
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 159/289
Properties of B-Spline Basis Functions
Ni,k ,τ (t) = 0 if t ∈
/ [ti , ti+k +1 [.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 160/289
Properties of B-Spline Basis Functions
≥ 0.
Lemma 120
For all k ∈ N, all B-spline basis functions of degree k are continuous.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 161/289
Properties of B-Spline Basis Functions
Lemma 121
Let τ := (. . . , t−2 , t−1 , t0 , t1 , t2 , . . .) be a (bi)infinite knot vector. For all (permissible)
i ∈ Z and k ∈ N0 , the basis functions
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 2018/19) 162/289
Properties of B-Spline Basis Functions
Lemma 122
Let τ := (. . . , t−2 , t−1 , t0 , t1 , t2 , . . .) be a (bi)infinite knot vector. For all (permissible)
i ∈ Z and k ∈ N0 , the basis functions
are the only (at most) k + 1 basis functions of degree k that are (possibly) non-zero
over the interval [ti , ti+1 [.
Nj,k ,τ (t) = 0 if t ∈
/ [tj , tj+k +1 [
are the only B-spline basis functions that are (possibly) non-zero over [ti , ti+1 [.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 162/289
Properties of B-Spline Basis Functions
Lemma 123
All B-spline basis functions of degree k are piecewise polynomials of degree k .
1
N1,2
t0 t1 t2 t3 t4 t5
Lemma 124
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 (t) 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 2018/19) 163/289
Properties of B-Spline Basis Functions
Lemma 125
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 .
X−1
m−k
Ni,k ,τ (t) = 1 for all t ∈ [tk , tm−k [.
i=0
Corollary 127
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 2018/19) 164/289
Properties of B-Spline Basis Functions
Proof of Lemma 126 (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 m−k i=0 Ni,k −1,τ (t) = 1 for all t ∈ [tk −1 , tm−k +1 [.
I.S.: Recall that (by Lem. 118)
N0,k −1,τ (t) = 0 for t ∈
/ [t0 , tk [ and Nm−k ,k −1,τ (t) = 0 for t ∈
/ [tm−k , tm [.
Let t ∈ [tk , tm−k [ be arbitrary but fixed. Applying the recursion yields
X−1
m−k X−1 t − ti
m−k
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
X−1
m−k
t − ti X−2 ti+k +1 − t
m−k
= Ni,k −1,τ (t) + Ni+1,k −1,τ (t)
ti+k − ti ti+k +1 − ti+1
i=1 i=0
X−1
m−k
t − ti X−1
m−k
ti+k − t
= Ni,k −1,τ (t) + Ni,k −1,τ (t)
ti+k − ti ti+k − ti
i=1 i=1
X−1
m−k m−k
X t∈[tk −1 ,tm−k +1 [
= Ni,k −1,τ (t) = Ni,k −1,τ (t) = 1.
i=1 i=0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 165/289
B-Spline Curves
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 167/289
Clamped and Unclamped B-Spline Curves
I Recall that the Partition of Unity (Cor. 127) holds for all t ∈ [tk , tn+1 [.
I Typically, for a clamped knot vector,
Lemma 130
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 2018/19) 168/289
Clamped and Unclamped B-Spline Curves
I Control points: 0 0 2 4 6 8 8
, , , , , , .
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 169/289
Proof of Lemma 130
We prove P(tk ) = p0 . Recall that N0,k (t) is non-zero only for t ∈ [t0 , tk +1 [.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 170/289
Proof of Lemma 130
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. 127, 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 2018/19) 171/289
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
j
tk +j = for j = 1, 2, . . . , n − k
n−k +1
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 172/289
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 173/289
Properties of B-Spline Curves
Lemma 131
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 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 1
, , , , , , , , , , , , ,
1 3 5 5 4 2 2 1 1 3 5 6 7 5
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 174/289
Properties of B-Spline Curves
Sketch of Proof : The proof is identical to the proof of the affine invariance of Bézier
curves, recall Lem. 95.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 175/289
Properties of B-Spline Curves
Lemma 134
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 Bézier curve of degree k .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 176/289
Derivatives of B-Spline Curves
Lemma 135
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
n−1
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. 124 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 2018/19) 177/289
Derivatives of B-Spline Curves
Lemma 136
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 ),
n−1
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 2018/19) 178/289
Derivatives of B-Spline Curves
Corollary 137
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. 136, 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. 130, 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 2018/19) 179/289
Strong Convex Hull Property
Proof : Lemma 121 tells us that Ni−k ,k , Ni−k +1,k , . . . , Ni−1,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. 119). Together with Cor. 127, Partition of Unity, we get
n
X i
X
1= Nj,k (t) = Nj,k (t) for all t ∈ [ti , ti+1 [.
j=0 j=i−k
Hence,
n
X i
X
P(t) = Nj,k (t)pj = Nj,k (t)pj for all t ∈ [ti , ti+1 [
j=0 j=i−k
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 2018/19) 181/289
Local Control and Modification
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 182/289
Local Control and Modification
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 183/289
Local Control and Modification
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 183/289
Multiple Control Points
Sketch of Proof : This is a consequence of Lemma 121 and of the Strong Convex Hull
Property (Lem. 138).
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 2018/19) 184/289
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 2018/19) 185/289
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 2018/19) 185/289
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 2018/19) 185/289
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 2018/19) 185/289
Multiple Knots
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 186/289
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 2018/19) 187/289
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 2018/19) 187/289
Motivation for de Boor’s Algorithm
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 188/289
Motivation for de Boor’s Algorithm
I Equality at ? holds since each basis function Ni,k is non-zero only over [ti , ti+k +1 [
(Local Support Lem. 118):
where, for 2 ≤ i ≤ n,
t − ti
pi,2 (t) := (1 − αi,2 ) pi−1,1 (t) + αi,2 pi,1 (t) with αi,2 := ,
ti+k −1 − ti
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 189/289
De Boor’s Algorithm
where
t − ti
αi,j := ,
ti+k +1−j − ti
then
n
X
P(t) = Ni,0 (t)pi,k (t) for t ∈ [tk , tn+1 [.
i=k
Corollary 144
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 2018/19) 190/289
Sample Run of de Boor’s Algorithm
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 191/289
Sample Run of de Boor’s Algorithm
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 191/289
Sample Run of de Boor’s Algorithm
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 191/289
Sample Run of de Boor’s Algorithm
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 191/289
De Boor’s Algorithm for Subdividing a B-Spline Curve
(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 2018/19) 192/289
De Boor’s Algorithm for Subdividing a B-Spline Curve
Definition 145
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.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 193/289
De Boor’s Algorithm for Subdividing a B-Spline Curve
Lemma 146
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. 145.
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 194/289
De Boor’s Algorithm for Splitting a B-Spline Curve into Bézier Segments
Corollary 147
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 , . . . , tn−1 , tn },
as outlined in Def. 145, splits P into n − k + 1 Bézier curves of degree k .
Sketch of Proof : Lemma 146 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. After mapping [tk +m , tk +m+1 [ to
[0, 1[ we can apply Lem. 134 and conclude that the resulting B-spline curve is a
Bézier curve of degree k .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 195/289
De Boor’s Algorithm for Splitting a B-Spline Curve into Bézier Segments
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 196/289
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 197/289
Knot Insertion
if, for 0 ≤ i ≤ n + 1,
pi if i ≤ j − k
pi? := (1 − αi )pi−1 + αi pi if j − k + 1 ≤ i ≤ j
pi−1 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 2018/19) 198/289
Knot Insertion: Sample
I Clamped uniform B-spline of degree three for 14 control points and knot vector
with 18 knots: τ := (0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 11, 11).
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 199/289
Knot Insertion: Sample
I Old 18 knots:
t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17
0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 11 11 11
t? = 4.2
t0 = t1 = t2 = t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 = t15 = t16 = t17
0 1 2 3 4 5 6 7 8 9 10 11
α5 1 − α5
t ? − t5 2 15
11 ? 1 79 5.2667
α5 := = = p5 = (1 − α5 )p4 + α5 p5 = ≈
t8 − t5 3 15 15 38 2.5333
t ? − t6 11
6 1 63 4.2
α6 := = 5 = p6?= (1 − α6 )p5 + α6 p6 = ≈
t9 − t6 3 15 15 30 2
1
t ? − t7
1 1 45 3
α7 := = 5 = p7? = (1 − α7 )p6 + α7 p7 = ≈
t10 − t7 3 15 15 29 1.9333
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 200/289
Knot Insertion and Deletion
I The so-called Oslo algorithm, developed by Cohen et al. [1980], is more general
than Boehm’s 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 2018/19) 201/289
Closed B-Spline Curves
Lemma 149
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
Lemma 150
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 202/289
Closed B-Spline Curves via Wrapping of Control Points
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 203/289
B-Spline Surfaces
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 τ .
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 205/289
Sample B-Spline Surfaces
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 206/289
Properties of B-Spline Surfaces
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 207/289
Properties of B-Spline Surfaces
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 208/289
Clamping of a B-Spline Surface
I A B-spline surface can be clamped by repeating the same knot values in one
direction of the parameters (i.e., in s or t).
I We can also close the surface by recycling the control points.
I If a B-spline surface is closed in one direction, then the surface becomes a tube.
I If a B-spline surface is closed in two directions, then the surface becomes a torus.
I Other topologies are more difficult to handle, such as a ball or a double torus.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 209/289
Evaluation of a B-Spline Surface
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 210/289
Motivation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 212/289
Non-Uniform Rational B-Splines
where Ni,k ,τ is the i-th B-spline basis function of degree k relative to τ , with the
weights wi ∈ R+ 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. 127.)
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 2018/19) 213/289
Geometric Interpretation of NURBS
u
I We resort to homogeneous coordinates: For w = 6 0, v are the
w
x x
homogeneous coordinates of , and are the inhomogeneous
y y
u
coordinates of v ⇐⇒ x = wu and y = wv .
w
wi xi
xi
I For pi := ∈ R , let pi := wi yi ∈ R3 , for all i ∈ {0, 1, . . . , n}.
2 w
yi
wi
I Now consider
Pn
Xn 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
(perspective) projection of N w to the plane z = 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 2018/19) 214/289
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 2018/19) 215/289
Geometric Interpretation of NURBS
1 − t2
x(t) :=
1 + t2 with t ∈ R.
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 216/289
NURBS Basis Functions
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 2018/19) 217/289
Properties of NURBS Basis Functions
Lemma 160
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 2018/19) 218/289
Properties of NURBS Curves
Lemma 161
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
Local control: The NURBS curve N restricted to [ti , ti+1 [ depends only on the
positions of pi−k , pi−k +1 , . . . , pi−1 , 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 2018/19) 219/289
Properties of NURBS Curves
Lemma 163
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 2018/19) 220/289
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 2018/19) 221/289
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 2018/19) 221/289
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 2018/19) 221/289
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 222/289
Conics Modeled by NURBS
Lemma 164
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.
τ := (0, 0, 0, 1, 1, 1)
and weights:
(1, 1/10, 1), hence ρ < 1.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 223/289
Conics Modeled by NURBS
Lemma 165
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.
τ := (0, 0, 0, 1, 1, 1)
and weights:
(1, 1, 1), hence ρ = 1.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 223/289
Conics Modeled by NURBS
Lemma 166
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.
τ := (0, 0, 0, 1, 1, 1)
and weights:
(1, 5, 1), hence ρ > 1.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 223/289
Conics Modeled by NURBS
Lemma 167
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 224/289
Conics Modeled by NURBS
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
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 225/289
Conics Modeled by NURBS
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 226/289
Sample NURBS Surface
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 227/289
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 2018/19) 228/289
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)
a∈A b∈B
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 2018/19) 230/289
Hausdorff 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 169 (Fréchet distance)
Consider a closed interval I ⊂ R and two curves β, γ : I → Rn . The Fréchet distance
between β(I) and γ(I) is defined as
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 233/289
Interpolation Versus Approximation
C C
u u
I Similarly for approximation/interpolation by a surface rather than a curve.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 235/289
Humorous View of Approximation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 236/289
Lagrange Interpolation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 237/289
Lagrange Interpolation
Lemma 172
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. 171. Then L(uk ) = qk for all
k ∈ {0, 1, . . . , m}.
Hence,
m
X
L(uk ) = Li,m (uk )qi = qk .
i=0
Corollary 173
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.
with
qi for i = 0,
pi := Pi−1
qi − I (u )p
j=0 j i j
for i > 0.
Ii (ui )
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 239/289
Newton Interpolation
Lemma 176
For m ∈ N, let I be defined for m + 1 parameter values u0 < u1 < . . . < um and
m + 1 data points q0 , q1 , . . . , qm , as given in Def. 175. Then I(uk ) = qk for all
k ∈ {0, 1, . . . , m}.
We have
I(u0 ) = 1 · p0 = q0 ,
and for each 1 ≤ k ≤ m
m
X k
X k −1
X
I(uk ) = Ii (uk )pi = Ii (uk )pi = Ii (uk )pi + Ik (uk )pk
i=0 i=0 i=0
k −1
Pk −1
X qk − j=0 Ij (uk )pj
= Ii (uk )pi + Ik (uk ) · = qk .
Ik (uk )
i=0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 240/289
Limits of Lagrange Interpolation and Newton Interpolation
0.5
-4 -2 2 4
-0.5
-1.0
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 241/289
B-Spline Interpolation
I Lem. 118: The matrix N is a sparse band matrix without negative elements.
I Fast and numerically reliable algorithms exist for computing the inverse of N.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 242/289
B-Spline Interpolation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 243/289
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
with
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 244/289
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 Schönberg-Whitney Lem. 177 tells us that the matrix NT N is
invertible exactly if the Schönberg-Whitney conditions are met:
Lemma 178
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 2018/19) 245/289
Bernstein Polynomials
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 2018/19) 247/289
Bernstein Approximation
t−a
I Since x := b−a 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 2018/19) 248/289
Sample Bernstein Approximation
0.8
0.6
0.4
0.2
Degree 2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 249/289
Sample Bernstein Approximation
0.8
0.6
0.4
0.2
Degree 128
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 249/289
Sample Bernstein Approximation
1
f : [0, 1] → R f (x) := sin (πx) + sin 6πx + πx 2
5
1.0
0.8
0.6
0.4
0.2
Degree 2
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 250/289
Sample Bernstein Approximation
1
f : [0, 1] → R f (x) := sin (πx) + sin 6πx + πx 2
5
1.0
0.8
0.6
0.4
0.2
Degree 256
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 250/289
Approximation of Polygonal Profiles
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 252/289
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 2018/19) 253/289
Sample Real-World Application: Conversion of Scanned Data
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 254/289
Sample Real-World Application: Recovering PCB Data
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 255/289
Specifying a Tolerance
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 256/289
Specifying a Tolerance
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 2018/19) 257/289
Cone of Influence
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 258/289
Signed Distance
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 2018/19) 259/289
Tolerance Zone
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 ) .
s∈P
dr
dl dr
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 260/289
Problem Statement
Given: Input
I Set P of (open or closed)
polygonal profiles that do not
intersect pairwise;
I Left approximation tolerance dL
dR
and right approximation
tolerance dR , with dL < dR . dL
Compute: Approximation A of P
such that
I A consists of Gk curves, for
some k ∈ N,
I all curves of A are simple and
pairwise disjoint,
I A ⊂ T Z(P, dL , dR ),
I P ⊂ T Z(A, −dR , −dL ) if
requested by user,
I topology of A matches
topology of P.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 261/289
Tolerance Zone and Distance Measures
where Fr(A, P) denotes the Fréchet distance between A and P, for each A ∈ A
and corresponding P ∈ P.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 262/289
Tolerance Zone and Distance Measures
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 263/289
Voronoi Diagram of Points
Voronoi experiment
Let’s throw a ball into “ideal” water (with no boundaries and no initial waves), and
watch the wavefronts that emerge (within a finite portion of the water).
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 264/289
Voronoi Diagram of Points
Voronoi experiment
Let’s now throw two identical balls at the same time into the water: As the wavefronts
meet, the bisector between the two balls is traced out.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 265/289
Voronoi Diagram of Points
Voronoi experiment
We repeat the experiment with three identical balls thrown at the same time into the
water: Again, the wavefronts trace out the bisectors between the balls as they meet.
r
r
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 266/289
Voronoi Diagram of Points
Voronoi regions
The blue bisectors defined by the three balls partition the water into Voronoi regions:
Each region is the loci of points q closer to its defining ball than to any other ball.
v
p1
p3
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 267/289
Voronoi Diagram of Points: Sample Diagram
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 268/289
Generalized Voronoi Diagram
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 269/289
VD-Based Computation of the Tolerance Zone
dl
dr
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 270/289
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 2018/19) 271/289
Circular Biarcs
ts c2
a1
pj
ps a2
c1 te
pe
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 272/289
Circular Biarcs
Lemma 186
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 2018/19) 273/289
Approximation Nodes
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 274/289
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 − ai−1 )/||ai − ai−1 || + (ai+1 − ai )/||ai+1 − ai ||.
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 275/289
Doubling-and-Bisection Heuristic for Biarc Approximation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 276/289
Sample Biarc Approximation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 279/289
Sample Biarc Approximation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 280/289
Theoretical Results on Biarc Approximation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 281/289
Uniform Cubic B-Spline Approximation
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 282/289
B-Spline Intersection Checking
I Use de Boor’s 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 2018/19) 284/289
Sample Approximation by Uniform Cubic B-Splines
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 285/289
Sample Approximation by Uniform Cubic B-Splines
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 286/289
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
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 2018/19) 288/289
The End!
I hope that you enjoyed this course, and I wish you all the best for your future studies.
UNIVERSITÄT SALZBURG
Computational Geometry and Applications Lab
c
M. Held (Univ. Salzburg) Geometric Modeling (WS 2018/19) 289/289