parametric spline curves
play

parametric spline curves 1 curves used in many contexts fonts - PowerPoint PPT Presentation

parametric spline curves 1 curves used in many contexts fonts (2D) animation paths (3D) shape modeling (3D) different representation implicit curves parametric curves (mostly used) 2D and 3D curves are mostly the same use vector notation


  1. parametric spline curves 1

  2. curves used in many contexts fonts (2D) animation paths (3D) shape modeling (3D) different representation implicit curves parametric curves (mostly used) 2D and 3D curves are mostly the same use vector notation to simplify treatment 2

  3. implicit representation implicit curve representation f ( P ) = 0 e.g. XY circle: x 2 y 2 r 2 f ( P ) = 0 → + − = 0 3

  4. parametric representation parametric curve representation P ( u ) = ( f x ( u ), f y ( u ), f z ( u )) e.g. XY circle: P ( u ) = ( r cos θ , r sin θ ,0) 4

  5. parametric representation goals when defining f smoothness efficiency local control curve controls only affect a piece of the curve predictable behaviour easy to use for designers 5

  6. splines 6

  7. splines splines: piecewise parametric polynomials split curve into segments at intervals P s t s P ( t ) N ( t − ) t s uniform splines: split at integer intervals t s ∈ 0,1,2 ⋯ each segment is a polynomial: smooth and efficient P s piecewise curve, i.e. splitting: local control P s t s t s P ( t ) = ( t − ) with t ∈ [0, N ), t − ∈ [0,1) 7

  8. splines intuition: define segment by "blending" control points intuition: join segments to from a curve 8

  9. splines approximating: guided by control points interpolating: pass through control points 9

  10. defining splines pick segment interpolating function smoothness pick segment control points local control impose constraints to define segments join segments together ensure smoothness 10

  11. defining splines smoothness described by degree of continuity : same position at each side of joints C 0 : same tangent at each side of joints C 1 : same curvature at each side of joints C 2 : -th derivative defined at joints C n n 11

  12. defining splines local control: control points affects the curve locally easy to control, true for all splines 12

  13. defining splines convex hull: smallest convex region enclosing all points convex hull property: curve lies in control points convex hull predictable and efficient, but only some splines 13

  14. defining splines affine invariance: transform controls equiv. transform spline efficient, all splines 14

  15. linear splines 15

  16. linear splines segment: linear function P ( t ) = t a + b with t ∈ [0,1) control points: end points and P (0) = P 0 P (1) = P 1 P ( t ) = (1 − t ) P 0 + t P 1 16

  17. linear splines blending functions: interpret as blending control points P ( t ) = b 0 ( t ) P 0 + b 1 ( t ) P 1 b 0 ( t ) = (1 − t ) b 1 ( t ) = t 17

  18. linear splines joining segments: impose continuity C 0 segments share endpoints continuity only for straight lines C 1 P 0 P 1 P 0 P 1 (1) = (0) → = 1 0 18

  19. bezier cubic splines 19

  20. bezier cubic splines segment: cubic function t 3 t 2 P ( t ) = a + b + t c + d with t ∈ [0,1) control points: end points and tangents P 0 P 3 , and P ′ P ′ (0) ∝ P 1 − P 0 (1) ∝ P 2 − P 3 20

  21. bezier cubic splines blending functions: Bernstein polynomials P ( t ) = b 0 ( t ) P 0 + b 1 ( t ) P 1 + b 2 ( t ) P 2 + b 3 ( t ) P 3 = (1 − t ) 3 b 0 ( t ) = 3 t (1 − t ) 2 b 1 ( t ) t 2 b 2 ( t ) = 3 (1 − t ) = t 3 b 3 ( t ) 21

  22. bezier cubic splines joining segments: impose continuity C 0 segments share endpoints continuity by collinear tangents C 1 P 0 P 1 P 0 P 1 (1) = (0) → = 1 0 22

  23. bezier cubic splines properties: local control comes from the formulation by segments for each segment, curve defined by 4 control points 23

  24. bezier cubic splines properties: convex hull each segment is convex sum of control points since and b i ( t ) ≥ 0 ∑ i b i ( t ) = 1 24

  25. bezier cubic splines properties: affine invariance X ( P ( t )) = M P ( t ) + t = = M ( ∑ b i ( t ) P i ) + t = i = ∑ b i ( t ) M P i + ( ∑ b i ( t ) ) t = i i = ∑ b i ( t )( M P i + t ) = ∑ b i ( t ) X ( P i ) i i 25

  26. rendering splines 26

  27. rendering splines tesselation: approximate splines with line segments segments are efficient to draw in hardware and software more segments to provide better approximation uniform tesselation: split interval uniformly t fast to compute and simple to implement generates many segments adaptive tesselation: split recursively until good enough more complex to implement less segments with guaranteed approximation 27

  28. uniform tesselation split in segments uniformly at K t k = 1/ k 28

  29. adaptive tesselation De Casteljau algorithm: recurdively split to small splines if flat enough: draw control segments, otherwise split each control segment: Q i = ( P i + P i +1 )/2 29

  30. adaptive tesselation De Casteljau algorithm: recurdively split to small splines split new segments: R i = ( Q i + Q i +1 )/2 split again: S = ( R i + R i +1 )/2 30

  31. adaptive tesselation De Casteljau algorithm: recurdively split to small splines two Bezier splines: , { P 0 Q 0 R 0 , , , S } { S , R 1 Q 2 P 3 , , } recurse algorithm as above 31

  32. other splines 32

  33. other cubic splines types Bezier splines most used today (2D APIs, PDF, fonts) Hermite splines: approximating control: end points and tangents Catmull-Rom splines: interpolating used very little B-splines: continuity at joints C 2 impose 3 continuity constraints cubic splines can be converted into one another by changing control points 33

  34. other spline degree linear and cubic most used can define splines for other polynomial degree e.g. Beziers use Bernestein polynomials of degree n 34

  35. other spline functions uniform splines: split segments at integers non-uniform splines: split segments at arbitrary points non-uniform rational B-splines (NURBS) ratios of B-splines invariance under perspective can represent conic sections exactly often used in 3D 35

Recommend


More recommend