Global Knot Insertion Algorithms - TAMU Computer Science People ...

5 downloads 0 Views 172KB Size Report
Properties of the Blossom. Existence and Uniqueness. • Every Degree n Polynomial P(t) has a Unique Blossom p(u1. ,...,un. ) Power Law. • Each Parameter u1.
Global Knot Insertion Algorithms Scott Schaefer Department of Computer Science Texas A&M University

Ron Goldman Department of Computer Science Rice University

Part I: Introduction to Knot Insertion

Knot Insertion Algorithm Input





T = {t1,K,tν +n } -- knot sequence



P = {P0 ,K,Pν } -- control points



Γ = {τ1,K,τ µ +n } -- new knot sequence -- Γ ⊃ T

€ Output €



€ Q = {Q0 ,K,Qµ } -- new control points

Constraint € •



ν

µ

k=0

k =0

∑ N k,n(t | T )Pk = ∑ N k,n(τ | Γ)Qk

B-spline Curve

P1

• P2

• •

S(τ )





• P3

P0 •€





Knot Insertion

P1









Q1

Q0



Q2

• P2



S(τ ) €

•=€P



0



Q3



Q4 = P3

Theorems Existence •

All splines are B-splines.

Convergence •

The control polygons generated by knot insertion converge to the B-spline curve for the original control polygon as the knot spacing approaches zero.

Corner Cutting •

Knot insertion is a corner cutting procedure.

Applications of Knot Insertion



Rendering



Intersection



Conversion from B-spline to Piecewise Bezier Form



Proof of the Variation Diminishing Property

Types of Knot Insertion Algorithms

Local Knot Insertion •

T = {t1,K,tν +n }



Γ = {t1 ,K,tk , uk,1 ,K,uk,d k , t k+1,K,tv+n }

€ €

€ €

Global Knot Insertion •

T = {t1,K,tν +n }



Γ = {t1 , u1,1 ,K,u1,d1 , t2 ,K,tv+n −1, uv+n−1,1,K,uv+n−1,dv+ n−1 ,tv+n }

Examples of Knot Insertion Algorithms

Local Knot Insertion Algorithms

Global Knot Insertion Algorithms



Boehm’s Algorithm



Chaikin’s Algorithm



Oslo Algorithm



Lane-Riesenfeld Algorithm



Sablonniere’s Algorithm



Goldman-Warren Algorithm



Factored Knot Insertion



Schaefer’s Algorithm -- NEW

Myths Global Knot Insertion •

Works Only for Uniform Knot Sequences -- Knots in Arithmetic Progression -- Lane-Riesenfeld (1973) tk +1 = tk + α -- Knots in Geometric or Affine Progression -- Goldman-Warren (1993) tk +1 = β t k + α

€ •

Does not Apply to Arbitrary Knot Sequences

€ Blossoming •

Provides Only New Proofs of Already Known Results -- No New Results -- No New Insights

Part II: Local Knot Insertion Algorithms

Knot Insertion Algorithms from Blossoming



Boehm’s Algorithm -- Inserts one new knot at a time



Oslo Algorithm -- Computes one new control point at a time



Sablonniere’s Algorithm -- Local change of basis algorithm



Factored Knot Insertion -- Forward differencing for knot insertion

Blossoming Symmetry •

p(u1 ,...,un ) = p(uσ (1) ,...,uσ (n) ) for any permutation σ of {1,...,n}

Multiaffine €



€ € p(u1 ,...,(1− α )uk + αwk ,...,un ) = (1− α ) p(u1,...,u k ,...,un ) + αp(u1,...,wk ,...,un )

Diagonal €



p(t,...,t { ) = P(t) n

Dual Functional Property €

€ €



P(t) = ∑k N k,n (t)Pk ⇒ Pk = p(t k +1,K,tk +n )

(B-spline Curves)



P(t) = ∑k Bkn (t)Pk ⇒ Pk = p(a,K,a 123,b,K,b 123 )

(Bezier Curves)

n−k

k

Properties of the Blossom

Existence and Uniqueness • Every Degree n Polynomial P(t) has a Unique Blossom p(u1 ,...,un )

Power Law

€ € • Each Parameter u1,..., un Appears to at Most the First Power • Equivalent to Multiaffine Axiom

Examples (Existence) Monomials P(t) = 1 ⇒

p(u1 ,u2 ,u3 ) = 1

P(t) = t ⇒

p(u1 ,u2 ,u3 ) =

P(t) = t 2

u1 + u2 + u3 3

⇒ p(u1 ,u2 ,u3 ) =

u1u2 + u2 u3 + u3u1 3

P(t) = t 3 ⇒ p(u1 ,u2 ,u3 ) = u1u2 u3 Cubics P(t) = a3 t 3 + a2 t 2 + a1t + a0 p(u1 ,u2 ,u3 ) = a3 u1u2 u3 + a2

u1u2 + u2 u3 + u3 u1 u + u + u3 + a1 1 2 + a0 3 3

Blossoming Diagrams -- Multiaffine Property

p(t 2 ,t 3,u)

t4 − u t 4 − t1 €







u − t1 t 4 − t1

p(t1, t 2,t 3 )

p(t 2 ,t 3,t 4 )

Normalized





u=

t 2 t 3u



t4 − u

u − t1

€ t1t2 t3

t2 t3t4

Unnormalized €

t 4 − u € u − t1 t −u u − t1 t1 + t 4 ⇒ p(t2 ,t3 ,u) = 4 p(t1 ,t2t 3 ) + p(t2 ,t3 ,t 4 ) t4 − t1 t4 − t1 t4 − t1 t 4 − t1

p(t2 ,t3 ,u) =

t4 − u u − t1 t −u u − t1 p(t1,t2t3 ) + p(t2 ,t3 ,t4 ) ⇔ t2t 3u = 4 t1t 2t3 + t2t3t 4 t 4 − t1 t4 − t1 t 4 − t1 t4 − t1

Blossoming Diagrams -- Multiaffine Property

t2 Ltn u u − t1

tn+1 − u € t1 Lt n

t2 Ltn+1





t −u u − t1 u = n+1 t1 + t n+1 tn+1 − t1 tn+1 − t1



€ t −u u − t1 p(t2 ,K,tn ,u) = n+1 p(t1,K,tn ) + p(t2 ,K,tn+1 ) t − t t − t n+1 1 n+1 1 €





t2 Ltn u =

tn+1 − u u − t1 t1 Ltn + t2 Ltn+1 tn+1 − t1 tn+1 − t1

Boehm’s Algorithm

New Control Points

t4 − u



t1t2 t3

t 4t5u

t3t 4u

t2 t3u u − t1 t5 − u

t −u u − t2 6

t2 t3t4

t3t 4t5

Original Control Points Original Knot Sequence:

€ New Knot Sequence:

€ €

K,t1,t 2 ,t 3 ,t 4 ,t5 ,t 6 ,K K,t1,t 2 ,t 3 ,u,t 4 ,t 5 ,t6 ,K

u − t3 t 4t5t6

Oslo Algorithm New Control Point

u1u2u3 t 4 − u3

u3 − t3

t3u1u2

t 4u1u2 u2 − t 2 t5 − u2

t 4 − u2

t2 t3u1

u2 − t3

t3t 4u1

t 4t5u1

t 4 − u1

u1 − t1 t5 − u1

t −u u1 − t2 6 1

t1t2 t3

t2 t3t4

t3t 4t5

u1 − t3 t 4t5t6

Original Control Points Original Knot Sequence: New Knot Sequence:





K,t1,t 2 ,t 3 ,t 4 ,t5 ,t 6 ,K K,t1,t 2 ,t 3 ,u1,K,u d ,t 4 ,t5 ,t 6 ,K

Part III: Global Knot Insertion Algorithms

Chaikin’s Algorithm: Quadratic B-splines -- Uniform Knots

3P0 + P1 4



P0

€ P 0













P1 + 3P2 4

3P2 + P3 4

P2 + 3P3 4

L



P0 + P1 € 2

P0

3P1 + P2 4

P0 + 3P1 4

P1

P1 €





P1 + P2€ 2

P1



P2

P2

Split and Average € €



€ P2 + P3 2

P3



€ P3

P2



€ €

L P3

L

Lane-Riesenfeld Algorithm: Cubic B-splines -- Uniform Knots 4P0 + 4P1 8





€ P 0



3P0 + P1€ 4

P0

P0 + 3P1€ 3P1 + P2€ P1 + 3P2 4 4 4

€ P0 + P1 € 2

€ P0



P0 +6P1 + P2 4P1 + 4P2 P1 + 6P2 + P3 4P2 + 4P3 8 8 8 8





P1 + P2 € 2

P1 €

P1 €



P1



€3P + P 2 3 4

P2

P2

Split and Average € €





€ P2 + P3 2

L

P2 + 3P3 4 €

P3

€ € P3

P2



€ €

L

L P3

L

Proofs of Lane-Riesenfeld Algorithm 1. Continuous Convolution of B-spline Basis Functions J. LANE and R. RIESENFELD (1980): A theoretical development for the computer generation and display of piecewise polynomial surfaces. IEEE Transactions on Pattern Analysis and Machine Intelligence 2, pp. 35–46. 2. De Boor Recurrence (Induction) R. GOLDMAN and J. WARREN (1993): An extension of Chaikin’s algorithm to B-spline curves with knots in geometric progression, CVGIP: Graphical Models and Image Processing, Vol. 35, pp. 58-62. 2′. De Boor Recurrence (Induction) ⇒ Oslo Algorithm H. PRAUTZSCH (1984): A short proof of the Oslo Algorithm, Computer Aided €

Geometric Design, Vol. 1, pp. € 95-96.

New Proof of Lane-Riesenfeld Algorithm 3. Blossoming E. VOUGA and R. GOLDMAN (2006): Two Blossoming Proofs of the Lane-Riesenfeld Algorithm -- Dagstuhl Conference on Geometric Modeling 2005, to appear in Computing.



Lane-Riesenfeld Algorithm -- Blossoming Interpretation Quadratic B-splines

1 2 ,1

01



€ 01 €

11 €

01

12 €

12





112 ,2

1,112

23 €

22 € 12





212 ,3

2,212

34

33 23

23 €

3,312



34

Uniform Knots















34

Lane-Riesenfeld Algorithm Quadratic B-splines 1. Double the Control Points 2. Convert to Piecewise Bezier Form 3. Insert New Knots Using Boehm’s Knot Insertion Algorithm

Lane-Riesenfeld Algorithm -- Quadratic B-splines

u0t1



t0t1

t0t1 €







t1u1 t1t1 €

€ t0t1

€ €



t1t2 €

t1t2 €



t2u2

u1t2

u=

t2t2 € t1t2



t2t 3 €

Arbitrary Knots

u2t 3 t2t 3 €

t3 u 3

t3t 3 t2t 3 €

tk+1 − u u − tk t + t k+1 € k € tk+1 − tk t k+1 − tk €

t 3t 4

t3t 4



t 3t 4

Schaefer’s Algorithm -- Quadratic B-splines

u0t1



t0t1

t0t1 €



u0t1 €

t0t1





t1u1

u1t2

t1t2 €

t2 u 2

u1t2 €

t1t2 t2t 3 t1t2 €Arbitrary € € Knots

u2t 3 t2t 3



L

u2t 3 €

t2t 3

L t 3t 4 €









u= €

tk+1 − u u€ − tk t + t k+1€ € k tk+1 − tk t k+1 − tk

L

Quadratic B-splines Schaefer’s Algorithm •

Inserts New Knots in First Round



Not Necessary to Convert to Piecewise Bezier Form



Faster than Lane-Riesenfeld -- Half the Work in the Second Round

Knot Insertion: Quadratic B-splines

t2t 3 t2u 2 €

€ €

u2t 3

t3u 3

t3t 4 u3t 4



€ t4 u 4



u1t2

t4 t 5

t1t2



€ € €

Lane − Riesenfeld:

= t k t k+1

Schaefer:

= u k t k+1

€ €





Lane-Riesenfeld Algorithm -- Cubic B-splines

? 112 , 2,212

1,112 ,2



3 4 ,1,2





012

012 €



4 ,1,2 €



012



€9



2,212 ,3

7 4 ,2,3



€ 13 4

3,312 ,4 L

3,4,17 4 L

,2, 3 3,11 4 ,4 € €

123 €

234 345 L 2,212 ,3 3,312 ,4 € € € 123 234 234 345 345 € € € €





1,112 ,2 € €

? 212 , 2,312

123 €

Uniform Knots









L

Lane-Riesenfeld Algorithm -- Cubic B-splines

?



€ 9 3 ,1,2 ,1,2 4 4 € €

012 €

€ 012



1,112 ,2 €

012 €



€(94 ,1,2) = 1€(1,112 ,2) + 1 (1,2, € 3)

2 2 1 1 ( 74 ,2, 3) = (1,2,3) + (2,212 ,3) 2 2 €

€ €

2,212 ,3

112 ,2,212

1,112 ,2

7 4 ,2,3

123 €

123 €

13 4 ,2, 3

2,212 ,3

123 €

234 234

234

1 1 2 1 (1,12 ,2) + (1,2, 3) + (2,212 ,3) 4 4 4 € 1 € 32 €  1 ⇒ ? = (1,112 ,2) +  (1,2, 3) + (2,212 ,3)  4 4 3 3 1 3 ? = (1,112 ,2) + (112 ,2, 3) = 112 ,2,2 12 4 4 ?=

(

)



Lane-Riesenfeld Algorithm -- Quartic B-splines

??





1223

1123

0123 €

€ 0123 €



1233

1223 €

0123 €





??

??

?





2234

1234 €

1234 €

2334

?



2344 € €

2334 €

1234 €

?? 3445 3345

3455 3456

2345 3445 €

2345 €

2345 €

3456

Uniform Knots















3456

Lane-Riesenfeld Algorithm •

Build Algorithm for Next Degree Atop Algorithm for Previous Degree



Append One Additional Round of Averaging



Harder and Harder to Prove by Blossoming



Schaefer’s Algorithm -- Cubic B-splines

t1u1t 2

t0t1t2 €



€ t0t1t2 € €

t1u1t 2 u1t2 t 3 t2u 2t 3 € € €

u0t1t2 €



u2t 3t 4

L



t3u 3t 4

L



u0t1t2 €

t1t2 t 3 u1t2 t 3 t2t 3t 4 u2t 3t 4 t t t 3 4 5 L € € € t1t2 t 3 t1t2 t 3 t2t 3t 4 t2t 3t 4 t3t 4 t5€ t3t 4 t5 € € € Arbitrary Knots €

t0t1t2 € €

u1t2 u2 t2u 2t 3 u2t 3u 3 t3u 3t 4

€ €

u −tj tk − u u= tj + tk t − t t − t € k j€ k j €





L

Schaefer’s Algorithm Cubic B-splines •

Build Atop Algorithm for Quadratic B-splines



Append Next Original Knot to Each of the Blossoms on the First Two Stages -- Example: u0t1 → u0t1t2



Promote Every Other Point to the Next Stage with No Additional Computation

€ New Knots Using the Multiaffine Property of the Blossom • Introduce •

Easy to Prove by Blossoming



Alternative Algorithm -- Cubic B-splines

t1u1t 2 u1t2 u2 t2u 2t 3 u2t 3u 3 t3u 3t 4 L u0t1t2 €



u2t 3t 4 t3u 3t 4 L €

t2t 3t 4 t3t 3t 4 t3t 4 t5 L € € t1t2 t 3 t2t 3t 4 t2t 3t 4 t3t 4 t5 t3t 4 t5 L € € Arbitrary Knots €

t0t1t2 €

t1t1t 2 t1t2 t 3 € €

t0t1t2 t0t1t2 € €

t1t2 t 3 €

€ €

t1u1t 2 u1t2 t 3 t2u 2t 3 € € €



t2t 2t 3 €







€ €

u=



u −tj tk − u tj + tk tk − t j€ t k − t j €



Problem Observation •

Schaefer’s Algorithm does not Reduce to the Lane-Riesenfeld Algorithm when the Knots are Uniformly Spaced.

Questions •

Does there Exist a Global Knot Insertion Algorithm that Reduces to the Lane-Riesenfeld Algorithm for Uniform Knots?



If Such an Algorithm Exists, is it Unique?

Lane-Riesenfeld Algorithm: Cubic B-splines -- Arbitrary Knots t2u2t 3

u2t 3u3

v3 − u2 v3 − w2

t4 − t 3 € t4 − t2

u1t2 u2

€t t v 12 2



€ €

€ €



t0t1t2

t3 − t2 t3 − t1

t3 − u2 € t −t 3 2 €

t1u1t2

t3 − u1 t3 − t 0 €

vk = t k +1 − €

€t t w 23 2 t2 − u1 €t2 − t1

t1t2t 3

€ t1t2t 3

t2t3v3

t3t4 w3

L

t4 − u3 t3 − u2 €t − t € 4 3 t3 − t 2 €t u t € 2 2 3 t2t3t 4 t3u 3t 4 t4 − u2 € t4 − t1





L

t1t2t 3

(tk +1 − u k−1 )(t k+1 € − uk ) (t€ k +1 − tk ) €

€ € t2t3t 4



t2t3t 4

t€5 − u3 t5 − t 2

L t3t4 t5

(u − t )(t − u € ) wk = uk − € k k−1 k k −1 . (t − t ) k€ k−1 €



L

Lane-Riesenfeld Algorithm: Cubic B-splines -- Arbitrary Knots t2u2t 3

u1t2 u2

α2 t1t2€ (t0 + 3t 3 ) / 4

L

u2t 3u3

1− α2 1− γ 2

γ2 α3

€t t v 23 2

€ t2t3 (t1 + 3t 4 ) / 4



1− α 3 t3t4 v3



L

€ 1−€β2 β2 € 1 € 1€ β3 1− β3 € 2 2 € € € € t1t2 (t0 + t 3 ) / 2 t2t3 (t1 + t 4 ) / 2 t1t2t 3 t2t3t 4 t3t4 (t2 + t 5 ) / 2 € € € € 1 1 €1 1 € 1 € 2 2 2 2 2 € € € € t0t1t2 t1t2t 3 t1t2t 3 t2t3t 4 t2t3t 4 t3t4 t5

L



€ €

€ €



€ €



€ €





L

Parameters for Lane-Riesenfeld Algorithm





αk =

4(tk +1 − u k−1 )(t k+1 − uk ) (t k+1 − t k−2 )(t k+1 − t k−1 )

βk =

γk =

4(uk − vk ) t k−1 + 3t k +2 − 4vk

vk = t k −1 +





2(uk − t k−1 )(u k−1 − t k−1 ) (tk +2 − t k−1 )(t k+1 − t k−1 )(1− α k )

βk (tk +2 − t k−1 ) . 2

Summary Global Knot Insertion Algorithms •

Exist for Arbitrary Knot Sequences



Are Easily Derived from Blossoming

Open Problems 1. Find a Global Knot Insertion Algorithm for Arbitrary Degree that Reduces to the Lane-Riesenfeld Algorithm for Uniform Knots.

2. Find the Simplest Knot Insertion Algorithm for Arbitrary Degree that Reduces to the Lane-Riesenfeld Algorithm for Uniform Knots. •

How Complicated are the Labels Along the Edges?

Suggest Documents