2D Computer Graphics Diego Nehab Summer 2020 IMPA 1
Bézier curves
Curve modeling by splines 2
Anchored in place by lead weights called ducks Physical process Interpolating, smooth, energy minimizing No local control Curve modeling by splines Thin strip of wood used in building construction 3
Physical process Interpolating, smooth, energy minimizing No local control Curve modeling by splines Thin strip of wood used in building construction Anchored in place by lead weights called ducks 3
Interpolating, smooth, energy minimizing No local control Curve modeling by splines Thin strip of wood used in building construction Anchored in place by lead weights called ducks Physical process 3
No local control Curve modeling by splines Thin strip of wood used in building construction Anchored in place by lead weights called ducks Physical process Interpolating, smooth, energy minimizing ✓ 3
Curve modeling by splines Thin strip of wood used in building construction Anchored in place by lead weights called ducks Physical process Interpolating, smooth, energy minimizing ✓ No local control ✗ 3
Burmester curve 4
Lagrangian interpolation Computational process k + 1 vertices { p 0 , . . . , p k } defjne a curve k � j � = i ( t − j ) � γ ( t ) = p i t ∈ [ 0 , k ] j � = i ( i − j ) , � i = 0 Similar issues 5
B-splines Defjne a family of generating functions β n recursively − 1 2 ≤ t < 1 1 , β 0 ( t ) = 2 0 , otherwise β n = β n − 1 ∗ β 0 , n ∈ N Notation for convolution � ∞ h = f ∗ g ⇔ h ( t ) = f ( u ) g ( u − t ) dt −∞ 6
B-splines Defjne a family of generating functions β n recursively − 1 2 ≤ t < 1 1 , β 0 ( t ) = 2 0 , otherwise β n = β n − 1 ∗ β 0 , n ∈ N Notation for convolution � ∞ h = f ∗ g ⇔ h ( t ) = f ( u ) g ( u − t ) dt −∞ 1. 0.8 0.6 0.4 0.2 6 - 4 - 2 2 - 0.2
B-splines Defjne a family of generating functions β n recursively − 1 2 ≤ t < 1 1 , β 0 ( t ) = 2 0 , otherwise β n = β n − 1 ∗ β 0 , n ∈ N Notation for convolution � ∞ h = f ∗ g ⇔ h ( t ) = f ( u ) g ( u − t ) dt −∞ 1. 1. 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2 6 - 4 - 2 - 4 2 - 2 2 - 0.2 - 0.2
B-splines Defjne a family of generating functions β n recursively − 1 2 ≤ t < 1 1 , β 0 ( t ) = 2 0 , otherwise β n = β n − 1 ∗ β 0 , n ∈ N Notation for convolution � ∞ h = f ∗ g ⇔ h ( t ) = f ( u ) g ( u − t ) dt −∞ 1. 1. 1. 0.8 0.8 0.8 0.6 0.6 0.6 0.4 0.4 0.4 0.2 0.2 0.2 6 - 4 - 2 - 4 2 - 2 - 4 2 - 2 2 - 0.2 - 0.2 - 0.2
B-splines Defjne a family of generating functions β n recursively − 1 2 ≤ t < 1 1 , β 0 ( t ) = 2 0 , otherwise β n = β n − 1 ∗ β 0 , n ∈ N Notation for convolution � ∞ h = f ∗ g ⇔ h ( t ) = f ( u ) g ( u − t ) dt −∞ 1. 1. 1. 1. 0.8 0.8 0.8 0.8 0.6 0.6 0.6 0.6 0.4 0.4 0.4 0.4 0.2 0.2 0.2 0.2 6 - 4 - 2 - 4 2 - 2 - 4 2 - 2 - 4 2 - 2 2 - 0.2 - 0.2 - 0.2 - 0.2
1 t 1 t 0 1 t 1 t 0 t 1 0 otherwise 1 3 1 2 t 2 8 3 t 2 2 1 4 t 2 1 1 4 3 t 2 t 2 2 1 4 t 2 1 2 8 9 12 t t 2 2 0 otherwise B-splines Examples − 1 2 ≤ t < 1 1 , β 0 ( t ) = 2 0 , otherwise 7
1 3 1 2 t 2 8 3 t 2 2 1 4 t 2 1 1 4 3 t 2 t 2 2 1 4 t 2 1 2 8 9 12 t t 2 2 0 otherwise B-splines Examples − 1 2 ≤ t < 1 1 , β 0 ( t ) = 2 0 , otherwise 1 + t , − 1 ≤ t < 0 β 1 ( t ) = 1 − t , 0 ≤ t < 1 0 , otherwise 7
B-splines Examples − 1 2 ≤ t < 1 1 , β 0 ( t ) = 2 0 , otherwise 1 + t , − 1 ≤ t < 0 β 1 ( t ) = 1 − t , 0 ≤ t < 1 0 , otherwise 1 − 3 2 ≤ t < − 1 8 ( 3 + 2 t ) 2 , 2 4 ( 3 − 4 t 2 ) , 1 − 1 2 ≤ t < 1 β 2 ( t ) = 2 8 ( 9 − 12 t + 4 t 2 ) , 1 2 ≤ t < 2 1 2 0 , otherwise 7
Local control Differentiable n times everywhere Non-interpolating • Interpolation requires solving a banded linear system Many, many interesting properties B-splines k + 1 vertices { p 0 , . . . , p k } and generating function β n defjne a curve k � β n ( t − i ) p i , γ ( t ) = t ∈ [ 0 , k ] i = 0 8
Differentiable n times everywhere Non-interpolating • Interpolation requires solving a banded linear system Many, many interesting properties B-splines k + 1 vertices { p 0 , . . . , p k } and generating function β n defjne a curve k � β n ( t − i ) p i , γ ( t ) = t ∈ [ 0 , k ] i = 0 Local control ✓ 8
Non-interpolating • Interpolation requires solving a banded linear system Many, many interesting properties B-splines k + 1 vertices { p 0 , . . . , p k } and generating function β n defjne a curve k � β n ( t − i ) p i , γ ( t ) = t ∈ [ 0 , k ] i = 0 Local control ✓ Differentiable n times everywhere ✓ 8
Many, many interesting properties B-splines k + 1 vertices { p 0 , . . . , p k } and generating function β n defjne a curve k � β n ( t − i ) p i , γ ( t ) = t ∈ [ 0 , k ] i = 0 Local control ✓ Differentiable n times everywhere ✓ Non-interpolating ✗ • Interpolation requires solving a banded linear system ✓ 8
B-splines k + 1 vertices { p 0 , . . . , p k } and generating function β n defjne a curve k � β n ( t − i ) p i , γ ( t ) = t ∈ [ 0 , k ] i = 0 Local control ✓ Differentiable n times everywhere ✓ Non-interpolating ✗ • Interpolation requires solving a banded linear system ✓ Many, many interesting properties 8
Each segment defjned by linear interpolation i t 1 t p i t p i i 0 k 1 1 Local control Interpolates all control points Not differentiable at interpolated points Polylines k + 1 vertices { p 0 , . . . , p k } defjne k segments � � γ 0 ( t ) , . . . , γ k − 1 ( t ) t ∈ [ 0 , 1 ] , 9
Local control Interpolates all control points Not differentiable at interpolated points Polylines k + 1 vertices { p 0 , . . . , p k } defjne k segments � � γ 0 ( t ) , . . . , γ k − 1 ( t ) t ∈ [ 0 , 1 ] , Each segment defjned by linear interpolation γ i ( t ) = ( 1 − t ) p i + t p i + 1 , i ∈ { 0 , . . . , k − 1 } 9
Interpolates all control points Not differentiable at interpolated points Polylines k + 1 vertices { p 0 , . . . , p k } defjne k segments � � γ 0 ( t ) , . . . , γ k − 1 ( t ) t ∈ [ 0 , 1 ] , Each segment defjned by linear interpolation γ i ( t ) = ( 1 − t ) p i + t p i + 1 , i ∈ { 0 , . . . , k − 1 } Local control ✓ 9
Not differentiable at interpolated points Polylines k + 1 vertices { p 0 , . . . , p k } defjne k segments � � γ 0 ( t ) , . . . , γ k − 1 ( t ) t ∈ [ 0 , 1 ] , Each segment defjned by linear interpolation γ i ( t ) = ( 1 − t ) p i + t p i + 1 , i ∈ { 0 , . . . , k − 1 } Local control ✓ Interpolates all control points ✓ 9
Polylines k + 1 vertices { p 0 , . . . , p k } defjne k segments � � γ 0 ( t ) , . . . , γ k − 1 ( t ) t ∈ [ 0 , 1 ] , Each segment defjned by linear interpolation γ i ( t ) = ( 1 − t ) p i + t p i + 1 , i ∈ { 0 , . . . , k − 1 } Local control ✓ Interpolates all control points ✓ Not differentiable at interpolated points ✗ 9
Polylines k + 1 vertices { p 0 , . . . , p k } defjne k segments � � γ 0 ( t ) , . . . , γ k − 1 ( t ) t ∈ [ 0 , 1 ] , Each segment defjned by linear interpolation γ i ( t ) = ( 1 − t ) p i + t p i + 1 , i ∈ { 0 , . . . , k − 1 } Local control ✓ Interpolates all control points ✓ Not differentiable at interpolated points ✗ 9
kn 1 vertices p 0 p kn defjne k segments of degree n n n n 0 t n t 1 n t t 0 1 k Defjned recursively, for j 0 k 1 0 i t p i i nj n j 1 m m 1 m 1 t 1 t t t t i nj n j 1 m i i i 1 De Casteljau algorithm Geometric interpretation Bézier curves Generalization of linear interpolation 10
Defjned recursively, for j 0 k 1 0 i t p i i nj n j 1 m m 1 m 1 t 1 t t t t i nj n j 1 m i i i 1 De Casteljau algorithm Geometric interpretation Bézier curves Generalization of linear interpolation kn + 1 vertices { p 0 , . . . , p kn } defjne k segments of degree n � γ n 0 ( t ) , γ n n ( t ) , . . . , γ n � ( k − 1 ) n ( t ) t ∈ [ 0 , 1 ] , 10
De Casteljau algorithm Geometric interpretation Bézier curves Generalization of linear interpolation kn + 1 vertices { p 0 , . . . , p kn } defjne k segments of degree n � γ n 0 ( t ) , γ n n ( t ) , . . . , γ n � ( k − 1 ) n ( t ) t ∈ [ 0 , 1 ] , Defjned recursively, for j ∈ { 0 , . . . , k − 1 } � � γ 0 i ( t ) = p i , i ∈ nj , . . . , n ( j + 1 ) , γ m i ( t ) = ( 1 − t ) γ m − 1 ( t ) + t γ m − 1 � � i + 1 ( t ) , i ∈ nj , . . . , n ( j + 1 ) − m i 10
Recommend
More recommend