Geometric Modeling - Max Planck Society

75
Geometric Modeling Summer Semester 2010 Blossoming and Polar Forms Piecewise Polynomials Splines Revisited...

Transcript of Geometric Modeling - Max Planck Society

Page 1: Geometric Modeling - Max Planck Society

Geometric ModelingSummer Semester 2010

Blossoming and Polar FormsPiecewise Polynomials Splines Revisited...

Page 2: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 2 / 75

Overview...

Topics:• Interpolation & Approximation

• Polynomial Spline Curves

• Blossoming and PolarsThe De Casteljau Algorithm

Polar Forms: Idea & Definition

Polynomial Splines Revisited

– Bezier Splines

– B‐Splines

Page 3: Geometric Modeling - Max Planck Society

Geometric View:The De Casteljau Algorithm

Page 4: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 4 / 75

De Casteljau Algorithm

Idea of Bezier splines can be formulated differently:• Geometric view

Repeated linear interpolation with common parameter t

Implicitly creates polynomial in t

Degree depends on number of cascaded interpolations

• The geometric interpretation is usually more intuitiveProperties of the Bezier spline can be interpreted geometrically

– Derivatives

– Operations (e.g. subdivision)

– ...

• We will now look at the corresponding algorithm...

Page 5: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 5 / 75

De Casteljau

De Casteljau Algorithm: Computes f(t) for given t• Bisect control polygon in ratio t : (1 – t)

• Connect the new dots with lines (adjacent segments)

• Interpolate again with the same ratio

• Iterate, until only one point is left

Page 6: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 6 / 75

De Casteljau

Algorithm:for j = 0..d-1 do

for i = 1..d-j dopi(j) = (1-t)·pi(j-1) + t ·pi+1(j-1)

end forend forreturn p1(d)

p1(0)

p2(0) p3(0)

p4(0)

p1(1)

p2(1)

p3(1)

p1(2) p1(2)

p1(3) = f(t)

Page 7: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 7 / 75

Properties

Properties:• The algorithm yields the same result as evaluating the spline using the Bernstein basis

• The algorithm uses only iterated convex combinationsof control points

Numerically more stable than monomial evaluationEasy to see:

– Affine invariant– Convex hull property

• Open questions: How to geometrically interpretDerivativesOperations (knot insertion, degree elevation etc.)...

Page 8: Geometric Modeling - Max Planck Society

Polar Forms & Blossoms:Idea & Definition

Page 9: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 9 / 75

Affine Combinations

First: A quick look at “linear interpolation”• Actually, the right name should be “affine interpolation”

Definition:• An affine combination of n points ∈ Rd is given by:

• A function f is set to be affine in its parameter xi, if:

1 with11

== ∑∑==

n

ii

n

iii αα ppα

( ) 1for x,...,,...,x,...,,...,11

m)(

1m1

)(1 ==⎟⎟

⎞⎜⎜⎝

⎛∑∑∑

===

n

ii

n

k

kii

n

k

kii xxfxxf ααα

Page 10: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 10 / 75

Affine Combinations

Examples:• Linear (affine) interpolation of 2 points:

21 )1( ppp ααα −+=

α

1 – α

p1

p2

Page 11: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 11 / 75

Affine Combinations

Examples:• Barycentric combinations of 3 points(“barycentric coordinates”)

Properties:

Transformation to barycentric coordinates is a linear map(heights in triangles).

1:with,321 =++++= γβαγβα pppp

βαγ −−= 1

)),,(()),,((,

)),,(()),,((,

)),,(()),,((

321

21

321

31

321

32

pppppp

pppppp

pppppp

ΔΔ

=ΔΔ

=ΔΔ

=areaarea

areaarea

areaarea γβα

p1

p2

p3

p α

β

γ

Page 12: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 12 / 75

Formalizing the Idea

Idea: Express (piecewise) polynomial curves asiterated linear (affine) interpolations

First try:• A polynomial: 

• Can be written as: 

• Interpret each variable t a separate parameter:

t1 moves linearly in direction (a + b + c)

t2 in direction (a + b)

t3 in direction a

• Problems: fixed directions, many representations

dctbtattp +++= 23)(

dtcttbtttatp +⋅+⋅⋅+⋅⋅⋅=)(

dcbap +⋅+⋅⋅+⋅⋅⋅= 121321321 ),,( ttttttttt

Page 13: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 13 / 75

Polar Forms

Improved solution: Polar Forms / BlossomsA polar form or blossom f of a polynomial F of degree d is a function in d variables:

F: R → Rf: Rd → R

with the following properties:Diagonality: f(t, t, ..., t) = F(t)

Symmetry: f(t1, t2, ..., td) = f(tπ(1), tπ(2),..., tπ(d))for all permutations of indices π.

Multi‐affine: Σαk = 1

⇒ f(t1, t2, ..., Σαkti(k),..., td) 

= α1f(t1, t2, ..., ti(1), ..., td)+ ... +αn f(t1, t2, ...,  ti(n),,..., td)

Page 14: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 14 / 75

Polar Forms

Based on the same idea as on slide 9:• Model polynomial as multi‐affine function(multi‐affinity property)

• Plugging in a common parameter to obtain the original polynomial

• New: Symmetry property – makes the solution uniqueThere is exactly one polar form for each polynomial

This standardization makes different polars “compatible”,we can compare them with each other

We will see how this works in a few slides...

Page 15: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 15 / 75

Properties

Properties of polar forms:• The mapping from polynomials to their polar forms is one‐to‐one:

For each polar form f(t1,t2,...,tn),a unique polynomial F(t,t,...,t) exists

For each polynomial F,a unique polar form f(t1,t2,...,tn) exists

Page 16: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 16 / 75

Properties

Properties of polar forms:• Polar forms of monomials:

Degree 0:

Degree 1:

Degree 2:

Degree 3:

11 →

tt →→ ,11

2121 ,

2,11 tttttt →+

→→

3213321

3132212

,3

,3

,11

tttttttt

ttttttt

→++

++→→

Page 17: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 17 / 75

Properties

Properties of polar forms:• Polar forms of monomials:

Degree 0:

Degree 1:

Degree 2:

Degree 3:

0cf =

1101)( tcctf +=

21221

1021 2),( ttc

ttccttf +

++=

3213313221

2321

10321 33),,( tttcttttttctttcctttf +

+++

+++=

Page 18: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 18 / 75

Properties

General Case:

• The ci are the monomial coefficients.

• Idea: Use all possible subsets of ti to make it symmetric.

• This solution is unique.

• Without the symmetry property, there would be a large number of solutions.

∑ ∑ ∏=

=⊆ ∈

⎟⎟⎠

⎞⎜⎜⎝

⎛=

n

iiSnS Sj

iin tin

cttf0

||},..1{

1

1 ),...,(

Page 19: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 19 / 75

Generalizations

Blossoms for polynomial curves (points as output):• Polar form of a polynomial curve of degree d:

F:  R → Rn

f:   Rd → Rn

• Required Properties:Diagonality: f(t, t, ..., t) = F(t)

Symmetry: f(t1, t2, ..., td) = f(tπ(1), tπ(2),..., tπ(d))for all permutations of indices π.

Multi‐affine: Σαk = 1  ⇒ f(t1, t2, ..., Σαkti(k),..., td)

= α1f(t1, t2, ..., ti(1), ..., td) + ... + αn f(t1, t2, ...,  ti(n),,..., td)

new

Page 20: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 20 / 75

Generalizations

Blossoms with points as arguments:• Polar form degree d with points as input und output:

F: Rm → Rn

f: Rd×m → Rn

• Required Properties:Diagonality: f(t, t, ..., t) = F(t)

Symmetry: f(t1, t2, ..., td) = f(tπ(1), tπ(2),..., tπ(d))for all permutations of indices π.

Multi‐affine: Σαk = 1  ⇒ f(t1, t2, ..., Σαkti(k),..., td)

= α1f(t1, t2, ..., ti(1), ..., td) + ... + αn f(t1, t2, ...,  ti(n),,..., td)

new

Page 21: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 21 / 75

Generalizations

Vector arguments• We will have to distinguish between points and vectors(differences of points)

• Use “hat” notation v = p – q to denote vectors (differences of points)

• Also defined in the one dimensional case (vectors in R)

• One vector: 1 = 1 – 0, 1 = [1,...,1]T – 0

• Define shorthand notation (recursive):

^

)ˆ,...,ˆ,,,...,()ˆ,...,ˆ,,,...,(:)ˆ,...,ˆ,,...,(1

211

1

21111

−−

−−

− −=k

k

kn

kn

k

k

kn

kn

k

k

kn

kn vvqttfvvpttfvvttf

^

^

Page 22: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 22 / 75

Properties

Derivatives of blossoms:

• The ci are related to the derivatives at t = 0.

• Hence:

• In general:

∑ ∑ ∏=

=⊆ ∈

⎟⎟⎠

⎞⎜⎜⎝

⎛=

n

iiSnS Sj

iin tin

cttf0

||},..1{

1

1 ),...,(

)1̂,...,1̂,0,...,0(!

)0(

kkn

k

k

i fkn

k

Fdtd

c−

⎟⎟⎠

⎞⎜⎜⎝

⎛==

( ) )1̂,...,1̂,,...,(!

!)(kkn

k

kttf

knntF

dtd

−−=

Page 23: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 23 / 75

Example

Example:

122

3

321

2103210

3213313221

2321

10321

23

32

313

3301

311

31

!2!3)('

33),,(

ctctc

ttctcc

ttcttccttcttttcttcctf

tttcttttttctttcctttf

++=

⎟⎠

⎞⎜⎝

⎛ ++=

⎥⎦

⎤⎢⎣

⎡⎟⎠⎞

⎜⎝⎛ +

+++−⎟

⎠⎞

⎜⎝⎛ +

+++

+++=

+++

+++

+=

Page 24: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 24 / 75

Continuity Condition

Theorem: Continuity condition for polynomialsThe following statements are equivalent:

• F and G are Ck‐continuous at t

• ∀t1, ..., tk: f (t, ..., t, t1, ..., tk) = g(t, ..., t, t1, ..., tk)• f (t, ..., t, 1, ..., 1) = g(t, ..., t, 1, ..., 1) *)

*) 2 ⇔ 3: f(t, ..., t, t1) = f(t, ..., t,(t1 – 0))

= t1f(t, ..., t,1) ‐ f(t, ..., t, 0)

= t1f(t, ..., t,1)

k‐times k‐times

^ ^ ^ ^

^

Page 25: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 25 / 75

Continuity Condition

Examples:• ∀t1, t2, t3: f(t1, t2, t3) = g(t1, t2, t3) ⇒ same curve

• ∀t1, t2:  f(t1, t2, t) = g(t1, t2, t) ⇒ C2 at t

• ∀t1: f(t1, t, t) = g(t1, t, t) ⇒ C1 at t

• f(t, t, t) = g(t, t, t) ⇒ C0 at t

Page 26: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 26 / 75

Raising the Degree

Raising the degree of a blossom:• Can we directly construct a polar form with degree elevated by one from a lower degree one, without changing the polynomial?

• [other than transforming to monomials, adding 0∙td+1, and transforming back?]

Solution:• Given:

• We obtain: ∑+

=++−+

+

+=

1

1111111

)1( ),..,,,..,(1

1),..,(d

idiid ttttf

dttf

),..,( 1 dttf

leave out ti

Page 27: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 27 / 75

Raising the Degree

Proof:

),...,(

),....,(1

1

: ..),..,,,..,(1

1),..,(

1

1

1

1 111111

)1(

ttf

ttfd

tttttttfd

ttft

d

i

d

i ddii

=

+=

===+=∀

∑+

=

+

= +++−

+

)()()1( tFtF =⇒ +

Page 28: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 28 / 75

Polars and Control Points

Interpretation (Examples):• Multi‐variate function: f(t1, t2, t3)

Describes a point depending on three parameters

Where f(t1, t2, t3) moves for changing (t1, t2, t3) depends on f (think of storing monomial coefficients inside)

• Polynomial value: f(1.5, 1.5, 1.5)One value of the polynomial curve: F(1.5)

• Off‐curve points: f(1, 2, 3)Evaluate points not necessarily on the polynomial curve

Question: What meaning do various off‐curve points have?

We will use of‐curve points as control points

Page 29: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 29 / 75

Polars and Control Points

Interpretation (Examples):• Specifying f(t1, t2, t3):

Assume, f is not know yet

We want to determine a polar (i.e. a polynomial)

• On curve points:{f(0,0,0) = x0, f(1,1,1) = x1, f(2,2,2) = x2, f(3,3,3) = x3}

Degree d polynomial has d+1 degrees of freedom

We know already how to do polynomial interpolation

• Off‐curve points:{f(1,1,1) = x111, f(1,2,3) = x123, f(2,3,4) = x234, f(3,3,3) = x333}

We can also use off‐curve points to specify the polar/polynomial

This is the main motivation for the whole formalism

Page 30: Geometric Modeling - Max Planck Society

Polynomial Splines Revisited:Bezier Splines

Page 31: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 31 / 75

De Casteljau Algorithm

The de Casteljau algorithm is simple to state with blossoms:

• We just have to exchange the labels

• Then use the multi‐affinity property in order to compute intermediate points

• With this view, we can easily show that the de Casteljau algorithm is equivalent to the formulation based on Bernstein polynomials

Page 32: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 32 / 75

De Casteljau

p(0,0,0) 

p(0,0,1)  p(0,1,1) 

p(1,1,1)

p(0,0,t)

p(0,t,1)

p(t,1,1)

p(0,t,t) p(t,t,1)

p(t,t,t) = f(t)

Bezier control points: p(0,0,0), p(0,0,1), p(0,1,1), p(1,1,1)

Page 33: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 33 / 75

Analysis

Transforming a polar to the Bernstein basis:

[ ] [ ]

∑= −

−−⎟⎟⎠

⎞⎜⎜⎝

⎛=

=−−+−=

+−++−−=+−=

n

i iin

ini ttin

tttttttttt

tttttttttttttttttttttt

0

22

)1,..,1,0,..,0()1(

...)1,1,,..,()1,0,,..,()1(2)0,0,,..,()1(

)1,1,,..,()0,1,,..,()1()1,0,,..,()0,0,,..,()1()1()1,,..,()0,,..,()1(),...,(

f

fff

fffffff

Page 34: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 34 / 75

Analysis

De Castlejau Algorithm: Performs this in reverse order

• Bezier points:

• Intermediate points:

• Recursive computation:

Consequence: Bernstein / de Casteljau lead to the same result

),..,,1,..,1,0,..,0()()(

jijid

ji ttt

−−

= fp

)()()1(

)1,..,1,,..,,0,..,0()1,..,1,,..,,0,..,0()1(

)1,..,1,,..,,0,..,0()(

)1(1

)1(

1111

)(

tttt

tttttt

ttt

ji

ji

ijjidijjid

ijjid

ji

−+

+−−−−+−−

−−

+−=

+−=

=

pp

ff

fp

),1,..,1,0,..,0()()0(

iidi t

= fp

Page 35: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 35 / 75

Generalized Parameter Intervals

p(u,u,u) 

p(u,u,v)  p(u,v,v) 

p(v,v,v)

p(u,u,t)

p(u,t,v)

p(t,v,v)

p(u,t,t) p(t,t,v)

p(t,t,t) = f(t)

Bezier control points: p(u,u,u), p(u,u,v), p(u,v,v), p(v,v,v)

Page 36: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 36 / 75

Multiple Segments

p(0,0,0) 

p(0,0,1)  p(0,1,1) 

p(1,1,1)

p(0,0,t)

p(0,t,1)

p(t,1,1)

p(0,t,t) p(t,t,1)

p(t,t,t) = f(t)p(2,2,2) 

p(1,2,2) p(1,1,2) Bezier control points: 

p(0,0,0), p(0,0,1), p(0,1,1), p(1,1,1) = p(1,1,1), p(1,1,2), p(1,2,2), p(2,2,2)

Two Curve Segments:{p(0,0,0), p(0,0,1), p(0,1,1), p(1,1,1)}, {p(1,1,1), p(1,1,2), p(1,2,2), p(2,2,2)}

Remark: no interpolation between different segments(e.g.: combination of p(0,1,1) and p(2,1,1) is not defined)

p(1,1,1)

Page 37: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 37 / 75

More Observations

Derivatives:•

• C1 Continuity condition follows

p(0,0,0) 

p(0,0,1)  p(0,1,1) 

p(1,1,1)

p(0,0,t)

p(0,t,1)

p(t,1,1)

p(0,t,t) p(t,t,1)

p(t,t,t) = f(t)p(2,2,2) 

p(1,2,2) p(1,1,2) 

p(1,1,1)

( ) ) (degree ),,..,()1,,..,()1̂,,..,()(1

dtttftttfdttfdtFdtd

d

−+==−

)1('31 F

)1('31 F

Page 38: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 38 / 75

More Observations

Derivatives:• De Casteljau Algorithm computes tangent vectors at any point as a byproduct

• Proportional to last line segment that is bisected

p(0,0,0) 

p(0,0,1)  p(0,1,1) 

p(1,1,1)

p(0,0,t)

p(0,t,1)

p(t,1,1)

p(0,t,t) p(t,t,1)

p(t,t,t) = f(t)p(2,2,2) 

p(1,2,2) p(1,1,2) 

p(1,1,1)

)('31 tF

Page 39: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 39 / 75

More Observations

Subdivision:• After each de Casteljau step, we obtain two new control polygons left and right of f(t) describing the same curve.

• We can divide a segment into two.

• Recursive subdivision can be used for rendering

p(u,u,u) 

p(u,u,v)  p(u,v,v) 

p(v,v,v)

p(u,u,t)

p(u,t,v)

p(t,v,v)

p(u,t,t) p(t,t,v)

p(t,t,t)

Page 40: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 40 / 75

Observations

Remark: The de Casteljau algorithm for computing• Derivatives

at endpoints

at inner points t

• Subdivisions

hold for Bezier curves of arbitrary degree d ≥ 1.

(General degree derivatives: 1/d F’(t))

Page 41: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 41 / 75

More Bezier Curve Properties...

General degree elevation:• Increase the degree of a Bezier curve segment by one.

• What are the new control points?

Polar forms:• Old curve:

• New curve:),..,( 1 dttb

∑+

=++−+

+

+=

1

1111111

)1( ),..,,,..,(1

1),..,(d

idiid tttt

dtt bb

leave out ti

Page 42: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 42 / 75

Degree Elevation

)0,..,0()0,..,0(1

1)0,..,0(1

1

)1( bbb =+

= ∑+

=

+d

id

)0,..,0,1(1

)0,..,0(1

1)0..,0,1()1( bbb+

++

=+

dd

d

)0,..,0,1,1(11)0,..,0,1(

12)0..,0,1,1()1( bbb

+−

++

=+

dd

d

)0,1,..1(1

1)1,..,1,1,1(1

)0,1..,1,1,1()1( bbb+

++

=+

ddd

)1,..,1()1,..,1()1( bb =+

Page 43: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 43 / 75

Degree Elevation

Result: new control points

Repeated degree elevation:

Repeating degree elevation lets the control point converge to the Bezier curve in the limit (proof using Stirling’s formula).

range) ofout if points (zero1,...,0,1

11 1

)1( +=⎟⎠⎞

⎜⎝⎛

+−+

+= −

+ nini

ni

iii ppp

∑=

+

⎟⎟⎠

⎞⎜⎜⎝

⎛ +

⎟⎟⎠

⎞⎜⎜⎝

⎛−

⎟⎟⎠

⎞⎜⎜⎝

⎛=

d

jj

ki

jkdji

k

jd

1

)( pp (proof by induction)

Page 44: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 44 / 75

Variation Diminishing Property

Settings:• Given an original curve C(original) ⊆ R3

• Given a second curve R3 ⊇ C(derived) = f (C(original)) that is derived from the original by some mapping (algorithm) f.

• If for any arbitrary plane P, C(derived) does not have more intersections with P than C(original), the mapping f is called variation diminishing.

• Formally:  ∀ planes P: #(C(derived) ∩ P) ≤ #(C(original) ∩ P)

Mappings of interest:• Mapping from a control polygon to the curve segment

Page 45: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 45 / 75

Easy example

Very simple mapping:• Given a continuous curve C = p([a, b])

• The mapping f creates a linear approximation:the line through p(a) and p(b).

• This mapping is variation diminishingThe line segment intersects the plane at most once

If this is the case, the original curve must have at least one intersection, too, because of continuity

p(a)

p(b)

Cf (C) P

Page 46: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 46 / 75

Another Example

Piecewise linear approximation:• Obviously, a piecewise linear approximation of a curve (approximating with a polygon) is variation diminishing, too.

p(a)

p(b)

C

f (C) P

Page 47: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 47 / 75

Bezier Curves

Bezier curves are variation diminishing:• The Bezier curve is the limit of the control point sequence for infinite degree elevation.

• Every degree elevation step produces a piecewise linear approximation of the original control polygon, which is variation diminishing.

iii ni

ni ppp ⎟

⎠⎞

⎜⎝⎛

+−+

+= −

+

11

1 1)1(

Degree Elevation:p1(+1)

p2(+1)

p3(+1)

p0

p1 p2

p3

p0(+1) p4(+1)

Page 48: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 48 / 75

Bezier Curves

Consequence:• A Bezier curve does not intersect any plane more frequently than its control polygon.

• Therefore, it cannot have too weird oscillations.

• HoweverThe convergence of degree elevation is very slow

Not useful as evaluation technique in practice

One can approximate arbitrary smooth functions in a convergent way using the Bernstein basis (Weierstraß approximation theorem). But:

– The convergence rate is not satisfactory in practice.

– We do not have local control.

Page 49: Geometric Modeling - Max Planck Society

Polynomial Splines Revisited:B‐Splines

Page 50: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 50 / 75

B‐Spline Curves

(General) B‐Spline Curves: • Given:

A degree d (constant for the whole curve)

A knot sequence (t0, t1, ..., tn) with t0 ≤ t1 ≤ ... ≤ tnControl points p0, p1, ..., pm (m = n – d + 1)

• With this information, we want to construct the spline curve within t = [td,...,tn‐d]

• Each polynomial segment fi(t) is defined by the d + 1 control points pi,..., pi+d.

• Within each such segment / control point set, we can apply linear interpolation based on blossoms to compute points on the curve.

Page 51: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 51 / 75

De Boor Algorithm

Blossoming version of the de Boor algorithm:• The de Boor algorithm will appear as a generalization of the de Casteljau algorithm

similar structure

de Casteljau as a special case (special knot sequence)

Page 52: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 52 / 75

De Boor Algorithm

Blossoming definition of B‐Splines: very simple• The control point sequence is given as:p0 = p(t0,...,td‐1)

...

pi = p(ti,...,ti+d‐1)...

pm= p(tn‐d+1,...,tn)

• This means: we just use consecutive knot values as blossom arguments

• Then, we proceed as before

• Same computational scheme as de Casteljau, but different weights (because of the different knot values)

Page 53: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 53 / 75

De Boor Algorithm

For simplicity, we will first look at a single B‐spline segment:

• Knots (t0, t1, ..., t2d‐1)

• Control points p0, p1, ..., pd‐1• B‐spline segment within [td...td+1]

Interpolation rule:• Given blossoms f(a, t1, ..., td‐1), f(b, t1, ..., td‐1)

• We obtain f(t, t1, ..., td‐1) as:

),..,,(1),..,,(),..,,( 111111 −−− ⎥⎦

⎤⎢⎣

⎡−−

−+−−

= ddd ttbfabtbttaf

abtbtttf

Page 54: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 54 / 75

De Boor Algorithm

p(3,1,2)

p(0,1,2)p(t,1,2)

p(4,2,3)

p(1,2,3)p(t,3,2)

33 t−

p(5,3,4)

p(2,3,4)p(t,3,4)

p(t,t,2)

p(t,t,3)

p(t,t,t)

⎥⎦⎤

⎢⎣⎡ −

−+3

31 t

34 t−

⎥⎦⎤

⎢⎣⎡ −

−+3

41 t

35 t−

⎥⎦⎤

⎢⎣⎡ −

−+3

51 t

23 t−

⎥⎦⎤

⎢⎣⎡ −

−+2

31 t

24 t−

⎥⎦⎤

⎢⎣⎡ −

−+2

41 t

13 t−

⎥⎦⎤

⎢⎣⎡ −

−+1

31 t

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

61

21

61

41

41

21

Page 55: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 55 / 75

Example: General Case

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

p(4,5,6)

p(5,6,7)

p(6,7,8)

p(7,8,9)

p(8,9,10)

p(9,10,11)

Page 56: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 56 / 75

Example: General Case

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

p(4,5,6)

p(5,6,7)

p(6,7,8)

p(7,8,9)

p(8,9,10)

p(9,10,11)

Page 57: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 57 / 75

Example: General Case

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

p(4,5,6)

p(5,6,7)

p(6,7,8)

p(7,8,9)

p(8,9,10)

p(9,10,11)

Page 58: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 58 / 75

Example: General Case

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

p(4,5,6)

p(5,6,7)

p(6,7,8)

p(7,8,9)

p(8,9,10)

p(9,10,11)

Page 59: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 59 / 75

De Boor Algorithm

De Boor Algorithm:• In order to evaluate f (t) for a t ∈ [ti‐1,...,ti)• Compute:

( ) ( )

)(Output

),(1)()(

: increasingFor

1

11

1)(11

)(1)(

)0(

t

ttttttt

j

di

ijdi

iji

ji

ji

ji

ji

ji

ii

−−−+

−−−

−−

=−+=

=

p

ppp

pp

ααα

Page 60: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 60 / 75

Smoothness

Multiplied Control Points:• Quadratic B‐Spline Curve (two segments)

p(0,1)p(2,3)

p(1,2)

p(3,4)

f1: 0,1,2,3,4

f1

f2

p(0,1)p(1,2)p(2,3)

f2: 0,1,2,3,4

p(1,2)p(2,3)p(3,4)

interval [1,2]

interval [2,3]

Page 61: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 61 / 75

Smoothness

Multiplied Control Points:• Double end points → interpolated (c.f. de Casteljau)

p(1,1)p(2,3)

p(1,2)

p(3,3)

f1 f2

f1: 1,1,2,3,3

p(1,1)p(1,2)p(2,3)

f2: 1,1,2,3,3

p(1,2)p(2,3)p(3,3)

interval [1,2]

interval [2,3]

Page 62: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 62 / 75

Smoothness

Multiplied Control Points:• Double inner node: reduces continuity by one.

p(1,1)p(2,2)

p(1,2)

p(2,3)

p(3,3)f1: 1,1,2,2,3,3

p(1,1)p(1,2)p(2,2)

f2: 1,1,2,2,3,3

p(2,2)p(2,3)p(3,3)

f2: 1,1,2,2,3,3interval [2,2]

interval [1,2]

interval [2,3]

Page 63: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 63 / 75

Smoothness

Multiplied Control Points: Blossoming• Assume a control point contains one knot value v with multiplicity k.

• Through repeated linear interpolation, we can transform the blossoms for the left and right spline segment to:

• This means, we have at least Cd‐k continuity.

( )k

kdvvvv −,..,,,.., 1p ( )k

kdvvvv −,..,,,.., 1pand .

Page 64: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 64 / 75

Example

p(0,1)p(2,3)

p(1,2)

p(3,4)p(2,2)p(2,2)

f1(0,1) = p(0,1)f1(1,2) = p(1,2)f1(2,3) = p(2,3)

f2(1,2) = p(1,2)f2(2,3) = p(2,3)f2(3,4) = p(3,4)

⇒ f1(t,2) = f2(t,2)

Page 65: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 65 / 75

Smoothness

p(1,1)p(2,2)

p(1,2)

p(2,3)

p(3,3)

f1(1,1) = p(1,1)f1(1,2) = p(1,2)f1(2,2) = p(2,2)

f2(2,2) = p(2,2)f2(2,3) = p(2,3)f2(3,3) = p(3,3)

⇒ f1(2,2) = f2(2,2)

Page 66: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 66 / 75

Connection to Bezier Splines

Special case:• We can model Bezier splines through non‐uniform B‐Splines using a knot sequence [a,...,a, b,...,b].

• For this knot sequence, the de Boor algorithm yields exactly the de Castlejau Algorithm.

• Therefore: the de Boor algorithm is a generalization of the de Casteljau algorithm.

• We can also insert Bezier segments somewhere into a B‐spline.

• Interpolating end conditions are “half a Bezier segment”.

d d

Page 67: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 67 / 75

Conversion to Bezier Splines

Converting a B‐spline segment to a Bezier segment:

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

Page 68: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 68 / 75

Conversion to Bezier Splines

Converting a B‐spline segment to a Bezier segment:

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

p(1,2,2) p(3,3,4)

Page 69: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 69 / 75

Conversion to Bezier Splines

Converting a B‐spline segment to a Bezier segment:

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

p(1,2,2) p(3,3,4)

p(2,2,3) p(2,3,3)

Page 70: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 70 / 75

Conversion to Bezier Splines

Converting a B‐spline segment to a Bezier segment:

p(0,1,2)

p(1,2,3)p(2,3,4)

p(3,4,5)

p(1,2,2) p(3,3,4)

p(2,2,3) p(2,3,3)

p(2,2,2) p(3,3,3)

Page 71: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 71 / 75

Knot Insertion

Problem:• Given a B‐spline curve

• Insert a new knot value & a new control point in between two existing ones

• Without changing the curve

Very simple solution using blossoms

Page 72: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 72 / 75

Quadratic Example

p(0,1)p(2,3)

p(1,2)

0 1 2 3

Page 73: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 73 / 75

Quadratic Example

p(0,1)p(2,3)

p(1,2)

0 1 2 31.5

p(1,1.5) p(2,1.5)

p(1,1.5) p(2,1.5)

Page 74: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 74 / 75

Quadratic Example

p(0,1)p(2,3)

p(1,2)

p(1,1.5)

0 1 2 31.5

p(2,1.5)41

41

43

43

Page 75: Geometric Modeling - Max Planck Society

Geometric Modeling SoSem 2010  – Blossoming and Polar Forms 75 / 75

General Algorithm

The general case:• Interval with knot to be added: (ti, ..., ti+2d‐1)

• Execute one step of the de Boor algorithm

• This creates new control pointsKeep the outer points p(ti, ..., ti+d‐1), p(ti+1, ..., ti+2d‐1)

Replace the inner points p(ti+1, ..., ti+d), p(ti, ..., ti+d‐2) with the newly created points from the de Boor step

• This will...Insert one knot value

And insert one additional control point

Change the existing control points, except the outermost