parametric spline curves

Save this PDF as:

Size: px
Start display at page:

Transcription

1 arameric sline curves comuer grahics arameric curves 9 fabio ellacini curves used in many conexs fons animaion ahs shae modeling differen reresenaion imlici curves arameric curves mosly used comuer grahics arameric curves 9 fabio ellacini

2 imlici reresenaion for D curves curves can be reresened imlicily as f ( ) f ( x, y) examle: circle of radius r cenered a origin x y r comuer grahics arameric curves 9 fabio ellacini arameric reresenaion for D curves curves can be reresened aramerically as x f ( u) y f ( u) ( u) examle: circle of radius r cenered a origin x y x r cos( u) y r sin( u) comuer grahics arameric curves 9 fabio ellacini 4

3 arameric reresenaion of slines general arameric curve can be wrien as ( ) f ( ) [, N] goals when defining f smoohness redicable and local conrol efficiency comuer grahics arameric curves 9 fabio ellacini 5 arameric reresenaion of slines slines: iecewise arameric olynomials olynomials are smooh conrolled by small number of local conrol oins disconinuiies a ineger inervals ( ) f ( ) [, N] comuer grahics arameric curves 9 fabio ellacini 6

4 slines - inuiion define segmen by blending conrol oins join segmens o form curve comuer grahics arameric curves 9 fabio ellacini 7 defining slines ick segmen inerolaing funcion imose consrains o define segmens i.e. conrol oins ha define he sline imose consrains o join segmens ogeher comuer grahics arameric curves 9 fabio ellacini 8

5 inerolaing vs. aroximaing slines inerolaing ass hrough conrol oins aroximaing guided by conrol oins comuer grahics arameric curves 9 fabio ellacini 9 smoohness smoohness described by degree of coninuiy C : same osiion a each side of joins C : same angen a each side of joins C : same curvaure a each side of joins C n : n-h derivaive defined a joins comuer grahics arameric curves 9 fabio ellacini

6 conrol local conrol changing conrol oins only affec locally he curve easy o conrol rue for all slines comuer grahics arameric curves 9 fabio ellacini conrol convex hull roery convex hull: smalles convex region enclosing all oins redicable behavior more efficien oeraions only some slines yes no comuer grahics arameric curves 9 fabio ellacini

7 efficiency affine invariance ransforming he sline same as ransforming conrols efficien algorihms, es. combined wih convex hull rue for all used slines comuer grahics arameric curves 9 fabio ellacini iecewise linear slines each segmen is a linear funcion ( ) a b [,] imose endoin consrains () () a b ( ) ( ) [,] comuer grahics arameric curves 9 fabio ellacini 4

8 oin blending inerreaion can inerre as blending of oins ( ) ( ) b ( ) b ( ) blending funcions do no deend on oins differen inervals only change conrol oins [,) comuer grahics arameric curves 9 fabio ellacini 5 marix noaion wrie blending funcions more convenienly ( ) ( ) ( ) [ ] comuer grahics arameric curves 9 fabio ellacini 6

9 joining line segmens imose C coninuiy a joins firs segmen second segmen imlies ( ) ( ( ) () ) () () () () general formula aroriaely rename conrol oins ( ) b ( k) k b ( k) k [, N], k floor( ) comuer grahics arameric curves 9 fabio ellacini 7 Hermie slines each segmen is a cubic olynomial funcion ( ) a b c d imose endoins and angens consrains () () () () comuer grahics arameric curves 9 fabio ellacini 8

10 comuer grahics arameric curves 9 fabio ellacini 9 Hermie slines c b a d c b a ) ( ) ( d c b a () d () a b c d ʹ () c ʹ () a b c comuer grahics arameric curves 9 fabio ellacini Hermie marix formulaion blending funcions [ ] ) (

11 comuer grahics arameric curves 9 fabio ellacini Bezier slines Hermie slines has oins and vecors conrols would like o use jus oins insigh: secify angens as difference of oins choose aroriae scaling value, see laer comuer grahics arameric curves 9 fabio ellacini Bezier slines [ ] 6 ) ( ) ( ) (

12 Bezier slines blending funcions comuer grahics arameric curves 9 fabio ellacini iecewise cubic slines smoohness C a joins by imosing eual angens Hermie: same angens Bezier: collinear conrol oins geomeric coninuiy if lengh of angen differs comuer grahics arameric curves 9 fabio ellacini 4

13 iecewise cubic slines conrol local conrol comes from he formulaion by segmens for each segmen, curve defined by 4 conrol oins convex hull when blending osiions b ( ) i and i b ( ) i comuer grahics arameric curves 9 fabio ellacini 5 iecewise cubic slines affine invariance affine invariance affine is combinaion of linear and ranslaion blending funcions sum o X(()) M() M b i () i i b i ()M i b i () i i b i ()(M i ) b i ()X( i ) i i comuer grahics arameric curves 9 fabio ellacini 6

14 Bezier slines widely used, esecially in D rimiive in PDF reresen C and C curves wih corners easily add oin a any osiion comuer grahics arameric curves 9 fabio ellacini 7 Camull-Rom slines inerolaing sline no convex hull roery as Hermie, derivaives auomaically deermined using adjacen conrol oins end angen using eiher adding oin or zers comuer grahics arameric curves 9 fabio ellacini 8

15 Camull-Rom slines ( )/ k k k comuer grahics arameric curves 9 fabio ellacini 9 drawing slines aroximae wih a seuence of line segmens efficiency: fas evaluaion, small number of segmens guaranees on accuracy aroaches uniform subdivision in (fas) recursive subdivision (small number of segmens) comuer grahics arameric curves 9 fabio ellacini

16 uniform subdivision evaluae sline a fixed inervals can be done efficienly comuer grahics arameric curves 9 fabio ellacini adaive subdivision - Bezier recursively subdivide sline unil line segmens aroximae well curve comuer grahics arameric curves 9 fabio ellacini

17 comuer grahics arameric curves 9 fabio ellacini De Caseljau algorihm - Bezier recursively do connec midoins of he conrol olygons connec midoins of he new segmens he midoin of his las segmen is on he curve and slis he curve in wo Bezier segmens so when conrol olygon is close o collinear comuer grahics arameric curves 9 fabio ellacini 4 B-Slines would like C coninuiy a joins give u inerolaion imose coninuiy consrains a joins [ ] ) ( k k k k

18 oher slines many oher yes non-uniform B-slines disconinuiies no evenly saces non-uniform raional B-slines (NURBS) raios of non-uniform B-slines invariance under ersecive can reresen conic secions exacly ofen used in D comuer grahics arameric curves 9 fabio ellacini 5 sline euivalence all slines seen so far are euivalen reresened by 4x4 marices can conver conrol oins from one o oher algorihms can be based on he mos efficien UIs can be based on he mos user-friendly comuer grahics arameric curves 9 fabio ellacini 6

19 D vs. D slines ofen use D slines in D by rojecing ono a lane D arameric slines have same formulaion jus use D vecors vs. D ones comuer grahics arameric curves 9 fabio ellacini 7