b zier curves
play

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?


  1. Bézier Curves CPSC 453 – Fall 2018 Sonny Chan

  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

  3. freeform shape? 𝄟 How might we represent a

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

  5. Parametric Segment by Linear Interpolation p 1 p ( u ) = lerp( p 0 , p 1 , u ) = (1 − u ) p 0 + u p 1 p 0

  6. Can we use the same machinery for defining curves?

  7. de Casteljau’s Algorithm (quadratic) p 1 p 1 0 = lerp( p 0 , p 1 , u ) p 1 1 = lerp( p 1 , p 2 , u ) p 2 p ( u ) = lerp( p 1 0 , p 1 1 , u ) p 0

  8. Bernstein Polynomials 1 b 0 , 2 ( u ) = (1 − u ) 2 0.75 b 1 , 2 ( u ) = 2 u (1 − u ) 0.5 b 2 , 2 ( u ) = u 2 0.25 0 0.25 0.5 0.75 1

  9. Bernstein Form of a Quadratic Bézier p ( u ) = (1 − u ) 2 p 0 + 2 u (1 − u ) p 1 + u 2 p 2 = b 0 , 2 ( u ) p 0 + b 1 , 2 ( u ) p 1 + b 2 , 2 ( u ) p 2 p 1 2 X = b i, 2 ( u ) p i i =0 p 0 p 2

  10. Property #1: endpoint interpolation

  11. p 1 Endpoint Interpolation p 2 p (1) = p 2 p (0) = p 0 p 0

  12. Property #2: endpoint tangents

  13. p 1 p 2 Endpoint Tangents p 0 (1) = 2( p 2 − p 1 ) p 0 (0) = 2( p 1 − p 0 ) p 0

  14. Property #3: convex hull

  15. p 1 Convex Hull p 2 p 0

  16. Bézier Splines of the 2nd degree

  17. Splines are just curve segments joined together: q 1 p 1 p 2 = q 0 q 2 p 0

  18. Is it continuous? C 0 continuity: p (1) = q (0)

  19. Is it smooth?

  20. C 1 continuity: Is it smooth? p 0 (1) = q 0 (0)

  21. G 1 continuity: Is it smooth? p 0 (1) = s q 0 (0) , s ∈ R +

  22. Using a Bézier spline to represent a freeform shape

  23. Bézier Curves of the 3rd degree

  24. de Casteljau Construction u = 1 2 u = 1 u = 3 4 4

  25. Third Degree Bernstein Polynomials 1 b 0 , 3 ( u ) = (1 − u ) 3 0.75 b 1 , 3 ( u ) = 3 u (1 − u ) 2 0.5 b 2 , 3 ( u ) = 3 u 2 (1 − u ) 0.25 b 3 , 3 ( u ) = u 3 0 0.25 0.5 0.75 1

  26. Bernstein form of a Cubic Bézier p ( u ) = (1 − u ) 3 p 0 + 3 u (1 − u ) 2 p 1 + 3 u 2 (1 − u ) p 2 + u 3 p 3 = b 0 , 3 ( u ) p 0 + b 1 , 3 ( u ) p 1 + b 2 , 3 ( u ) p 2 + b 3 , 3 ( u ) p 3 3 X = b i, 3 ( u ) p i p 1 p 3 i =0 p 0 p 2

  27. ✓ Endpoints ✓ Do our properties still apply? Tangents ✓ Convex Hull

  28. Property #4: curve subdivision

  29. Curve Subdivision

  30. Drawing Curves Or how to approximate them with straight line segments.

  31. Two methods for evaluating your curve p 0 p 1 p 2 p 3 p 1 p 1 p 1 Bernstein 0 1 2 1 − u u p 2 p 2 n 0 1 X p ( u ) = b i,n ( u ) p i p ( u ) i =0 ✓ n ◆ u i (1 − u ) n − i b i,n ( u ) = de Casteljau i Which one do you think is more efficient?

  32. The key question: How many line segments do you need?

  33. 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)

Recommend


More recommend