Curves Ton Sellarès Unversa e Grona Curves Many objecs we wan o moel are no sragh. Ex. Tex skeches ec. How can we reresen a curve? A large number of ons on he curve. Aroxmae wh connece lne segmens. ecewse lnear aroxmaon
Accuracy/Sace Trae-off Problem Pecewse lnear aroxmaons reure many eces o look goo realsc smooh ec.. Se of nvual curve ons woul ake large amouns of sorage. Soluon Hgher-orer formulae for coornaes on curve. If a smle formula won work subve curve no eces ha can be reresene by smle formulae. May sll be an arox. bu uses much less sorage. Downse: harer o secfy an rener. Curve Reresenaons Exlc: y = fx Examle: y = x The curve mus be a funcon only one value of y for each x Paramerc: xy = fg Examle: x y = cos sn Easy o secfy mofy conrol Easy o jon curve segmens smoohly Imlc: Fxy = Examle: x -y -r = Coul exs several values of y for each x Nee consrans o moel jus one ar of a curve Jonng curves ogeher smoohly s ffcul Har o secfy mofy conrol 4
Curve examles Two Ways o Defne a Crcle Paramerc: xu = r cos u yu = r sn u Imlc: Fxy = x² + y² - r² = 5 Paramerc Euaons Cubc referre alance beween flexbly an comlexy n secfyng an comung shae. x = a x + b x + c x + x Q=xyz y = a y + b y + c y + y Marcal exresson z = a z + b z + c z + z [] Q T Where: C T C a b c x x x x a b c y y y y az b z c z z
Jonng Curve Segmens G G C C geomerc connuy: Two curve segmens jon ogeher. geomerc connuy: The recon of he wo segmens angen vecors are eual a he jon on. connuy: Curves share he same on where hey jon. connuy: Tangen vecors of he wo segmens are eual n magnue an recon share he same aramerc ervaves. C connuy: Curves share he same aramerc secon ervaves where hey jon. C G unless angen vecor = [ ]. 7 Jonng Examles Jon on C C C TV TV TV Q S jons C C an C wh C C an C connuy resecvely. P Q P P Q Q an Q are C connuous because her angens TV an TV are eual. Q an Q are only G connuous. 8
Connuy examles Connuous n oson Connuous n oson an angen vecor Connuous n oson angen an curvaure 9 Curve Fng: Inerolaon an Aroxmaon Inerolaon curve mus ass hrough conrol ons Aroxmaon curve s nfluence by conrol ons
Curve reresenaons: olynomal bases Polynomals are easy o analyze ervaves reman olynomal ec. Monomal bass { x x x }. Coeffcens are geomercally meanngless. Manulaon s no robus. Number of coeffcens = olynomal rank. Polynomal Inerolaon An n-h egree olynomal fs a curve o n+ ons. Examle: f a secon egree curve o hree ons: xu= au + bu + c. conrol ons o nerolae: u x u x u x. solve for coeffcens a b c: lnear ens unknowns. calle Lagrange Inerolaon. resul s a curve ha changes o any conrol on affecs enre curve non-local [hs meho s oor]. We usually wan he curve o be as smooh as ossble: mnmze he wggles. hgh-egree olynomals are ba.
Lagrange Inerolaon The Lagrange nerolang olynomal s he olynomal of egree n- ha asses hrough he n ons x y x y x n y n an s gven by: P x n y n n xx xxn n x x x x n xx xx x x xx xx y y x x x x x x x x x x y j j n x x x j x n n Slnes A slne s a aramerc curve efne by conrol ons: erm slne aes from engneerng rawng where a slne was a ece of flexble woo use o raw smooh curves. conrol ons are ajuse by he user o conrol shae of curve. woo slnes: have secon-orer connuy ass hrough he conrol ons. Drawng curves wh woo slnes 4
Slne Curve Famles Herme cubc Defne by s enons an angen vecors a enons. Inerolaes all s conrol ons. Secal case of ezer an -Slne. ezer Inerolaes frs an las conrol ons. Curve s angen o frs an las segmens of conrol olygon. Easy o subve. Curve segmen les whn convex hull of conrol olygon. -Slne No guaranee o nerolae conrol ons. Curve segmen les whn convex hull of conrol olygon. Greaer local conrol han ezer. 9 5 4 8 7 5 Lnear Inerolaon Lnear nerolaon Ler s a common echnue for generang a new value ha s somewhere n beween wo oher values. y nerolang beween wo ons an by some arameer we oban a segmen:. << =. =
Lnear Inerolaon Three ways of wrng a segmen:. Weghe average of he conrol ons: Q = - +. ass Funcons: =-; = + = Q = +. Polynomal n : Q = - +. Marx form: Q 7 Herme Curve Examles R P P The se of Herme curves ha have he same values for he enons P an P angen vecors R an R of he same recon bu wh fferen magnues for R. The magnue of R remans fxe. R 8
Herme Curve Examles All angen vecor magnues are eual bu he recon of he lef angen vecor vares. 9 Herme Cubc Curves Is a cubc curve for whch he user roves: The enons of he curve: ; The aramerc ervaves of he curve a he enons: D D. D D P = a + b +c + n [] P = P = P' = D P' = D
Herme Coeffcens For each coornae we have 4 lnear euaons n 4 unknowns ounary Consran Marx
Herme Marx a b c D D M H = N H - G H P = T M H G H Herme ass Funcons H H H H P D D 4
Herme ass Funcons - Funcons: H H H H H H are calle Herme ass or lenng Funcons. - Observe ha: H +H +H +H. - An Herme cubc curve can be hough as a hgher orer exenson of lnear nerolaon: P=H + H +H D+H D 5 Dslayng Herme curves Evaluae he curve a a fxe se of arameer values an jon he ons wh sragh lnes. From Herme o ezer curves Herme curves are ffcul o use because we usually have conrol ons bu no ervaves. However Herme curves are he bass of he ezer curves. ezer curves are more nuve snce we only nee o secfy conrol ons.
ezer Curves of egree ezer curve s an aroxmaon of gven conrol ons. ezer curve of egree s efne over + conrol ons {P } =.... Have wo formulaons: Algebrac hgher orer exenson of lnear nerolaon. Geomerc. 7 ezer Curves: Algebrac Formulaon The user sules + conrol ons: ;=. Wre he curve of egree as: Q!/!*! when oherwse The funcons are he ernsen bass olynomals or ezer blenng funcons of egree. 8
9 ezer Curves: Algebrac Formulaon Q= an Q= ha means he ézer curve les on an. Q = - an Q = - - angens n sar an en ons. Q = =- + - - + + -- - +. Proof: They are all osve n nerval [] Ther sum s eual o : Symmery: Recurson: ernsen ass Polynomals
ezer Curves Cubc ezer Curves = For cubc ezer curves wo conrol ons efne enons an wo conrol he angens a he enons n a geomerc way. Some cubc ezer curves
ernsen ass Polynomals for = 4 z y x z y x z y x z y x Q Q = T M G D D ézer Marx for = From: We can euce: M G
ezer Cubc Curves Proeres The frs an las conrol ons are nerolae The angen o he curve a he frs conrol on s along he lne jonng he frs an secon conrol ons The angen a he las conrol on s along he lne jonng he secon las an las conrol ons The curve les enrely whn he convex hull of s conrol ons: Every on on curve s a lnear combnaon of he conrol ons The weghs of he combnaon are all osve The sum of he weghs s Therefore he curve s a convex combnaon of he conrol ons. y secfyng mulle concen ons a a verex we ull he curve n closer an closer o ha verex. 5 Convex Hull Proery The roeres of he ernsen olynomals ensure ha all ezer curves le n he convex hull of her conrol ons.
De Caseljau Algorhm Descrbes he curve as a recursve seres of lnear nerolaons. Is useful for rovng an nuve unersanng of he geomery nvolve. Proves a means for evaluang ezer curves. 7 De Caseljau Algorhm Selec [] value. Then: For : o n o P For j : o n o For := j o n o P [ j] Q : P : P [ n] P n ; [] : [ j] P; P [ j] ; Q / We ake ons / of he way 8
De Caseljau Algorhm for = We sar wh our orgnal se of ons an. Ler Ler Ler Where: Ler 9 De Caseljau Algorhm r r r Ler Ler r 4
4 r r Ler Q De Caseljau Algorhm r Q r Q ezer curve 4 Recursve Lnear Inerolaon Ler Ler Ler r r Ler Ler r r Ler Q r r Q
4 Exanng he Lers r r r r Ler Q Ler Ler Ler Ler Ler 44 ernsen Polynomal Form Q Q
De Caseljau Algorhm = Anmaons from Wkea = 45 De Caseljau Algorhm = Anmaons from Wkea =4 4
Drawng Algorhms Evaluae ons an raw lnes. Possbles:. Evaluae recursvely ernsen Polynomals.. Comue he geomerc marx.. Use he recursve algorhm of De Caseljau. 47 ezer Curves Drawbacks Are har o conrol an har o work wh. The nermeae ons on have obvous effec on shae. For large ses of ons curve evaes far from he ons. Degree corresons o number of conrol ons. Changng any conrol on can change he whole curve: We wan local suor: each conrol on only nfluences nearby oron of curve. 48
Pecewse Curves A sngle cubc Herme o ezer curve can only caure a small class of curves: A mos nflecon ons. One soluon s o rase he egree: Allows more conrol a he exense of more conrol ons an hgher egree olynomals. Conrol s no local one conrol on nfluences enre curve. Alernae mos common soluon s o jon eces of cubc curve ogeher no ecewse cubc curves: Toal curve can be broken no eces each of whch s cubc. Local conrol: each conrol on only nfluences a lme ar of he curve. Ineracon an esgn s much easer. 49 Pecewse ezer Curves If comlcae curves are o be generae hey can be forme by ecng ogeher several ézer secons. The curve segmens jon a knos. P P kno P P P P P P 5
Achevng Connuy For Herme curves: he user secfes he ervaves so C s acheve smly by sharng ons an ervaves across he kno. For ezer curves: They nerolae her enons so C s acheve by sharng conrol ons. The aramerc ervave s a consan mulle of he vecor jonng he frs/las conrol ons. So C s acheve by seng P =P =P an makng P an P an P collnear wh P-P =P -P. C comes from furher consrans on P an P C connuy 5 Why more curves? ezer an Herme curves have global nfluence: One coul creae a ezer curve ha reure 5 ons o efne he curve Movng any one conrol on woul affec he enre curve. Pecewse ezer or Herme on suffer from hs bu hey on enforce ervave connuy a jon ons. -Slnes conss of curve segmens whose olynomal coeffcens een on jus a few conrol ons: Local conrol 5
Cubc -Slne: Geomerc Defnon Aroxmaes n+ conrol ons: P P P n n >=. Consss of n cubc olynomal curve segmens: Q Q 4 Q n. Defne usng a non-ecreasng seuence of n- arameers: n+ knos. I s unform f he elemens of he kno seuence are unformly sace: + - =c = n whou loss of generaly we can assume = an + - = oherwse s non-unform. Curve segmen Q s efne by he conrol ons P - P - P - an P over he kno nerval [ + here exs local conrol. P P Q Q 4 P 9 P 8 Q 5 P 4 Q 9 P 7 Q Q 8 Q 7 P P P P 5 5 Unform Cubc -Slnes 54
55 Unform Cubc -Slnes To eermne he euaon of he curve segmen Q n [ 4 : Each conrol on affecs 4 curve segmens. Formulae euaons o solve he unknowns ha correson o 4 olynomal of egree. The euaons enforce he C C an C connuy beween ajonng curve segmens. We oban: 4 4 P P P P P k k k Q for n [ 4. 5 Unform Cubc -Slnes 4 4 P P P P P k k k Q From: We oban he marcal exresson: 4 P P P P Q
Unform Cubc -Slnes ass or blenng cubc funcons for curve segmen Q : 7 4 4 4 4 4 5 4 4 4 4 5 4 7 8 9 4 ass funcons for Q n [ 4 ]=[]. 57 Unform Cubc -Slnes I s no ffcul o see ha for he curve segmen Q n [ + = n we have: Q P k k k 4 where: 4 = 4 -. 58
Unform Cubc -Slnes The blenng funcons sum o one an are osve everywhere. The curve les nse he convex hull of he conrol ons. The curve oes no nerolae s enons. Unform -slnes are C. Movng a conrol on has a local effec. 59 Unform -Slnes: Algebrac Defnon A -slne curve Q s efne by: where: Q n P The P =...n are he n+ conrol ons. s he orer of he olynomal segmens of he -Slne curve. Tha means ha he curve s mae u of ecewse olynomal segmens of egree -. The orer s neenen of he number of conrol ons n+. are he unform -Slne bass or blenng funcons of egree -.
-Slne ass Funcons Gven a non-ecreasng kno seuence of n++ arameers n+ we efne: oherwse k for > an n [ -n+. If he enomnaor erms on he rgh han se of he las euaon are zero or he subscrs are ou of he range of he summaon lms hen he assocae fracon s no evaluae an he erm becomes zero avong / exressons. We wll concenrae n unform -slnes an whou loss of generaly we wll assume = - an + - =. Observe ha for a cubc =4 -Slne now we have n+5 arameers: n+4. -Slnes ass Funcons Comuaon 4
lenng funcons for = 8 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 8 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 8 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 8 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 has suor s non zero on nerval [--. s a consan funcon. + s jus shfe one un o he rgh because he unform elecon of arameer knos. We can wre: = -. lenng funcons for = 8 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 8 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 has suor on nerval [--. 8 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 s ecewse lnear mae u of wo lnear segmens jone connuously. We have: = -. 4
lenng funcons for = 8 7 5 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 has suor on nerval [-. 8 7 5 4 - -8 - -4 - - -8 - -4 s a ecewse uarac curve mae u of hree arabolc segmens ha are jone connuously. We have: = -. - - -8 - -4-4 5 8 lenng funcons for =4 cubc 4 7 5 4 4 4 - -8 - -4 - - -8 - -4 - - -8 - -4-4 8 4 5 5 4 has suor on nerval [-+. 4 s a ecewse cubc curve mae u of four cubc segmens ha are jone connuously.
Unform Cubc -slne lenng Funcons 7 4 4 4 4 44 54 4 5 4 - -5 - -5 - -5 5 5 5 5 4 45 5 We have: 4 = 4 -. Observe ha a nerval [ jus four of he funcons are non-zero: 4 4 4 an 4. They are he four funcons ha eermne he curve segmen Q. 7 Examle of Unform Cubc -Slne n= 5 Q n 4 P 5 4 P 4 P 4 P 4 P 44 P 4 4 P 5 54 P 5 - -7 - - - - -9 - - 5 8 5 9 9 4 4 47 The curve can sar unl here are 4 bass funcons acve. 8
Unform Cubc -slne a Arbrary The nerval from an neger arameer value o + s essenally he same as he nerval from o : The arameer value s offse by. A fferen se of conrol ons s neee. To evaluae a unform cubc -slne a an arbrary arameer value : Fn he greaes neger less han or eual o : = floor Evaluae: Q P k 4 k k Val arameer range: <n- where n s he number of conrol ons 9 Cubc -Slnes Shae Mofcaon Usng Conrol Pons Close curve To oban a close curve reea he conrol ons P P P a he en of he seuence: P P P... P P P. Pon nerolaon On can force he curve ass hrough a conrol on by gvng ha on a mullcy : P = P + = P + however angen sconnuy may resul. In arcular o force enons nerolaon le: P = P = P an P n- = P n- = P n. 7
NURS: Non-Unform Raonal -Slnes NURS are efne as: Q n n j w w j P j where every on conrol on has assocae a wegh. P 7 NURS NURS can be mae o ass arbrarly far or near o a conrol on by changng he corresonng wegh. All conc secons a crcle for examle can be moelle exacly: Consrucng a D-crcle wh NURS NURS nher all avanages of -Slnes localy... whle exenng he lbery of moellng. 7
NURS If all w are se o he value we oban sanar -Slnes. A ezer curve s a secal case of a -Slne so NURS can also reresen ezer curves. Toay NURS are sanar for moellng. 7 Curves Ton Sellarès Unversa e Grona