1 dr. scott schaefer smooth curves. 2/109 smooth curves interpolation interpolation through linear...

109
1 Dr. Scott Schaefer Smooth Curves

Upload: ursula-mcbride

Post on 31-Dec-2015

241 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

1

Dr. Scott Schaefer

Smooth Curves

Page 2: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

2/109

Smooth Curves

Interpolation Interpolation through Linear AlgebraLagrange interpolation

Bezier curves B-spline curves

Page 3: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

3/109

Smooth Curves

How do we create smooth curves?

Page 4: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

4/109

Smooth Curves

How do we create smooth curves?

Parametric curves with polynomials

)(),()( tytxtp

Page 5: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

5/109

Smooth Curves

Controlling the shape of the curve

32

32

)(

)(

htgtftety

dtctbtatx

Page 6: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

6/109

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 7: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

7/109

Smooth Curves

Controlling the shape of the curve

323)(

)(

tttty

ttx

Page 8: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

8/109

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 9: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

9/109

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 10: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

10/109

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 11: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

11/109

Smooth Curves

Controlling the shape of the curve

3231)(

)(

tttty

ttx

Page 12: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

12/109

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 13: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

13/109

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Page 14: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

14/109

Smooth Curves

Controlling the shape of the curve

321)(

)(

tttty

ttx

Power-basis coefficients not intuitive for controlling shape of curve!!!

Page 15: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

15/109

Interpolation

Find a polynomial that passes through specified values

y

t

32)( dtctbtaty

0 1 2 3

Page 16: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

16/109

Interpolation

Find a polynomial that passes through specified values

y

t

32)( dtctbtaty 3)0( ay

1)1( dcbay3842)2( dcbay12793)3( dcbay

0 1 2 3

Page 17: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

17/109

Interpolation

Find a polynomial that passes through specified values

y

t

32)( dtctbtaty

1

3

1

3

27931

8421

1111

0001

d

c

b

a

0 1 2 3

Page 18: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

18/109

Interpolation

Find a polynomial that passes through specified values

y

t

32)( dtctbtaty

31

320

6

3

d

c

b

a

0 1 2 3

Page 19: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

19/109

Interpolation

Find a polynomial that passes through specified values

y

t

Intuitive control of curve using “control points”!!!

0 1 2 3

Page 20: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

20/109

Interpolation

Perform interpolation for each component separately

Combine result to obtain parametric curve

y

x

)(),()( tytxtp

Page 21: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

21/109

Interpolation

Perform interpolation for each component separately

Combine result to obtain parametric curve

y

x

)(),()( tytxtp

Page 22: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

22/109

Interpolation

Perform interpolation for each component separately

Combine result to obtain parametric curve

y

x

)(),()( tytxtp

Page 23: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

23/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

Page 24: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

24/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

)(tf

10)1()( ytyttf

Page 25: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

25/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

)(tf

10)1()( ytyttf

2y)(tg

21 )1()2()( ytyttg

Page 26: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

26/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

10)1()( ytyttf

2y

)(th

21 )1()2()( ytyttg

2

)()()2()(

tgttftth

Page 27: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

27/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

10)1()( ytyttf

2y

)(th

21 )1()2()( ytyttg

2

)()()2()(

tgttftth

2

)1(1)1()12()1(

gfh

Page 28: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

28/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

10)1()( ytyttf

2y

)(th

21 )1()2()( ytyttg

2

)()()2()(

tgttftth

111

2)1( y

yyh

Page 29: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

29/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

10)1()( ytyttf

2y

)(th

21 )1()2()( ytyttg

2

)()()2()(

tgttftth

2

)0(0)0()02()0(

gfh

Page 30: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

30/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

10)1()( ytyttf

2y

)(th

21 )1()2()( ytyttg

2

)()()2()(

tgttftth

00

2

2)0( y

yh

Page 31: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

31/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

10)1()( ytyttf

2y

)(th

21 )1()2()( ytyttg

2

)()()2()(

tgttftth

2

)2(2)2()22()2(

gfh

Page 32: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

32/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

10)1()( ytyttf

2y

)(th

21 )1()2()( ytyttg

2

)()()2()(

tgttftth

22

2

2)2( y

yh

Page 33: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

33/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

2y

)(th3y

Page 34: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

34/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

2y )(tk

3y

Page 35: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

35/109

Lagrange Interpolation

Identical to matrix method but uses a geometric construction

y

t0 1 2 3

0y

1y

2y

)(tm3y

3

)()()3()(

tktthttm

Page 36: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

36/109

Uniform Lagrange Interpolation

Base Case Linear interpolation between two points

Inductive Step Assume we have points yi, …, yn+1+i

Build interpolating polynomials f(t), g(t) of degree n for yi, …, yn+i and yi+1, …, yn+1+i

h(t) interpolates all points yi, …, yn+1+i and is of degree n+1

Moreover, h(t) is unique

1

)()()()1()(

n

tgittftinth

Page 37: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

37/109

Lagrange Evaluation Pseudocode

Lagrange(pts, i, t)

n = length(pts)-2

if n is 0

return pts[0](i+1-t)+pts[1](t-i)

f=Lagrange(pts without last element, i, t)

g=Lagrange(pts without first element, i+1, t)

return ((n+1+i-t)f+(t-i)g)/(n+1)

Page 38: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

38/109

Problems with Interpolation

Page 39: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

39/109

Problems with Interpolation

Page 40: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

40/109

Bezier Curves

Polynomial curves that seek to approximate rather than to interpolate

Page 41: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

41/109

Bernstein Polynomials

Degree 1: (1-t), t Degree 2: (1-t)2, 2(1-t)t, t2

Degree 3: (1-t)3, 3(1-t)2t, 3(1-t)t2, t3

Page 42: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

42/109

Bernstein Polynomials

Degree 1: (1-t), t Degree 2: (1-t)2, 2(1-t)t, t2

Degree 3: (1-t)3, 3(1-t)2t, 3(1-t)t2, t3

Degree 4: (1-t)4, 4(1-t)3t, 6(1-t)2t2, 4(1-t)t3,t4

Page 43: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

43/109

Bernstein Polynomials

Degree 1: (1-t), t Degree 2: (1-t)2, 2(1-t)t, t2

Degree 3: (1-t)3, 3(1-t)2t, 3(1-t)t2, t3

Degree 4: (1-t)4, 4(1-t)3t, 6(1-t)2t2, 4(1-t)t3,t4

Degree 5: (1-t)5, 5(1-t)4t, 10(1-t)3t2, 10(1-t)2t3 ,5(1-t)t4,t5

… Degree n: for

iin tti

n

)1( ni 0

Page 44: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

44/109

Bezier Curves

n

ii

iin ptti

ntp

0

)1()(

Page 45: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

45/109

Bezier Curves

n

ii

iin ptti

ntp

0

)1()(

)1,0()1,1()1(3)0,1()1(3)0,0()1()( 3223 tttttttp

Page 46: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

46/109

Bezier Curves

n

ii

iin ptti

ntp

0

)1()(

))23(,)1(3()( 2tttttp

Page 47: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

47/109

Bezier Curve Properties

Interpolate end-points

n

ii

iin ptti

ntp

0

)1()(

Page 48: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

48/109

Bezier Curve Properties

Interpolate end-points

00

0)01()0( ppi

np

n

ii

iin

Page 49: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

49/109

Bezier Curve Properties

Interpolate end-points

n

n

ii

iin ppi

np

0

1)11()1(

Page 50: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

50/109

Bezier Curve Properties

Interpolate end-points

n

n

ii

iin ppi

np

0

1)11()1(

Page 51: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

51/109

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

n

ii

iin ptti

ntp

0

)1()(

Page 52: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

52/109

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

n

i

iiniini

n

ii

iin ttinttipinptti

ntt

tp

0

11

0

)1)(()1()1()(

Page 53: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

53/109

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge

)()0(

01 ppnt

p

)()1(

1

nn ppn

t

p

Page 54: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

54/109

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge Curve lies within the convex hull of the

control points

Page 55: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

55/109

Convex Hull

The smallest convex set containing all points pi

Page 56: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

56/109

Convex Hull

The smallest convex set containing all points pi

Page 57: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

57/109

Bezier Curve Properties

Interpolate end-points Tangent at end-points in direction of first/last

edge Curve lies within the convex hull of the

control points Bezier Lagrange

Page 58: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

58/109

Pyramid Algorithms for Bezier Curves Polynomials aren’t pretty Is there an easier way to evaluate the

equation of a Bezier curve?

n

ii

iin ptti

ntp

0

)1()(

Page 59: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

59/109

Pyramid Algorithms forBezier Curves

0p 1p 2p 3p

21)1( ptpt 10)1( ptpt 32)1( ptpt

t1 t1 t1t tt

Page 60: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

60/109

Pyramid Algorithms forBezier Curves

0p 1p 2p 3p

22

102 )1(2)1( ptpttpt

t1 t1 t1t tt

t1 t t1 t

32

212 )1(2)1( ptpttpt

Page 61: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

61/109

Pyramid Algorithms forBezier Curves

0p 1p 2p 3p

t1 t1 t1t tt

t1 t t1 t

33

22

12

03 )1(3)1(3)1( ptpttpttpt

t1 t

Page 62: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

62/109

Bezier Evaluation Pseudocode

Bezier(pts, t)

if ( length(pts) is 1)

return pts[0]

newPts={}

For ( i = 0, i < length(pts) – 1, i++ )

Add to newPts (1-t)pts[i] + t pts[i+1]

return Bezier ( newPts, t )

Page 63: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

63/109

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 64: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

64/109

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 65: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

65/109

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 66: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

66/109

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 67: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

67/109

Subdividing Bezier Curves

Given a single Bezier curve, construct two smaller Bezier curves whose union is exactly the original curve

Page 68: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

68/109

Subdividing Bezier Curves

0p 1p 2p 3p

t1 t1 t1t tt

t1 t t1 t

t1 tControl points for left curve!!!

Page 69: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

69/109

Subdividing Bezier Curves

0p 1p 2p 3p

t1 t1 t1t tt

t1 t t1 t

t1 t Control points for right curve!!!

Page 70: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

70/109

Subdividing Bezier Curves

0p 1p 2p 3p

21

21

21

21

21

21

21

21

21

21

21

21

121

021 pp 22

112

1 pp 321

221 pp

241

121

041 ppp 34

122

114

1 ppp

381

283

183

081 pppp

Page 71: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

71/109

Adaptive Rendering of Bezier Curves

If control polygon is close to a line, draw the control polygon

If not, subdivide and recur on subdivided pieces

Page 72: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

72/109

Adaptive Rendering of Bezier Curves

If control polygon is close to a line, draw the control polygon

If not, subdivide and recur on subdivided pieces

Page 73: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

73/109

Adaptive Rendering of Bezier Curves

If control polygon is close to a line, draw the control polygon

If not, subdivide and recur on subdivided pieces

Page 74: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

74/109

Adaptive Rendering of Bezier Curves

If control polygon is close to a line, draw the control polygon

If not, subdivide and recur on subdivided pieces

Page 75: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

75/109

Adaptive Rendering of Bezier Curves

If control polygon is close to a line, draw the control polygon

If not, subdivide and recur on subdivided pieces

Page 76: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

76/109

Adaptive Rendering of Bezier Curves

If control polygon is close to a line, draw the control polygon

If not, subdivide and recur on subdivided pieces

Page 77: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

77/109

Applications: Intersection

Given two Bezier curves, determine if and where they intersect

Page 78: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

78/109

Applications: Intersection

Check if convex hulls intersect If not, return no intersection If both convex hulls can be approximated

with a straight line, intersect lines and return intersection

Otherwise subdivide and recur on subdivided pieces

Page 79: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

79/109

Applications: Intersection

Page 80: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

80/109

Applications: Intersection

Page 81: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

81/109

Applications: Intersection

Page 82: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

82/109

Applications: Intersection

Page 83: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

83/109

Applications: Intersection

Page 84: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

84/109

Applications: Intersection

Page 85: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

85/109

Applications: Intersection

Page 86: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

86/109

Applications: Intersection

Page 87: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

87/109

Applications: Intersection

Page 88: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

88/109

Applications: Intersection

Page 89: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

89/109

Applications: Intersection

Page 90: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

90/109

Application: Font Rendering

Page 91: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

91/109

Application: Font Rendering

Page 92: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

92/109

Problems with Bezier Curves

More control points means higher degree Moving one control point affects the entire

curve

Page 93: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

93/109

Problems with Bezier Curves

More control points means higher degree Moving one control point affects the entire

curve

Page 94: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

94/109

B-spline Curves

Not a single polynomial, but lots of polynomials that meet together smoothly

Local control

Page 95: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

95/109

B-spline Curves

Not a single polynomial, but lots of polynomials that meet together smoothly

Local control

Page 96: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

96/109

Rendering B-spline Curves

Lane-Reisenfeld subdivision algorithm

Linearly subdivide the curve by inserting the midpoint on each edge

Perform averaging by replacing each edge by its midpoint d times

Subdivide the curve repeatedly

Page 97: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

97/109

Rendering B-spline Curves

0p 1p 2p210 pp

221 pp

232 pp

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

21

Page 98: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

98/109

Rendering B-spline Curves

Page 99: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

99/109

Rendering B-spline Curves

Page 100: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

100/109

Rendering B-spline Curves

Page 101: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

101/109

Rendering B-spline Curves

Page 102: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

102/109

Rendering B-spline Curves

Page 103: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

103/109

Rendering B-spline Curves

Page 104: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

104/109

Rendering B-spline Curves

Page 105: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

105/109

Rendering B-spline Curves

Page 106: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

106/109

B-spline Properties

Curve lies within convex hull of control points

Variation Diminishing: Curve wiggles no more than control polygon

Influence of one control point is bounded Degree of curve increases by one with each

averaging step Smoothness increases by one with each

averaging step

Page 107: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

107/109

B-spline Curve Example

Page 108: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

108/109

B-spline Curve Example

Page 109: 1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline

109/109

B-spline Curve Example