+ All Categories
Home > Documents > Bézier Curves -...

Bézier Curves -...

Date post: 15-Apr-2018
Category:
Upload: hatram
View: 215 times
Download: 1 times
Share this document with a friend
33
Bézier Curves CPSC 453 – Winter 2018 Sonny Chan 1
Transcript

Bézier Curves

CPSC 453 – Winter 2018Sonny Chan

1

Today’s Outline

• Quadratic Bézier curves

• de Casteljau formulation

• Bernstein polynomial form

• Bézier splines

• Cubic Bézier curves

• Drawing Bézier curves

2

How might we represent a

freeform shape? 𝄞3

The Goal:

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

freeform shapes.

4

Parametric Segment by Linear Interpolation

p(u) = lerp(p0,p1, u)

= (1� u)p0 + up1

p0

p1

5

Can we use the same machinery for

defining curves?

6

de Casteljau’s Algorithm (quadratic)

p10 = lerp(p0,p1, u)

p11 = lerp(p1,p2, u)

p(u) = lerp(p10,p

11, u)

p0

p1

p2

8

Bernstein Polynomials

0 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

9

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

=2X

i=0

bi,2(u)pi

10

Property #1:

endpoint interpolation

11

Endpoint Interpolation

p0

p1

p2

p(0) = p0

p(1) = p2

12

Property #2:

endpoint tangents

13

Endpoint Tangents

p0

p1

p2

p0(0) = 2(p1 � p0)

p0(1) = 2(p2 � p1)

15

Property #3:

convex hull

16

Convex Hull

p0

p1

p2

17

Bézier Splines of the 2nd degree18

Splines are just curve segments joined together:

p0

p1

p2 = q0

q1

q2

19

Is it continuous?

C0 continuity:

p(1) = q(0)

20

Is it smooth?

21

Is it smooth?C1 continuity:

p0(1) = q0(0)

22

Is it smooth?G1 continuity:

p0(1) = sq0(0), s 2 R+

23

Using a Bézier spline to represent a

freeform shape

24

Bézier Curves of the 3rd degree26

de Casteljau Construction

u = 12

u = 14 u = 3

4

27

0 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

28

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

=3X

i=0

bi,3(u)pi

p0

p1

p2

p3

29

Do our properties still apply?

Endpoints

Tangents

Convex Hull

✓✓✓

30

Property #4:

curve subdivision

31

Curve Subdivision

32

Drawing Curves

Or how to approximate them with straight line segments.

33

Two methods for evaluating your curve

p0 p1 p2 p3

p10 p1

1 p12

p20 p2

1

p(u)

u1� u

p(u) =nX

i=0

bi,n(u)pi

bi,n(u) =

✓ni

◆ui(1� u)n�i

de Casteljau

Bernstein

Which one do you think is more efficient?

34

How many line segments do you need?

The key question:

35

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)

36


Recommended