not smooth high degree approximation explicit y f x
play

Not Smooth High degree approximation Explicit y=f(x) Implicit - PowerPoint PPT Presentation

Polylines: Piecewise linear approximation to curves Not Smooth High degree approximation Explicit y=f(x) Implicit f(x,y)=0 Parametric x=x(t), y=y(t) Explicit Representation y = f ( x ) Essentially a function plot over some


  1. Polylines: Piecewise linear approximation to curves Not Smooth

  2. High degree approximation • Explicit y=f(x) • Implicit f(x,y)=0 • Parametric x=x(t), y=y(t)

  3. Explicit Representation y = f ( x ) • • Essentially a function plot over some interval x ∈ a , b [ ] • Simple to compute and plot • Simple to check whether point lies on curve • Cannot represent closed and multi-value curves

  4. Implicit Representation • Define curves implicitly as solution of equation system ! Straight line in 2D: ax + by + c = 0 ! Circle of radius R in 2D: x 2 + y 2 − R 2 = 0 ! Conic Section: Ax 2 + 2 Bxy + Cy 2 + 2 Dx + 2 Ey + F = 0 • Simple to check whether point lies on curve • Can represent closed and multi-value curves

  5. Parametric Curves • Describe position on the curve by a parameter u ∈ R b ⇒ 2D Curve c ( u ) = { x ( u ), y ( u )} u e.g.,line : c ( u ) = (1 − u ) a + ub a 0 1 • Hard to check whether point lies on curve • Simple to render • Can represent closed and multi-value curves

  6. Parametric Curves Parametric curves form a rich variety of free form smooth curves They are modeled as piecewise polynomials and have two aspects: • Interpolation • Approximation “ Splines ”

  7. Parametric Curves Splines

  8. Parametric Curves Cubic Splines 2 3 P ( t ) B B t B t B t t t t = + + + ≤ ≤ 1 2 3 4 1 2 4 i 1 B i t − = ∑ i 1 = 4 i 1 x ( t ) B t − = ∑ ix i 1 = 4 i 1 y ( t ) B t − = ∑ iy i 1 = 4 i 2 1 2 P ' ( t ) B ( i 1 ) t − B 2 B t 3 B t = ∑ − = + + i 2 3 4 i 1 =

  9. Parametric Curves Cubic Splines P 2 ’ P 2 t 2 P 1 ’ Let t 1 =0 P 1 t 1 P(0)=P 1 , P(t 2 )=P 2 P'(0)=P 1 ’ , P ’ (t 2 )=P 2 ’

  10. Parametric Curves Cubic Splines P 2 ’ P ( 0 ) B P = = 1 1 4 i 1 − P ( t ) B t = P 2 t 2 ∑ 2 i i 1 t t = = 2 1 2 3 P 1 ’ B B t B t B t P = + + + = 1 2 2 3 2 4 2 2 4 i 2 − P ' ( 0 ) B ( i 1 ) t B P ' = ∑ − = = i 2 1 i 1 = t 0 = 4 P 1 t 1 i 2 P ' ( t ) B ( i 1 ) t − = ∑ − 2 i i 1 = t t = 2 1 2 B 2 B t 3 B t P ' = + + = 2 3 2 4 2 2

  11. Parametric Curves Cubic Splines P 2 ’ Solving for B B B and B 1 2 3 4 B P , = 1 1 P 2 t 2 ' B P , = 2 1 ' ' P 1 ’ 3(P - P ) 2P P 2 1 1 2 B - - = 3 2 t t t 2 2 2 ' ' 2(P - P ) P P 1 2 1 2 B = + + 4 3 2 2 t t t P 1 t 1 2 2 2 Here P 1 and P 2 give the position of the endpoints and P 1 ’ and P 2 ’ give the direction of the tangent vectors.

  12. Parametric Curves Cubic Splines P 2 ’ P 2 t 2 3 ( P P ) 2 P ' P ' ⎛ ⎞ − P 1 ’ 2 2 1 1 2 P ( t ) P P ' t t ⎜ ⎟ = + + − − 1 1 ⎜ ⎟ 2 t t t ⎝ 2 2 ⎠ 2 2 ( P P ) P ' P ' ⎛ ⎞ − 3 1 2 1 2 t ⎜ ⎟ + + + P 1 t 1 ⎜ ⎟ 3 2 2 t t t ⎝ ⎠ 2 2 2 Thus, given the two end-points and the tangent vectors one can compute the cubic spline.

  13. Parametric Curves Cubic Splines t 3 t 2 t 1 Joining of Segments 2 SEGMENTS: P 1 P 2 P 3 (Points) P 1 ’ P 2 ’ P 3 ’ (Tangents) P 2 ’ is determined through the continuity condition

  14. Parametric Curves Cubic Splines t 3 t 2 t 1 Piecewise Spline of degree k has continuity of order (k-1) at the internal joints. Thus Cubic Splines have second order continuity i.e. P 2 ” (t) is continuous over the joint

  15. Parametric Curves Cubic Splines t 3 4 i 3 P ' ' ( t ) ( i 1 )( i 2 ) B t − t t t = ∑ − − ≤ ≤ i 1 2 i 1 = at t t = t 2 2 First segment t 1 ' ' P 6 B t 2 B = + 4 2 3 Second segment ' ' P 2 B = 3 So , 6 B t 2 B 2 B ( ) ( ) + = 4 2 3 3 seg 1 seg 2 Substitute the expressions for B 4 and B 3

  16. Parametric Curves Cubic Splines t 3 t 2 t 1 3 ( ) 2 2 t P ' 2 ( t t ) P ' t P ' t ( P P ) t ( P P ) + + + = − + − 3 1 3 2 2 2 3 2 3 2 3 2 1 t t 2 3 P ' ⎡ ⎤ 1 3 ( ) ⎢ ⎥ 2 2 [ t 2 ( t t ) t ] P ' t ( P P ) t ( P P ) + = − + − 3 3 2 2 2 2 3 2 3 2 1 ⎢ ⎥ t t 2 3 P ' ⎢ ⎥ ⎣ ⎦ 3

  17. Parametric Curves Cubic Splines In general, for the k th and (k+1) th segment (1 ≤ k ≤ n-2) P ' ⎡ ⎤ k ⎢ ⎥ [ t 2 ( t t ) t ] P ' + k 2 k 1 k 2 k 1 k 1 + + + + + ⎢ ⎥ P ' ⎢ ⎥ ⎣ ⎦ k 2 + 3 ( ) 2 2 t ( P P ) t ( P P ) = − + − k 1 k 2 k 1 k 2 k 1 k + + + + + t t k 1 k 2 + + Set of n-2 equations form a linear system for the tangent vectors P k ’

  18. Parametric Curves Cubic Splines t 2 ( t t ) t 0 … P ' + ⎡ ⎤ ⎡ ⎤ 3 2 3 2 1 ⎢ ⎥ ⎢ ⎥ 0 t 2 ( t t ) t P ' + 4 3 4 3 2 ⎢ ⎥ ⎢ ⎥ � � � � ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ … … … t 2 ( t t ) t P ' + ⎣ ⎦ ⎣ ⎦ n n n 1 n 1 n − − 3 ⎡ ⎤ ( ) 2 2 t ( P P ) t ( P P ) − + − 2 3 2 3 2 1 ⎢ ⎥ t t 2 3 ⎢ ⎥ 3 ( ) 2 2 t ( P P ) t ( P P ) ⎢ ⎥ − + − 3 4 3 4 3 2 = t t ⎢ ⎥ 3 4 � ⎢ ⎥ 3 ⎢ ⎥ ( ) ⎥ 2 2 t ( P P ) t ( P P ) − + − ⎢ n 1 n n 1 n n 1 n 2 − − − − t t ⎣ ⎦ n 1 n −

  19. Parametric Curves Cubic Splines P ' 1 0 � � ⎡ ⎤ ⎡ ⎤ 1 ⎢ ⎥ ⎢ ⎥ t 2 ( t t ) t P ' + 3 2 3 2 2 ⎢ ⎥ ⎢ ⎥ � t 2 ( t t ) t � + ⎢ ⎥ ⎢ ⎥ 4 3 4 3 ⎢ ⎥ ⎢ ⎥ � � � � ⎢ ⎥ ⎢ ⎥ P ' t 2 ( t t ) t ⎢ + ⎥ ⎢ ⎥ n 1 n n n 1 n 1 − − − ⎢ ⎥ ⎢ ⎥ � � 0 1 P ' ⎣ ⎦ ⎣ ⎦ n P ' ⎡ ⎤ 1 3 ⎢ ⎥ ( ) 2 2 t ( P P ) t ( P P ) − + − ⎢ ⎥ 2 3 2 3 2 1 t t 2 3 ⎢ ⎥ � ⎢ ⎥ = ⎢ ⎥ ⎢ ⎥ 3 ( ) 2 2 t ( P P ) t ( P P ) ⎢ ⎥ − + − n 1 n n 1 n n 1 n 2 − − − − t t ⎢ ⎥ n 1 n − P ' ⎢ ⎥ ⎣ ⎦ n

  20. Parametric Curves Cubic Splines Solving for B B B and B 1 2 3 4 B P , = 1k k ' B P , = 2k k ' ' 3(P - P ) 2P P k 1 k k k 1 B - - + + = 3k 2 t t t k 1 k 1 k 1 + + + ' ' 2(P - P ) P P k k 1 k k 1 B + + = + + 4k 3 2 2 t t t k 1 k 1 k 1 + + +

  21. Parametric Curves Cubic Splines B 1 0 0 0 P ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ 1 k k ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ B 0 1 0 0 P ' 2 k k ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ = 2 2 B 3 / t 2 / t 3 / t 1 / t P − − − ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ 3 k k 1 k 1 k 1 k 1 k 1 + + + + + ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ 3 2 3 2 B 2 / t 1 / t 2 / t 1 / t P ' − ⎣ ⎦ ⎣ ⎦ ⎣ ⎦ 4 k k 1 k 1 k 1 k 1 k 1 + + + + + 0 t t 4 ≤ ≤ k 1 i 1 + P ( t ) B t − = ∑ k ik 1 k n 1 ≤ ≤ − i 1 = [ ] [ T 2 3 ] 1 t t t B B B B = 1 k 2 k 3 k 4 k

  22. Parametric Curves Cubic Splines P ( t ) k 1 0 0 0 P ⎡ ⎤ ⎡ ⎤ k ⎢ ⎥ ⎢ ⎥ 0 1 0 0 P ' [ ] k 2 3 1 t t t ⎢ ⎥ ⎢ ⎥ = 2 2 3 / t 2 / t 3 / t 1 / t P − − − ⎢ ⎥ ⎢ ⎥ k 1 k 1 k 1 k 1 k 1 + + + + + ⎢ ⎥ ⎢ ⎥ 3 2 3 2 2 / t 1 / t 2 / t 1 / t P ' − ⎣ ⎦ ⎣ ⎦ k 1 k 1 k 1 k 1 k 1 + + + + + [ 2 2 3 3 2 3 3 ( 1 3 t / t 2 t / t ) ( t 2 t / t t / t ) = − + − + k 1 k 1 k 1 k 1 + + + + ] [ T 2 2 3 3 3 3 2 ( 3 t / t 2 t / t ) ( t / t t / t ) P P ' P P ' ] − − k 1 k 1 k 1 k 1 k k k 1 k 1 + + + + + +

  23. Parametric Curves Cubic Splines Substituting u=t/t k+1 rearranging T P ( u ) [ F ( u ) F ( u ) F ( u ) F ( u ) ] [ P P P ' P ' ] = k 1 2 3 4 k k 1 k k 1 + + 0 u 1 ≤ ≤ 1 k n 1 ≤ ≤ − 3 2 F ( u ) 2 u 3 u 1 = − + 1 3 2 F ( u ) 2 u 3 u F 1 , F 2 , F 3 , F 4 are called the = − + 2 2 Blending Functions F ( u ) u ( u 2 u 1 ) t = − + 3 k 1 + 2 F ( u ) u ( u u ) t = − 4 k 1 +

  24. Parametric Curves Cubic Splines P k (u)=[F][G] Where F is the Blending function matrix and G Is the geometric information .

  25. Parametric Curves Cubic Splines F 1 F 2 • F 1 (0)=1,F 2 (0)=0,F 3 (0)=0,F 4 (0)=0 1 curve passes P 1 F 3 • F 1 (1)=0,F 2 (1)=1,F 3 (1)=0,F 4 (1)=0 curve passes P 2 t=0 • F 2 =1-F 1 ,F 4 =1-F 3 t=1 F 4 • Relative magnitudes of F 1 ,F 2 > F 3 ,F 4

  26. Parametric Curves Cubic Splines Piecewise Cubic Splines are determined by position vectors, tangent vectors and parameter value t k . The value of t k can be chosen using either Chord Length parameterization or Uniform Parameterization. If t k =1 for all k then the Spline is called Normalized Spline.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend