Bzier Curves CPSC 453 Fall 2018 Sonny Chan Todays Outline - - PowerPoint PPT Presentation

b zier curves
SMART_READER_LITE
LIVE PREVIEW

Bzier Curves CPSC 453 Fall 2018 Sonny Chan Todays Outline - - PowerPoint PPT Presentation

Bzier Curves CPSC 453 Fall 2018 Sonny Chan Todays Outline Quadratic Bzier curves de Casteljau formulation Bernstein polynomial form Bzier splines Cubic Bzier curves Drawing Bzier curves freeform shape?


slide-1
SLIDE 1

Bézier Curves

CPSC 453 – Fall 2018 Sonny Chan

slide-2
SLIDE 2

Today’s Outline

  • Quadratic Bézier curves
  • de Casteljau formulation
  • Bernstein polynomial form
  • Bézier splines
  • Cubic Bézier curves
  • Drawing Bézier curves
slide-3
SLIDE 3

How might we represent a

freeform shape?𝄟

slide-4
SLIDE 4

The Goal:

Create a system that provides an accurate, complete, and indisputable definition of freeform shapes.

slide-5
SLIDE 5

Parametric Segment by Linear Interpolation

p(u) = lerp(p0, p1, u) = (1 − u)p0 + up1 p0 p1

slide-6
SLIDE 6

Can we use the same machinery for

defining curves?

slide-7
SLIDE 7
slide-8
SLIDE 8

de Casteljau’s Algorithm (quadratic)

p1

0 = lerp(p0, p1, u)

p1

1 = lerp(p1, p2, u)

p(u) = lerp(p1

0, p1 1, u)

p0 p1 p2

slide-9
SLIDE 9

Bernstein Polynomials

0.25 0.5 0.75 1 0.25 0.5 0.75 1

b0,2(u) = (1 − u)2 b1,2(u) = 2u(1 − u) b2,2(u) = u2

slide-10
SLIDE 10

Bernstein Form of a Quadratic Bézier

p0 p1 p2 p(u) = (1 − u)2p0 + 2u(1 − u)p1 + u2p2 = b0,2(u)p0 + b1,2(u)p1 + b2,2(u)p2 =

2

X

i=0

bi,2(u)pi

slide-11
SLIDE 11

Property #1:

endpoint interpolation

slide-12
SLIDE 12

Endpoint Interpolation

p0 p1 p2 p(0) = p0 p(1) = p2

slide-13
SLIDE 13

Property #2:

endpoint tangents

slide-14
SLIDE 14
slide-15
SLIDE 15

Endpoint Tangents

p0 p1 p2 p0(0) = 2(p1 − p0) p0(1) = 2(p2 − p1)

slide-16
SLIDE 16

Property #3:

convex hull

slide-17
SLIDE 17

Convex Hull

p0 p1 p2

slide-18
SLIDE 18

Bézier Splines

  • f the 2nd degree
slide-19
SLIDE 19

Splines are just curve segments joined together:

p0 p1 p2 = q0 q1 q2

slide-20
SLIDE 20

Is it continuous?

C0 continuity: p(1) = q(0)

slide-21
SLIDE 21

Is it smooth?

slide-22
SLIDE 22

Is it smooth?

C1 continuity: p0(1) = q0(0)

slide-23
SLIDE 23

Is it smooth?

G1 continuity: p0(1) = s q0(0), s ∈ R+

slide-24
SLIDE 24

Using a Bézier spline to represent a

freeform shape

slide-25
SLIDE 25
slide-26
SLIDE 26

Bézier Curves

  • f the 3rd degree
slide-27
SLIDE 27
slide-28
SLIDE 28

de Casteljau Construction

u = 1

2

u = 1

4

u = 3

4

slide-29
SLIDE 29

0.25 0.5 0.75 1 0.25 0.5 0.75 1

Third Degree Bernstein Polynomials

b0,3(u) = (1 − u)3 b1,3(u) = 3u(1 − u)2 b2,3(u) = 3u2(1 − u) b3,3(u) = u3

slide-30
SLIDE 30

Bernstein form of a Cubic Bézier

p(u) = (1 − u)3p0 + 3u(1 − u)2p1 + 3u2(1 − u)p2 + u3p3 = b0,3(u)p0 + b1,3(u)p1 + b2,3(u)p2 + b3,3(u)p3 =

3

X

i=0

bi,3(u)pi p0 p1 p2 p3

slide-31
SLIDE 31

Do our properties still apply?

Endpoints Tangents Convex Hull

✓ ✓ ✓

slide-32
SLIDE 32

Property #4:

curve subdivision

slide-33
SLIDE 33

Curve Subdivision

slide-34
SLIDE 34

Drawing Curves

Or how to approximate them with straight line segments.

slide-35
SLIDE 35

Two methods for evaluating your curve

p0 p1 p2 p3 p1 p1

1

p1

2

p2 p2

1

p(u) u 1 − u p(u) =

n

X

i=0

bi,n(u)pi bi,n(u) = ✓n i ◆ ui(1 − u)n−i de Casteljau Bernstein Which one do you think is more efficient?

slide-36
SLIDE 36

How many line segments do you need?

The key question:

slide-37
SLIDE 37

Things to Remember

  • Bézier curves and splines can provide an accurate,

complete, and indisputable definition of freeform shapes

  • defined by de Casteljau construction or Bernstein polynomials
  • quadratic (3 points), cubic (4 points), or higher order
  • Splines are just curve segments joined together
  • can have various degrees of parametric/geometric continuity
  • Draw splines by approximating them with line segments,

just like parametric curves! (same considerations apply)