2d computer graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · impa 1....

92
2D Computer Graphics Diego Nehab Summer 2019 IMPA 1

Upload: buikhuong

Post on 28-Jan-2019

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

2D Computer Graphics

Diego NehabSummer 2019

IMPA

1

Page 2: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Page 3: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Curve modeling by splines

2

Page 4: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Curve modeling by splines

Thin strip of wood used in building construction

Anchored in place by lead weights called ducks

Physical process

Interpolating, smooth, energy minimizing 3

No local control 7

3

Page 5: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Curve modeling by splines

Thin strip of wood used in building construction

Anchored in place by lead weights called ducks

Physical process

Interpolating, smooth, energy minimizing 3

No local control 7

3

Page 6: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Curve modeling by splines

Thin strip of wood used in building construction

Anchored in place by lead weights called ducks

Physical process

Interpolating, smooth, energy minimizing 3

No local control 7

3

Page 7: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Curve modeling by splines

Thin strip of wood used in building construction

Anchored in place by lead weights called ducks

Physical process

Interpolating, smooth, energy minimizing 3

No local control 7

3

Page 8: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Curve modeling by splines

Thin strip of wood used in building construction

Anchored in place by lead weights called ducks

Physical process

Interpolating, smooth, energy minimizing 3

No local control 7

3

Page 9: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Burmester curve

4

Page 10: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Lagrangian interpolation

Computational process

k+ 1 vertices {p0, . . . ,pk} define a curve

γ(t) =k∑i=0

pi

∏j 6=i(t − j)∏j 6=i(i− j)

, t ∈ [0, k]

Similar issues

5

Page 11: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

Define a family of generating functions βn recursively

β0(t) =

1, − 12 ≤ t < 1

2

0, otherwise

βn = βn−1 ∗ β0, n ∈ N

Notation for convolutionh = f ∗ g ⇔ h(t) =

∫ ∞

−∞f (u)g(u− t)dt

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

6

Page 12: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

Define a family of generating functions βn recursively

β0(t) =

1, − 12 ≤ t < 1

2

0, otherwise

βn = βn−1 ∗ β0, n ∈ N

Notation for convolutionh = f ∗ g ⇔ h(t) =

∫ ∞

−∞f (u)g(u− t)dt

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

6

Page 13: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

Define a family of generating functions βn recursively

β0(t) =

1, − 12 ≤ t < 1

2

0, otherwise

βn = βn−1 ∗ β0, n ∈ N

Notation for convolutionh = f ∗ g ⇔ h(t) =

∫ ∞

−∞f (u)g(u− t)dt

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

6

Page 14: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

Define a family of generating functions βn recursively

β0(t) =

1, − 12 ≤ t < 1

2

0, otherwise

βn = βn−1 ∗ β0, n ∈ N

Notation for convolutionh = f ∗ g ⇔ h(t) =

∫ ∞

−∞f (u)g(u− t)dt

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

6

Page 15: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

Define a family of generating functions βn recursively

β0(t) =

1, − 12 ≤ t < 1

2

0, otherwise

βn = βn−1 ∗ β0, n ∈ N

Notation for convolutionh = f ∗ g ⇔ h(t) =

∫ ∞

−∞f (u)g(u− t)dt

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

-4 -2 2 4-0.2

0.2

0.4

0.6

0.8

1.

1.2

6

Page 16: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

Examples

β0(t) =

1, − 12 ≤ t < 1

2

0, otherwise

β1(t) =

1+ t, −1 ≤ t < 0

1− t, 0 ≤ t < 1

0, otherwise

β2(t) =

18(3+ 2t)2, − 3

2 ≤ t < − 12

14(3− 4t2), − 1

2 ≤ t < 12

18(9− 12t + 4t2), 1

2 ≤ t < 22

0, otherwise

7

Page 17: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

Examples

β0(t) =

1, − 12 ≤ t < 1

2

0, otherwise

β1(t) =

1+ t, −1 ≤ t < 0

1− t, 0 ≤ t < 1

0, otherwise

β2(t) =

18(3+ 2t)2, − 3

2 ≤ t < − 12

14(3− 4t2), − 1

2 ≤ t < 12

18(9− 12t + 4t2), 1

2 ≤ t < 22

0, otherwise

7

Page 18: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

Examples

β0(t) =

1, − 12 ≤ t < 1

2

0, otherwise

β1(t) =

1+ t, −1 ≤ t < 0

1− t, 0 ≤ t < 1

0, otherwise

β2(t) =

18(3+ 2t)2, − 3

2 ≤ t < − 12

14(3− 4t2), − 1

2 ≤ t < 12

18(9− 12t + 4t2), 1

2 ≤ t < 22

0, otherwise

7

Page 19: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

k+ 1 vertices {p0, . . . ,pk} and generating function βn define a curve

γ(t) =k∑i=0

βn(t − i)pi, t ∈ [0, k]

Local control 3

Differentiable n times everywhere 3

Non-interpolating 7

• Interpolation requires solving a banded linear system 3

Many, many interesting properties

8

Page 20: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

k+ 1 vertices {p0, . . . ,pk} and generating function βn define a curve

γ(t) =k∑i=0

βn(t − i)pi, t ∈ [0, k]

Local control 3

Differentiable n times everywhere 3

Non-interpolating 7

• Interpolation requires solving a banded linear system 3

Many, many interesting properties

8

Page 21: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

k+ 1 vertices {p0, . . . ,pk} and generating function βn define a curve

γ(t) =k∑i=0

βn(t − i)pi, t ∈ [0, k]

Local control 3

Differentiable n times everywhere 3

Non-interpolating 7

• Interpolation requires solving a banded linear system 3

Many, many interesting properties

8

Page 22: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

k+ 1 vertices {p0, . . . ,pk} and generating function βn define a curve

γ(t) =k∑i=0

βn(t − i)pi, t ∈ [0, k]

Local control 3

Differentiable n times everywhere 3

Non-interpolating 7

• Interpolation requires solving a banded linear system 3

Many, many interesting properties

8

Page 23: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

B-splines

k+ 1 vertices {p0, . . . ,pk} and generating function βn define a curve

γ(t) =k∑i=0

βn(t − i)pi, t ∈ [0, k]

Local control 3

Differentiable n times everywhere 3

Non-interpolating 7

• Interpolation requires solving a banded linear system 3

Many, many interesting properties

8

Page 24: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Polylines

k+ 1 vertices {p0, . . . ,pk} define k segments{γ0(t), . . . , γk−1(t)

}, t ∈ [0, 1]

Each segment defined by linear interpolationγi(t) = (1− t)pi + t pi+1, i ∈ {0, . . . , k− 1}

Local control 3

Interpolates all control points 3

Not differentiable at interpolated points 7

9

Page 25: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Polylines

k+ 1 vertices {p0, . . . ,pk} define k segments{γ0(t), . . . , γk−1(t)

}, t ∈ [0, 1]

Each segment defined by linear interpolationγi(t) = (1− t)pi + t pi+1, i ∈ {0, . . . , k− 1}

Local control 3

Interpolates all control points 3

Not differentiable at interpolated points 7

9

Page 26: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Polylines

k+ 1 vertices {p0, . . . ,pk} define k segments{γ0(t), . . . , γk−1(t)

}, t ∈ [0, 1]

Each segment defined by linear interpolationγi(t) = (1− t)pi + t pi+1, i ∈ {0, . . . , k− 1}

Local control 3

Interpolates all control points 3

Not differentiable at interpolated points 7

9

Page 27: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Polylines

k+ 1 vertices {p0, . . . ,pk} define k segments{γ0(t), . . . , γk−1(t)

}, t ∈ [0, 1]

Each segment defined by linear interpolationγi(t) = (1− t)pi + t pi+1, i ∈ {0, . . . , k− 1}

Local control 3

Interpolates all control points 3

Not differentiable at interpolated points 7

9

Page 28: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Polylines

k+ 1 vertices {p0, . . . ,pk} define k segments{γ0(t), . . . , γk−1(t)

}, t ∈ [0, 1]

Each segment defined by linear interpolationγi(t) = (1− t)pi + t pi+1, i ∈ {0, . . . , k− 1}

Local control 3

Interpolates all control points 3

Not differentiable at interpolated points 7

9

Page 29: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Polylines

k+ 1 vertices {p0, . . . ,pk} define k segments{γ0(t), . . . , γk−1(t)

}, t ∈ [0, 1]

Each segment defined by linear interpolationγi(t) = (1− t)pi + t pi+1, i ∈ {0, . . . , k− 1}

Local control 3

Interpolates all control points 3

Not differentiable at interpolated points 7

9

Page 30: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Generalization of linear interpolation

kn+ 1 vertices {p0, . . . ,pkn} define k segments of degree n{γn0 (t), γnn(t), . . . , γn(k−1)n(t)

}, t ∈ [0, 1]

Defined recursively, for j ∈ {0, . . . , k− 1}γ0i (t) = pi, i ∈

{nj, . . . ,n(j+ 1)

},

γmi (t) = (1− t) γm−1i (t) + t γm−1

i+1 (t), i ∈{nj, . . . ,n(j+ 1)−m

}De Casteljau algorithm

Geometric interpretation

10

Page 31: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Generalization of linear interpolation

kn+ 1 vertices {p0, . . . ,pkn} define k segments of degree n{γn0 (t), γnn(t), . . . , γn(k−1)n(t)

}, t ∈ [0, 1]

Defined recursively, for j ∈ {0, . . . , k− 1}γ0i (t) = pi, i ∈

{nj, . . . ,n(j+ 1)

},

γmi (t) = (1− t) γm−1i (t) + t γm−1

i+1 (t), i ∈{nj, . . . ,n(j+ 1)−m

}De Casteljau algorithm

Geometric interpretation

10

Page 32: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Generalization of linear interpolation

kn+ 1 vertices {p0, . . . ,pkn} define k segments of degree n{γn0 (t), γnn(t), . . . , γn(k−1)n(t)

}, t ∈ [0, 1]

Defined recursively, for j ∈ {0, . . . , k− 1}γ0i (t) = pi, i ∈

{nj, . . . ,n(j+ 1)

},

γmi (t) = (1− t) γm−1i (t) + t γm−1

i+1 (t), i ∈{nj, . . . ,n(j+ 1)−m

}

De Casteljau algorithm

Geometric interpretation

10

Page 33: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Generalization of linear interpolation

kn+ 1 vertices {p0, . . . ,pkn} define k segments of degree n{γn0 (t), γnn(t), . . . , γn(k−1)n(t)

}, t ∈ [0, 1]

Defined recursively, for j ∈ {0, . . . , k− 1}γ0i (t) = pi, i ∈

{nj, . . . ,n(j+ 1)

},

γmi (t) = (1− t) γm−1i (t) + t γm−1

i+1 (t), i ∈{nj, . . . ,n(j+ 1)−m

}De Casteljau algorithm

Geometric interpretation

10

Page 34: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Generalization of linear interpolation

kn+ 1 vertices {p0, . . . ,pkn} define k segments of degree n{γn0 (t), γnn(t), . . . , γn(k−1)n(t)

}, t ∈ [0, 1]

Defined recursively, for j ∈ {0, . . . , k− 1}γ0i (t) = pi, i ∈

{nj, . . . ,n(j+ 1)

},

γmi (t) = (1− t) γm−1i (t) + t γm−1

i+1 (t), i ∈{nj, . . . ,n(j+ 1)−m

}De Casteljau algorithm

Geometric interpretation

10

Page 35: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bernstein polynomials

Algebraic interpretation

Expanding and collecting the pi terms,

γni (t) =n∑j=0

(nj)(1− t)n−j tj pi+j

Using Bernstein polynomials

γni (t) =n∑j=0

bj,n(t)pi+j with bj,n(t) =(nj)(1− t)n−j tj

Basis for the space of polynomials Pn with degree n or less (Why?)

11

Page 36: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bernstein polynomials

Algebraic interpretation

Expanding and collecting the pi terms,

γni (t) =n∑j=0

(nj)(1− t)n−j tj pi+j

Using Bernstein polynomials

γni (t) =n∑j=0

bj,n(t)pi+j with bj,n(t) =(nj)(1− t)n−j tj

Basis for the space of polynomials Pn with degree n or less (Why?)

11

Page 37: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bernstein polynomials

Algebraic interpretation

Expanding and collecting the pi terms,

γni (t) =n∑j=0

(nj)(1− t)n−j tj pi+j

Using Bernstein polynomials

γni (t) =n∑j=0

bj,n(t)pi+j with bj,n(t) =(nj)(1− t)n−j tj

Basis for the space of polynomials Pn with degree n or less (Why?)

11

Page 38: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bernstein polynomials

Algebraic interpretation

Expanding and collecting the pi terms,

γni (t) =n∑j=0

(nj)(1− t)n−j tj pi+j

Using Bernstein polynomials

γni (t) =n∑j=0

bj,n(t)pi+j with bj,n(t) =(nj)(1− t)n−j tj

Basis for the space of polynomials Pn with degree n or less (Why?)

11

Page 39: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Control points and blending weights

In matrix form

γni (t) =[pni pni+1 · · · pni+n

]

︸ ︷︷ ︸Bézier control points CB

i

b0,n(t)b1,n(t)...

bn,n(t)

blending weights Bn(t)

= CBi Bn(t)

Linear invariance is quite obvious in this form

12

Page 40: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Control points and blending weights

In matrix form

γni (t) =[pni pni+1 · · · pni+n

]︸ ︷︷ ︸

Bézier control points CBi

b0,n(t)b1,n(t)...

bn,n(t)

blending weights Bn(t)

= CBi Bn(t)

Linear invariance is quite obvious in this form

12

Page 41: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Control points and blending weights

In matrix form

γni (t) =[pni pni+1 · · · pni+n

]︸ ︷︷ ︸

Bézier control points CBi

b0,n(t)b1,n(t)...

bn,n(t)

blending weights Bn(t)

= CBi Bn(t)

Linear invariance is quite obvious in this form

12

Page 42: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Control points and blending weights

In matrix form

γni (t) =[pni pni+1 · · · pni+n

]︸ ︷︷ ︸

Bézier control points CBi

b0,n(t)b1,n(t)...

bn,n(t)

blending weights Bn(t)

= CBi Bn(t)

Linear invariance is quite obvious in this form

12

Page 43: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Change of basis

Can be converted back and forth to power basis

Pn(t) =[1 t · · · tn

]TBn(t) = Bn Pn(t)

Examples

B1 =

[1 −10 1

]B2 =

1 −2 10 2 −20 0 1

B3 =

1 −3 3 −10 3 −6 30 0 3 −30 0 0 1

γni (t) = CBi Bn(t) = CBi

Change of basis︷︸︸︷Bn︸ ︷︷ ︸

Power basis control points CPi

Pn(t) = CPi Pn(t)

13

Page 44: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Change of basis

Can be converted back and forth to power basis

Pn(t) =[1 t · · · tn

]TBn(t) = Bn Pn(t)

Examples

B1 =

[1 −10 1

]B2 =

1 −2 10 2 −20 0 1

B3 =

1 −3 3 −10 3 −6 30 0 3 −30 0 0 1

γni (t) = CBi Bn(t) = CBi

Change of basis︷︸︸︷Bn︸ ︷︷ ︸

Power basis control points CPi

Pn(t) = CPi Pn(t)

13

Page 45: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Change of basis

Can be converted back and forth to power basis

Pn(t) =[1 t · · · tn

]TBn(t) = Bn Pn(t)

Examples

B1 =

[1 −10 1

]B2 =

1 −2 10 2 −20 0 1

B3 =

1 −3 3 −10 3 −6 30 0 3 −30 0 0 1

γni (t) = CBi Bn(t) = CBi

Change of basis︷︸︸︷Bn︸ ︷︷ ︸

Power basis control points CPi

Pn(t) = CPi Pn(t)

13

Page 46: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Local control 3

Interpolates every nth point 3

Differentiable except (perhaps) at interpolation points 3

PostScript, SVG (Inkscape), RVG

Mathematica

14

Page 47: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Local control 3

Interpolates every nth point 3

Differentiable except (perhaps) at interpolation points 3

PostScript, SVG (Inkscape), RVG

Mathematica

14

Page 48: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Local control 3

Interpolates every nth point 3

Differentiable except (perhaps) at interpolation points 3

PostScript, SVG (Inkscape), RVG

Mathematica

14

Page 49: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Local control 3

Interpolates every nth point 3

Differentiable except (perhaps) at interpolation points 3

PostScript, SVG (Inkscape), RVG

Mathematica

14

Page 50: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Bézier curves

Local control 3

Interpolates every nth point 3

Differentiable except (perhaps) at interpolation points 3

PostScript, SVG (Inkscape), RVG

Mathematica

14

Page 51: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Affine invariance of Bézier segments

Let T be an affine transformation and let

γn(t) =n∑j=0

bj,n(t)pj

be a Bézier curve segment.

We want to show that

T( n∑j=0

bj,n(t)pj)=

n∑j=0

bj,n(t) T(pj).

This will be true if and only if all points in the Bézier curve are affinecombinations of the control points.

15

Page 52: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Affine invariance of Bézier segments

Let T be an affine transformation and let

γn(t) =n∑j=0

bj,n(t)pj

be a Bézier curve segment.

We want to show that

T( n∑j=0

bj,n(t)pj)=

n∑j=0

bj,n(t) T(pj).

This will be true if and only if all points in the Bézier curve are affinecombinations of the control points.

15

Page 53: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Affine invariance of Bézier segments

Let T be an affine transformation and let

γn(t) =n∑j=0

bj,n(t)pj

be a Bézier curve segment.

We want to show that

T( n∑j=0

bj,n(t)pj)=

n∑j=0

bj,n(t) T(pj).

This will be true if and only if all points in the Bézier curve are affinecombinations of the control points.

15

Page 54: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Affine invariance of Bézier segments

Indeed,n∑j=0

bj,n(t) =n∑j=0

(nj)(1− t)n−j tj

=((1− t) + t

)n= 1n = 1.

The Bernstein polynomials therefore form a partition of unity

To apply an affine transformation to a Bézier curve, simply transformthe control points

16

Page 55: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Affine invariance of Bézier segments

Indeed,n∑j=0

bj,n(t) =n∑j=0

(nj)(1− t)n−j tj =

((1− t) + t

)n

= 1n = 1.

The Bernstein polynomials therefore form a partition of unity

To apply an affine transformation to a Bézier curve, simply transformthe control points

16

Page 56: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Affine invariance of Bézier segments

Indeed,n∑j=0

bj,n(t) =n∑j=0

(nj)(1− t)n−j tj =

((1− t) + t

)n= 1n = 1.

The Bernstein polynomials therefore form a partition of unity

To apply an affine transformation to a Bézier curve, simply transformthe control points

16

Page 57: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Affine invariance of Bézier segments

Indeed,n∑j=0

bj,n(t) =n∑j=0

(nj)(1− t)n−j tj =

((1− t) + t

)n= 1n = 1.

The Bernstein polynomials therefore form a partition of unity

To apply an affine transformation to a Bézier curve, simply transformthe control points

16

Page 58: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Affine invariance of Bézier segments

Indeed,n∑j=0

bj,n(t) =n∑j=0

(nj)(1− t)n−j tj =

((1− t) + t

)n= 1n = 1.

The Bernstein polynomials therefore form a partition of unity

To apply an affine transformation to a Bézier curve, simply transformthe control points

16

Page 59: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Convex hull property for Bézier segments

p =∑

i αipi is a convex combination of {pi} if∑

i αi = 1 and αi ≥ 0.

A set of points C is convex if every convex combination of points in Calso belongs to C

The convex hull of a set points S is the smallest convex set thatcontains S

If γ is a Bézier curve, then{γ(t) | t ∈ [0, 1]

}is contained in the convex

hull of its control points• From partition of unity and positivity in [0, 1]• Useful for curve intersection, quick bounding box, etc

17

Page 60: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Convex hull property for Bézier segments

p =∑

i αipi is a convex combination of {pi} if∑

i αi = 1 and αi ≥ 0.

A set of points C is convex if every convex combination of points in Calso belongs to C

The convex hull of a set points S is the smallest convex set thatcontains S

If γ is a Bézier curve, then{γ(t) | t ∈ [0, 1]

}is contained in the convex

hull of its control points• From partition of unity and positivity in [0, 1]• Useful for curve intersection, quick bounding box, etc

17

Page 61: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Convex hull property for Bézier segments

p =∑

i αipi is a convex combination of {pi} if∑

i αi = 1 and αi ≥ 0.

A set of points C is convex if every convex combination of points in Calso belongs to C

The convex hull of a set points S is the smallest convex set thatcontains S

If γ is a Bézier curve, then{γ(t) | t ∈ [0, 1]

}is contained in the convex

hull of its control points• From partition of unity and positivity in [0, 1]• Useful for curve intersection, quick bounding box, etc

17

Page 62: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Convex hull property for Bézier segments

p =∑

i αipi is a convex combination of {pi} if∑

i αi = 1 and αi ≥ 0.

A set of points C is convex if every convex combination of points in Calso belongs to C

The convex hull of a set points S is the smallest convex set thatcontains S

If γ is a Bézier curve, then{γ(t) | t ∈ [0, 1]

}is contained in the convex

hull of its control points

• From partition of unity and positivity in [0, 1]• Useful for curve intersection, quick bounding box, etc

17

Page 63: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Convex hull property for Bézier segments

p =∑

i αipi is a convex combination of {pi} if∑

i αi = 1 and αi ≥ 0.

A set of points C is convex if every convex combination of points in Calso belongs to C

The convex hull of a set points S is the smallest convex set thatcontains S

If γ is a Bézier curve, then{γ(t) | t ∈ [0, 1]

}is contained in the convex

hull of its control points• From partition of unity and positivity in [0, 1]• Useful for curve intersection, quick bounding box, etc

17

Page 64: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

Since derivative operator is linear and γn(t) =∑n

j=0 bj,n(t)pj, all wehave to do is differentiate the Bernstein polynomials(

bj,n(t))′=((n

j)(1− t)n−j tj

)′

= j(nj)(1− t)n−j tj−1 − (n− j)

(nj)(1− t)n−1−j tj

= n(n−1j−1

)(1− t)(n−1)−(j−1) tj−1 − n

(n−1j)(1− t)n−1−j tj

= n(bj−1,n−1(t)− bj,n−1(t)

)Therefore,

(γn)′(t) =n−1∑j=0

bj,n−1(t)qj with qj = n(pj+1 − pj).

18

Page 65: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

Since derivative operator is linear and γn(t) =∑n

j=0 bj,n(t)pj, all wehave to do is differentiate the Bernstein polynomials(

bj,n(t))′=((n

j)(1− t)n−j tj

)′= j

(nj)(1− t)n−j tj−1 − (n− j)

(nj)(1− t)n−1−j tj

= n(n−1j−1

)(1− t)(n−1)−(j−1) tj−1 − n

(n−1j)(1− t)n−1−j tj

= n(bj−1,n−1(t)− bj,n−1(t)

)Therefore,

(γn)′(t) =n−1∑j=0

bj,n−1(t)qj with qj = n(pj+1 − pj).

18

Page 66: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

Since derivative operator is linear and γn(t) =∑n

j=0 bj,n(t)pj, all wehave to do is differentiate the Bernstein polynomials(

bj,n(t))′=((n

j)(1− t)n−j tj

)′= j

(nj)(1− t)n−j tj−1 − (n− j)

(nj)(1− t)n−1−j tj

= n(n−1j−1

)(1− t)(n−1)−(j−1) tj−1 − n

(n−1j)(1− t)n−1−j tj

= n(bj−1,n−1(t)− bj,n−1(t)

)Therefore,

(γn)′(t) =n−1∑j=0

bj,n−1(t)qj with qj = n(pj+1 − pj).

18

Page 67: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

Since derivative operator is linear and γn(t) =∑n

j=0 bj,n(t)pj, all wehave to do is differentiate the Bernstein polynomials(

bj,n(t))′=((n

j)(1− t)n−j tj

)′= j

(nj)(1− t)n−j tj−1 − (n− j)

(nj)(1− t)n−1−j tj

= n(n−1j−1

)(1− t)(n−1)−(j−1) tj−1 − n

(n−1j)(1− t)n−1−j tj

= n(bj−1,n−1(t)− bj,n−1(t)

)

Therefore,

(γn)′(t) =n−1∑j=0

bj,n−1(t)qj with qj = n(pj+1 − pj).

18

Page 68: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

Since derivative operator is linear and γn(t) =∑n

j=0 bj,n(t)pj, all wehave to do is differentiate the Bernstein polynomials(

bj,n(t))′=((n

j)(1− t)n−j tj

)′= j

(nj)(1− t)n−j tj−1 − (n− j)

(nj)(1− t)n−1−j tj

= n(n−1j−1

)(1− t)(n−1)−(j−1) tj−1 − n

(n−1j)(1− t)n−1−j tj

= n(bj−1,n−1(t)− bj,n−1(t)

)Therefore,

(γn)′(t) =n−1∑j=0

bj,n−1(t)qj with qj = n(pj+1 − pj).

18

Page 69: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

What is the derivative at the endpoints?

How do we connect segments so that they are C1 continuous?

What about G1 continuity?

Show in Inkscape

19

Page 70: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

What is the derivative at the endpoints?

How do we connect segments so that they are C1 continuous?

What about G1 continuity?

Show in Inkscape

19

Page 71: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

What is the derivative at the endpoints?

How do we connect segments so that they are C1 continuous?

What about G1 continuity?

Show in Inkscape

19

Page 72: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Derivative of Bézier segment

What is the derivative at the endpoints?

How do we connect segments so that they are C1 continuous?

What about G1 continuity?

Show in Inkscape

19

Page 73: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Given a Bézier curve segment γn(t), with control points {p0, . . . ,pn},and a reparameterization t 7→ (1− u)r + us, how can we obtain thecontrol points {q0, . . . ,qn} for the curve segment piece γn[r,s](u)?

γn[r,s](u) = γn((1− u)r + us

)= γn(a+ bu), for a = r, b = s− r

γn(a+ bu) =[p0 · · · pn

]Bn(a+ bu) = CB Bn Pn(a+ bu)

Pn(a+ bu) =

1

a+ bua2 + 2abu+ b2 u2

...(n0)an + · · ·

(ni)an−ibi ui + · · ·

(nn)bn un

20

Page 74: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Given a Bézier curve segment γn(t), with control points {p0, . . . ,pn},and a reparameterization t 7→ (1− u)r + us, how can we obtain thecontrol points {q0, . . . ,qn} for the curve segment piece γn[r,s](u)?

γn[r,s](u) = γn((1− u)r + us

)= γn(a+ bu), for a = r, b = s− r

γn(a+ bu) =[p0 · · · pn

]Bn(a+ bu) = CB Bn Pn(a+ bu)

Pn(a+ bu) =

1

a+ bua2 + 2abu+ b2 u2

...(n0)an + · · ·

(ni)an−ibi ui + · · ·

(nn)bn un

20

Page 75: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Given a Bézier curve segment γn(t), with control points {p0, . . . ,pn},and a reparameterization t 7→ (1− u)r + us, how can we obtain thecontrol points {q0, . . . ,qn} for the curve segment piece γn[r,s](u)?

γn[r,s](u) = γn((1− u)r + us

)= γn(a+ bu), for a = r, b = s− r

γn(a+ bu) =[p0 · · · pn

]Bn(a+ bu) = CB Bn Pn(a+ bu)

Pn(a+ bu) =

1

a+ bua2 + 2abu+ b2 u2

...(n0)an + · · ·

(ni)an−ibi ui + · · ·

(nn)bn un

20

Page 76: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Given a Bézier curve segment γn(t), with control points {p0, . . . ,pn},and a reparameterization t 7→ (1− u)r + us, how can we obtain thecontrol points {q0, . . . ,qn} for the curve segment piece γn[r,s](u)?

γn[r,s](u) = γn((1− u)r + us

)= γn(a+ bu), for a = r, b = s− r

γn(a+ bu) =[p0 · · · pn

]Bn(a+ bu) = CB Bn Pn(a+ bu)

Pn(a+ bu) =

1

a+ bua2 + 2abu+ b2 u2

...(n0)an + · · ·

(ni)an−ibi ui + · · ·

(nn)bn un

20

Page 77: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Pn(a+ bu) =

1a ba2 2ab b2...

...... . . .(n

0)an

(n1)an−1b

(n2)an−2b2 · · ·

(nn)bn

1uu2...un

= Ma,b Pn(u)γn[r,s](u) = γn(a+ bu)

= CB Bn Pn(a+ bu)= CB BnMa,b Pn(u)= CB BnMa,b Bn

−1 Bn(u)[q0 · · · qn

]= CB BnMa,b Bn

−1

21

Page 78: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Pn(a+ bu) =

1a ba2 2ab b2...

...... . . .(n

0)an

(n1)an−1b

(n2)an−2b2 · · ·

(nn)bn

1uu2...un

= Ma,b Pn(u)

γn[r,s](u) = γn(a+ bu)

= CB Bn Pn(a+ bu)= CB BnMa,b Pn(u)= CB BnMa,b Bn

−1 Bn(u)[q0 · · · qn

]= CB BnMa,b Bn

−1

21

Page 79: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Pn(a+ bu) =

1a ba2 2ab b2...

...... . . .(n

0)an

(n1)an−1b

(n2)an−2b2 · · ·

(nn)bn

1uu2...un

= Ma,b Pn(u)

γn[r,s](u) = γn(a+ bu)

= CB Bn Pn(a+ bu)= CB BnMa,b Pn(u)= CB BnMa,b Bn

−1 Bn(u)[q0 · · · qn

]= CB BnMa,b Bn

−1

21

Page 80: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Pn(a+ bu) =

1a ba2 2ab b2...

...... . . .(n

0)an

(n1)an−1b

(n2)an−2b2 · · ·

(nn)bn

1uu2...un

= Ma,b Pn(u)

γn[r,s](u) = γn(a+ bu)

= CB Bn Pn(a+ bu)

= CB BnMa,b Pn(u)= CB BnMa,b Bn

−1 Bn(u)[q0 · · · qn

]= CB BnMa,b Bn

−1

21

Page 81: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Pn(a+ bu) =

1a ba2 2ab b2...

...... . . .(n

0)an

(n1)an−1b

(n2)an−2b2 · · ·

(nn)bn

1uu2...un

= Ma,b Pn(u)

γn[r,s](u) = γn(a+ bu)

= CB Bn Pn(a+ bu)= CB BnMa,b Pn(u)

= CB BnMa,b Bn−1 Bn(u)[

q0 · · · qn]= CB BnMa,b Bn

−1

21

Page 82: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Pn(a+ bu) =

1a ba2 2ab b2...

...... . . .(n

0)an

(n1)an−1b

(n2)an−2b2 · · ·

(nn)bn

1uu2...un

= Ma,b Pn(u)

γn[r,s](u) = γn(a+ bu)

= CB Bn Pn(a+ bu)= CB BnMa,b Pn(u)= CB BnMa,b Bn

−1 Bn(u)

[q0 · · · qn

]= CB BnMa,b Bn

−1

21

Page 83: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Reparameterization

Pn(a+ bu) =

1a ba2 2ab b2...

...... . . .(n

0)an

(n1)an−1b

(n2)an−2b2 · · ·

(nn)bn

1uu2...un

= Ma,b Pn(u)

γn[r,s](u) = γn(a+ bu)

= CB Bn Pn(a+ bu)= CB BnMa,b Pn(u)= CB BnMa,b Bn

−1 Bn(u)[q0 · · · qn

]= CB BnMa,b Bn

−1

21

Page 84: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Degree elevation of Bézier segment

Express a segment γn(t) as γn+1(t)? (write bj,n(t) in terms of bk,n+1(t)?)

Easy to express both bj,n+1(t) and bj+1,n+1(t) in terms of bj,n(t)bj,n+1(t)

=(n+1

j)(1− t)n+1−j tj = n+1

n+1−j (1− t)bj,n(t)

bj+1,n+1(t) =(n+1j+1

)(1− t)n−j tj = n+1

j+1 t bj,n(t)

From these,bj,n(t) = n+1−j

n+1 bj,n+1(t) + j+1n+1 bj+1,n+1(t)

Expanding and collecting terms,

γn(t) =n∑i=0

bi,n(t)pi =n+1∑j=0

bj,n+1(t)qj = γn+1(t)

with q0 = p0, qn+1 = pn, andqi = j

n+1 pi−1 + (1− jn+1)pi

22

Page 85: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Degree elevation of Bézier segment

Express a segment γn(t) as γn+1(t)? (write bj,n(t) in terms of bk,n+1(t)?)

Easy to express both bj,n+1(t) and bj+1,n+1(t) in terms of bj,n(t)bj,n+1(t) =

(n+1j)(1− t)n+1−j tj

= n+1n+1−j (1− t)bj,n(t)

bj+1,n+1(t) =(n+1j+1

)(1− t)n−j tj = n+1

j+1 t bj,n(t)

From these,bj,n(t) = n+1−j

n+1 bj,n+1(t) + j+1n+1 bj+1,n+1(t)

Expanding and collecting terms,

γn(t) =n∑i=0

bi,n(t)pi =n+1∑j=0

bj,n+1(t)qj = γn+1(t)

with q0 = p0, qn+1 = pn, andqi = j

n+1 pi−1 + (1− jn+1)pi

22

Page 86: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Degree elevation of Bézier segment

Express a segment γn(t) as γn+1(t)? (write bj,n(t) in terms of bk,n+1(t)?)

Easy to express both bj,n+1(t) and bj+1,n+1(t) in terms of bj,n(t)bj,n+1(t) =

(n+1j)(1− t)n+1−j tj = n+1

n+1−j (1− t)bj,n(t)

bj+1,n+1(t) =(n+1j+1

)(1− t)n−j tj = n+1

j+1 t bj,n(t)

From these,bj,n(t) = n+1−j

n+1 bj,n+1(t) + j+1n+1 bj+1,n+1(t)

Expanding and collecting terms,

γn(t) =n∑i=0

bi,n(t)pi =n+1∑j=0

bj,n+1(t)qj = γn+1(t)

with q0 = p0, qn+1 = pn, andqi = j

n+1 pi−1 + (1− jn+1)pi

22

Page 87: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Degree elevation of Bézier segment

Express a segment γn(t) as γn+1(t)? (write bj,n(t) in terms of bk,n+1(t)?)

Easy to express both bj,n+1(t) and bj+1,n+1(t) in terms of bj,n(t)bj,n+1(t) =

(n+1j)(1− t)n+1−j tj = n+1

n+1−j (1− t)bj,n(t)

bj+1,n+1(t) =(n+1j+1

)(1− t)n−j tj

= n+1j+1 t bj,n(t)

From these,bj,n(t) = n+1−j

n+1 bj,n+1(t) + j+1n+1 bj+1,n+1(t)

Expanding and collecting terms,

γn(t) =n∑i=0

bi,n(t)pi =n+1∑j=0

bj,n+1(t)qj = γn+1(t)

with q0 = p0, qn+1 = pn, andqi = j

n+1 pi−1 + (1− jn+1)pi

22

Page 88: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Degree elevation of Bézier segment

Express a segment γn(t) as γn+1(t)? (write bj,n(t) in terms of bk,n+1(t)?)

Easy to express both bj,n+1(t) and bj+1,n+1(t) in terms of bj,n(t)bj,n+1(t) =

(n+1j)(1− t)n+1−j tj = n+1

n+1−j (1− t)bj,n(t)

bj+1,n+1(t) =(n+1j+1

)(1− t)n−j tj = n+1

j+1 t bj,n(t)

From these,bj,n(t) = n+1−j

n+1 bj,n+1(t) + j+1n+1 bj+1,n+1(t)

Expanding and collecting terms,

γn(t) =n∑i=0

bi,n(t)pi =n+1∑j=0

bj,n+1(t)qj = γn+1(t)

with q0 = p0, qn+1 = pn, andqi = j

n+1 pi−1 + (1− jn+1)pi

22

Page 89: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Degree elevation of Bézier segment

Express a segment γn(t) as γn+1(t)? (write bj,n(t) in terms of bk,n+1(t)?)

Easy to express both bj,n+1(t) and bj+1,n+1(t) in terms of bj,n(t)bj,n+1(t) =

(n+1j)(1− t)n+1−j tj = n+1

n+1−j (1− t)bj,n(t)

bj+1,n+1(t) =(n+1j+1

)(1− t)n−j tj = n+1

j+1 t bj,n(t)

From these,bj,n(t) = n+1−j

n+1 bj,n+1(t) + j+1n+1 bj+1,n+1(t)

Expanding and collecting terms,

γn(t) =n∑i=0

bi,n(t)pi =n+1∑j=0

bj,n+1(t)qj = γn+1(t)

with q0 = p0, qn+1 = pn, andqi = j

n+1 pi−1 + (1− jn+1)pi

22

Page 90: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Degree elevation of Bézier segment

Express a segment γn(t) as γn+1(t)? (write bj,n(t) in terms of bk,n+1(t)?)

Easy to express both bj,n+1(t) and bj+1,n+1(t) in terms of bj,n(t)bj,n+1(t) =

(n+1j)(1− t)n+1−j tj = n+1

n+1−j (1− t)bj,n(t)

bj+1,n+1(t) =(n+1j+1

)(1− t)n−j tj = n+1

j+1 t bj,n(t)

From these,bj,n(t) = n+1−j

n+1 bj,n+1(t) + j+1n+1 bj+1,n+1(t)

Expanding and collecting terms,

γn(t) =n∑i=0

bi,n(t)pi =n+1∑j=0

bj,n+1(t)qj = γn+1(t)

with q0 = p0, qn+1 = pn, andqi = j

n+1 pi−1 + (1− jn+1)pi 22

Page 91: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

Degree elevation of Bézier segment

Examples [p0 p1

]⇔

[p0 1

2(p0 + p1) p1]

[p0 p1 p2

]⇔

[p0 1

3(p0 + 2p1) 13(2p1 + p2) p2

]

23

Page 92: 2D Computer Graphics - w3.impa.brw3.impa.br/~diego/teaching/vg/slides-4.pdf · IMPA 1. Béziercurves. Curvemodelingbysplines 2. Curvemodelingbysplines Thinstripofwoodusedinbuildingconstruction

References

G. Farin. Curves and Surfaces for CAGD, A Practical Guide, 5th edition.Morgan Kaufmann, 2002.

24