• No results found

An Issue

N/A
N/A
Protected

Academic year: 2022

Share "An Issue"

Copied!
27
0
0

Loading.... (view fulltext now)

Full text

(1)

Title Page

Contents

JJ II

J I

Page1of27

Go Back

Full Screen

Close

B-Splines

Milind Sohoni

http://www.cse.iitb.ac.in/˜ sohoni

(2)

Title Page

Contents

JJ II

J I

Page2of27

Go Back

Full Screen

Close

An Issue

Suppose we are to model a long curve with many convolutions. How does the bezier paradigm do?

Option1: Use as many control points as required to model the curve:

Control Polygon

Curve

Problem with this is that as the number of control points increase, the time to evaluation, which is

O (n

2

)

increases as a square in this quantity. This can be very expensive.

(3)

Title Page

Contents

JJ II

J I

Page3of27

Go Back

Full Screen

Close

Option 2

Option 2: Break up the curve into many parts and model separately.

Curve 2 Curve 3 Curve 1

Polygon1

Polygon3

Polygon2

p0 p1

p2

p3

This is a good option except that continuity at the junction points

p1, p

2

, p

3 and

p

4 poses some problems.

C0-continuity is easy to impose; just make sure that the last control point of

C

1 equals the first of

C

2.

(4)

Title Page

Contents

JJ II

J I

Page4of27

Go Back

Full Screen

Close

Higher Continuities?

Curve 2 Curve 3 Curve 1

Polygon1

Polygon3

Polygon2

p0 p1

p2

p3

• C1-continuity is a bit more tedious: the last span of the control polygon

P

1 should be colinear with the first of

P

2.

• C2-continuity is even more tedious.

So if this jugglery can be managed, then Option 2 is acceptable.

(5)

Title Page

Contents

JJ II

J I

Page5of27

Go Back

Full Screen

Close

Piece-wise Polynomials

Fix

• a degree D.

a sequence

α

1

< α

2

< . . . < α

k of real numbers.

A function

f : [α

1

, α

k

]

→ R is a piece-wise polynomial for the above data if there are polynomials

p

1

(t), . . . , p

k1

(t)

of degree atmost

D

such that

f (t) = p

i

(t)

whenever

t

i

, α

i+1

]

.

α1 α2 α3 α4

p1

p2

p3

Notice that

f

appears to be

C

0-continuous at

α

2 and

C

1-continuous at

α

2.

(6)

Title Page

Contents

JJ II

J I

Page6of27

Go Back

Full Screen

Close

Defect

Question: What is the maximum

k so that p

1

and p

2

are C

k

-continuous at α

2

?

Answer: Obviously the degree

D, in which case p

1

and p

2

are

identical

Indeed, the D + 1 relations that p

1

2

) = p

2

2

) and p

01

2

) = p

02

2

) and so on till P

1D

1

) = p

D2

2

) enforce that p

1

= p

2

.

Let f = (p

1

, . . . , p

k1

) be a piece-polynomial. We say that f has a defect of (atmost) d at α

1

if:

pi12) = pi22) for i = 0,1, . . . , D −d.

(7)

Title Page

Contents

JJ II

J I

Page7of27

Go Back

Full Screen

Close

Free Dimensions

Thus if

p

1 is known and the defect at

α

2 is

d

2 then there are exactly

d

2 more conditions needed to define

p

2 completely. Carrying on like this, we see that, roughly speaking, the degrees of freedom for a piece-wise polynomial function

f

is

D + 1 + d

2

+ d

3

+ . . . + d

k1

α1 α2 α3 α4

p1

p2

p3

d3 f

d2

D+1 +d2 +d3 =D+d2+d3+1

(8)

Title Page

Contents

JJ II

J I

Page8of27

Go Back

Full Screen

Close

Knot Vector

The data

D, (α

1

, . . . , α

k

)

and the prescribed maximum defects

d

2

, . . . , d

k1 are succintly expressed in the format of a knot vector

Knot Vector:

β = [β

1

β

2

. . .

β

m

]

such that:

• No entry occurs more than

D

times.

β

1

= β

2

= . . . = β

D and

β

mD+1

= β

mD+2

= . . . + β

m.

D

is called the degree of the knot-vector,

m

its length. For a

β

β

, the multiplicity of

β

is the number of occurrences of

β

in

β

.

Examples:

S = [0, 0, 0, 1, 1, 1]

: This is the standard bezier knot vector of degree

3

.

O = [0, 0, 0, 2, 4, 4, 4]

, degree

3

and length

7

.

A = [0, 0, 0, 2, 2, 4, 4, 4]

, degree

3

and length

8

.

B = [0, 0, 0, 1, 2, 2, 4, 4, 4]

, degree

3

and length

9

.

D = [0, 0, 0, 1, 2, 2, 3, 4, 4, 4]

, degree

3

and length

10

.

(9)

Title Page

Contents

JJ II

J I

Page9of27

Go Back

Full Screen

Close

Interpretation: A Small Example

Lets look at

[00122]

.

V ([00122])

will denote the space of all piece-wise polynomial functions of degree

2

on

[0, 2]

withdefect 1at

1

.

00 1

convention

22 defect

Thus

V

consists of two degree

2

polynomials

p

1

, p

2 such that:

(i)

p

11

(1) = p

12

(1)

(ii)

p

01

(1) = p

02

(1)

Since

p

1

= a

0

+ a

1

t + a

2

t

2, and

p

2

= b

0

+ b

1

t + b

2

t

2, we have

6

variables and

2

relations between these variables. The relations are:

a

0

+ a

1

+ a

2

= b

0

+ b

1

+ b

2 and

2a

2

+ a

1

= 2b

2

+ b

1 Thus dimension of

V

is

4

.

(10)

Title Page

Contents

JJ II

J I

Page10of27

Go Back

Full Screen

Close

Pictorially, a larger example

000 22 444

000 1 22 444

000 2 444

defect increases by 1

4 variables and 3 equations added convention defect dimension

5

6

7

Thus by an insertion of a knot, the dimension increases by exactly

1

. It is easy to show now that:

dim(V (A)) = length(V (A))

D + 1

(11)

Title Page

Contents

JJ II

J I

Page11of27

Go Back

Full Screen

Close

Interpretation: More Examples

V (S) = V [000111]

is space of all cubic polynomial functions on

[0, 1]

.

V (O) = V [0002444]

is the space of allpiece-wisepolynomial functions on

[0, 4]

with defect 1 at

2

.

V (A) = V [00022444]

is the space of all piece-wise polynomial func- tions on

[0, 4]

with defect 2 at

2

.

V (B) = V [000122444]

is the space of all piece-wise polynomial func- tions on

[0, 4]

with (i) defect 1 at

1

and (ii) defect 2 at

2

.

Note that

V (O )

V (A)

V (B )

.

dim(V(S) 4 dim(V(O) 5 dim(V(A) 6 dim(V(B) 7

(12)

Title Page

Contents

JJ II

J I

Page12of27

Go Back

Full Screen

Close

Greville Abscissa

Question: But what about a basis for

V (A)?

Recall the bezier case. We had:

Special points ξ

i

=

ni

and Gr

n

=

{

ξ

0

, ξ

1

, . . . , ξ

n}

.

A basis element B

in

(t) associated with each point ξ

i

.

Control polygon P = [p

0

, . . . , p

n

] with p

i

associated with each ξ

i

.

An evaluation procedure based on interpolation within this poly- gon.

A similar process happens for general knot vectors.

(13)

Title Page

Contents

JJ II

J I

Page13of27

Go Back

Full Screen

Close

Re-Cap

0/3 1/3 2/3 3/3

p0

p2

p3 p1

p[01]

p[12]

p[23]

0/3 1/3 2/3 3/3

p0

p2

p3 p1

0/3 1/3 2/3 3/3

p3 p[01]

p[12]

p[23]

p0

p[13]

p[02]

p[03]

The

deCasteljeu procedure

(14)

Title Page

Contents

JJ II

J I

Page14of27

Go Back

Full Screen

Close

The General Case

We pick the knot vector

) = [0002444]

. We define the set

Gr(A)

to be averages ofD consecutive knots in the knot vector.

Thus

Gr (A) =

{

0, 2/3, 2, 10/3, 4

}. Note that

• |

Gr(A)

|

= length(A)

D + 1

.

• The first and the last knot are elements of

Gr(A)

. In fact if a knot has multiplicity

D

then it shows up as a greville abscissa.

Gr([000111]) =

{

0/3, 1/3, 2/3, 3/3

} .

Formally,

β = β

1

, . . . , β

m is the knot vector then

Gr(β ) =

{

ξ

1

, . . . , ξ

mD+1}, where

ξ

i

= β

i

+ β

i+1

+ . . . + β

i+D1

D

(15)

Title Page

Contents

JJ II

J I

Page15of27

Go Back

Full Screen

Close

The Control Polygon

Assign to each element ξ

i

of Gr(β), a control point. Locate the set Gr(β ) on the real line and form the

Control Polygon.

A [0002444]

degree=3

ξ ξ ξ

ξ1=0 2=2/3 3=2 ξ4=10/3 5=4 p

p

p p p

1

2

3

4

5

(16)

Title Page

Contents

JJ II

J I

Page16of27

Go Back

Full Screen

Close

The Knot Insertion

The basic process is knot insertion. Suppose that we are given a polygon

P = P (O)

on

Gr(O)

. And suppose that

A

is obtained from

O

by inserting a knot in

O

. We construct a polygomn

Q = P (A)

on

Gr(A)

from

P (O)

as follows:

Compute

Gr(A)

. This set has one more element than

Gr(O)

. In fact, each element of

Gr(A)

lies betweentwo elements of

Gr(O)

or is equal to one of them.

For each

η

Gr(A)

, express

η

as aconvex combinationof two adjacent elements

ξ

i and

ξ

i+1 of

Gr(O)

.

• Use these coefficients to obtain

Q(η )

as a convex combination of

P (ξ

i

)

and

P (ξ

i+1

)

.

This is shown in the next slide.

(17)

Title Page

Contents

JJ II

J I

Page17of27

Go Back

Full Screen

Close

Pictorially

O [0002444]

degree=3

ξ ξ ξ

ξ1=0 2=2/3 3=2 ξ4=10/3 5=4 p

p p p

1

3

4

5

p2

A=[00022444]

0 2/3 4/3 8/3 10/3 4 new greville abs.

Polygon P(A)

q3 q4

q5 q1 q6

q2

We see that

4/3 = 1/2

·

2/3 + 1/2

·

2 8/3 = 1/2

·

2 + 1/2

·

10/3

thus

q

3

= 1/2

·

p

2

+ 1/2

·

p

3

q

4

= 1/2

·

p

3

+ 1/2

·

p

4

(18)

Title Page

Contents

JJ II

J I

Page18of27

Go Back

Full Screen

Close

Evaluation

Inputs:

1. The knot vector

A

.

2. The control points (polygon) on

Gr(A)

. 3. The parameter

t

.

Output:

f (t)

.

1. Compute

Gr(A)

and store it.

2. Insert

t

into

A D

times or till the multiplicity of

t

becomes

D

.

Add

t

and re-compute greville abscissa.

• Intrpolate to get the new control polygon.

3. Now

t

is a greville abscissa. Read off the value at

t

as

f (t)

.

(19)

Title Page

Contents

JJ II

J I

Page19of27

Go Back

Full Screen

Close

The Bezier Case

1/3

[000111] 0/3 2/3 3/3

[000t111] 0/3 t/3 (1+t)/3 (2+t)/3

[000tt111] 0/3 t/3 3/3

3/3

(2t)/3 (1+2t)/3 (2+t)/3

0/3 t/3 (2t)/3 t (1+2t)/3 (2+t)/3 3/3

t t

t

t t

t

1−t 1−t 1−t

1−t 1−t

1−t

P0 P1 P2 P3

[000ttt111]

This is just the de-Casteljeu algorithm

(20)

Title Page

Contents

JJ II

J I

Page20of27

Go Back

Full Screen

Close

A Simple general Case

[00122]

2

0 1/2 3/2

0 1/2 (1+t)2 t (2+t)/2 2 [001tt22]

(2−t)/2 t/2 2−t t−1

t−1 2−t

0 1/2 (1+t)/2 (2+t)/2 2 [001t22]

p0 p1 p2 p3

Thus we see that for

t

[1, 2]

we have:

f (t) = p

1

(2

t)

2

2 + p

2

[ (2

t)t

2 + (2

t)(t

1)

2 ] + p

3

(t

1)

2 Thus

f (t)

is indeed a polynomial of degree

2

.

(21)

Title Page

Contents

JJ II

J I

Page21of27

Go Back

Full Screen

Close

Properties

From the evaluation procedure, certain properties are obvious:

The point

f (t)

is a convex combination of the control points. This is clear since in the modified de-Casteljeu/deBoor algorithm in every stage, new points are created which are convex combinations of earlier points, and so on.

• The second observation is locality. Note that if the evaluation is to be made at

t

and the relevant portion of the knot vector is:

. . .

β

iD+1

β

iD+2

. . .

β

i

t

β

i+1

. . .

β

i+D We then see that

ξ

iD+1

, ξ

iD+2

, . . . , ξ

i+1 are the only greville abscissas which will play a role. Whence

f (t)

is completely determined by only a subset of the control points, viz. {

p

iD+1

, . . . , p

i+1}.

(22)

Title Page

Contents

JJ II

J I

Page22of27

Go Back

Full Screen

Close

Basis Functions

What then are the basis functions?

So, let

β

be a knot vector, say

[00122]

, which we have seen needs

4

control points. The basis functions

f

i

(t)

for

i = 0, . . . , 3

correspond to the control polygons

{

[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]

}

00

greville ab.

2 3/2

1/2 0

1 22 knots

f (t)

0

(23)

Title Page

Contents

JJ II

J I

Page23of27

Go Back

Full Screen

Close

Basis Functions

What then are the basis functions?

So, let

β

be a knot vector, say

[00122]

, which we have seen needs

4

control points. The basis functions

f

i

(t)

for

i = 0, . . . , 3

correspond to the control polygons

{

[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]

}

00

greville ab.

2 3/2

1/2 0

1 22 knots

f (t)

1

(24)

Title Page

Contents

JJ II

J I

Page24of27

Go Back

Full Screen

Close

Decoupling

Question: What is the connection between piece-wise Bezier and B-Spline?

For the knot vector

β

, insert each

β

i so that the multiplicity becomes

D

. Now read off the control points for each segment!

O [0002444]

degree=3

ξ ξ ξ

ξ1=0 2=2/3 3=2 ξ4=10/3 5=4 p

p p p

1

3

4

5

p2

A=[00022444]

0 2/3 4/3 8/3 10/3 4 new greville abs.

Polygon P(A)

q3 q4

q5 q1 q6

q2

Insert

2

once.

(25)

Title Page

Contents

JJ II

J I

Page25of27

Go Back

Full Screen

Close

Decoupling

Question: What is the connection between piece-wise Bezier and B-Spline?

For the knot vector

β

, insert each

β

i so that the multiplicity becomes

D

. Now read off the control points for each segment!

4 10/3 8/3

4/3 2/3 0

new greville abs.

Polygon P(A)

q3 q4

q1

A=[00022444]

B=[000222444]

4 10/3 8/3

4/3 2/3

0 2

r1

q2r2

r3 r4

r5

r6q5 r7q6

And again.

(26)

Title Page

Contents

JJ II

J I

Page26of27

Go Back

Full Screen

Close

Decoupling

Question: What is the connection between piece-wise Bezier and B-Spline?

For the knot vector

β

, insert each

β

i so that the multiplicity becomes

D

. Now read off the control points for each segment!

r1

r2

r3 r4

r5

r6

r7

Bezier2 [r4,r5,r6,r7]

Bezier1 [r1,r2,r3,r4]

0 2 4

original poly

Finally, read off the control points.

Note the relationship between

[r

2

, r

3

, r

4

]

and

[r

4

, r

5

, r

6

]

.

(27)

Title Page

Contents

JJ II

J I

Page27of27

Go Back

Full Screen

Close

Wrap-Up

This covers our discussion of splines. See my notes for much of the mathe- matics behind it.

Things missing:

• End Conditions.

• Subdivision.

• Use in tensor-product surfaces.

• Plot of the basis functions.

References

Related documents

Public sector banks (PSBs) are likely to regain market share in loans to the micro, small and medium enterprise (MSME) segment, as the recently launched online

In our study, dinoprostone vaginal gel was associated with shorter induction to delivery interval compared to Foley’s catheter. Both foleys and dinoprostone gel

which was comparable to the sensitivity, specificity of 24 hours urinary protein in predicting maternal and fetal complication i.e 52.5% ,71% and58.1%,64.5%.Hence Spot

Clinico-mycological study on superficial fungal infections in tertiary care hospital and a profile of their antifungal susceptibility pattern. Hanumanthappa H, Sarojini K,

This is certify that the dissertation titled “ EFFICACY OF TRANSCEREBELLAR DIAMETER / ABDOMINAL CIRCUMFERENCE RATIO VERSUS HEAD CIRCUMFERENCE/ABDOMINAL

This is to certify that Mr Ankur Thakur, from Centre for Management studies, Jamia Millia Islamia has completed Internship with Tata Power Solar Systems Limited, Bangalore for two

Jitendra Kumar, student of Dayalbagh Educational Institute, Agra completed a 6-week Internship Programme under Hankernest Technologies Pvt.. As part-fulfillment of the

World liquids consumption for energy in the industrial sector, which was projected to increase by 1.1 percent per year from 2005 to 2030 in the IEO2008 reference case, increases by