Dscrt Shlls Smulaton Xaofng M hs proct s an mplmntaton of Grnspun s dscrt shlls, th modl of whch s govrnd by nonlnar mmbran and flxural nrgs. hs nrgs masur dffrncs btwns th undformd confguraton and th dformd on. h nrgs ar nvarant undr rgd body transformaton of both th dformd and th undrformd shap and t s smpl to mplmnt as far as th stps on nd to tak s concrnd. h hardst part of th mplmntaton turns out to b th corrctly drvng of th drvatvs and buldng th lnar systm for mplct solvr. So th rmandr of th rport wll b focusng on rvalng th drvatv dtals whch th orgnal papr dd not touch. ctually, Etan Grnspun, th author of th dscrt shlls papr, postd an automatc drvatvs packag for us to gt drvatvs by program, unfortunatly, on of my purposs of playng th dscrt shlls smulaton s to practc drvng complx math, and to playng wth vctor, matrcs and tnsors by hand, so I dd not follow th orgnal authors way. Basc Framwork Instad of followng Grnspun s papr drctly, th mplmntaton follows Baraff s work on cloth smulaton. I dd not us nrgs drctly, nstad, I Dfn bhavor functon (x,, x n ) from X to R m, whch should b zro undr rstng stat, that s, whn th shlls ar n th orgnal confguratons, or, say, ar happy! ì f mx ívxf / m xv î æ xö æ v0 ö or h - v M f è ø è 0 ø ks E E f k s x x Wth dampng forc nd ust lk Baraff s papr dd, I modld dampng forc xplctly bcaus I us backward Eulr to solv th ODE systm. Grnspun usd mplct Nwmark and mbd th dampng forc nhrntly, whch I blv s a bttr way to do. æ ö f ( k s + kd ) ( ks + k d v) è ø ks k s kd k - - - d f æ ö æ ö è ø è ø æ ö s s d k - ( k + k ) è ø f v æ ö æ ö kd k d è ø è ø
Grnspun s modl Followng Grnspun s modl, th bhavor functons would b: L (- ) to kp dg lngth B (- ) ( ) h q - q to kp fac ara to kp surfac curvatur nd ust followng Baraff s work for th mplct systm drvaton: v0 x v æ ö æ ö æ 0 ö h - h v - f f M f è ø 0 M (f0 x+ v) è ø + è x v ø - f f v hm (f0 + h( v0 + v+ ) v) x v - f - f - f (I-hM -h M ) v hm ( f0 + h v0) x v x In my mplmntaton, I us th standard pr-condtond b-conugat gradnt mthod to solv th spars lnar systm. Baraff usd hs own modfd conugat gradnt t dosn t mattr n th mplmntaton, solvng th spars lnar systm s quck compard wth th ffort of computng th systm out. Som Notatons Bfor procd to th actual drvatvs (whch wll not b ntrstng at all!), I would lk to ntroduc som notatons to mak th drvatvs clan. If you hav rad Dan. Macr or Davd rtchard s wrt up for mplmntng Baraff s cloth smulaton, you wll fnd that th drvatons ar hug and scarng. t last I am vry scard! But I dd gt a lot hlp from ths works and workd out mn for th shlls modl. I followd thr way to us th skw-symmtrc transformaton. nd I xtndd th oprator to transform a matrx to a tnsor, and thy hav a lot of ntrstng bautful proprts, ust lk othr math! æ 0 wz w ö - y Dfn w wz 0 w - x, whr w s a vctor n R, and w s a matrx. - wy wx 0 è ø Suppos M ( v v v ), whr v s a vctor n æ v ö Dfn M v, that s, M s a tnsor. v è ø Not that th to transform a vctor to a skw-symmtrc matrx s a standard oprator, whl to transform a matrx to a tnsor s not. Lt s s som usful proprts of th skw-symmtrc oprators so that w can avod th xprssons from gong too larg and crazy. roprty. vv v v It follows that: R,
roprty. vv vv Just us th fact that v v v v to prov ths proprty. roprty. Mv vm æ ö roof: lt M m m m, thn è ø æ ö æ ö Mv m v m v m v vm vm vm - - - vm è ø è ø From th scond proprty, w can asly fnd that roprty 4. v v vv roprty 5. Iv v nd also som usful drvatv proprts rlatd to th oprator: æ æ v ö v ö v v x x v v v roprty 6. v v v y v y v v v è v z ø v è z ø Hr v v s ust a standard Jacoban. roprty 7. ( v v) ( vv) v v v v v v v + v v - v v -v v v v v v v v v ll ths proprts wll b usd wdly to smplfy th notatons throughout th followng drvatons. Forcs and thr drvatvs s dscrbd n th Grnspun s papr, thr ar two typ of nrgs: th mmbran nrgy and th flxural nrgy, and totally w hav two typs of mmbran forc: th on to kp lngth and th on to kp ara. nd for th flxural nrgy, th only typ of forc s to kp xtrnsc curvaturs. o kp lngth constant L (- ) (( )( )) L - - - -
Not that hr, th forc s: - ( - )( -) F ks (- ) ks nd notc that ( - )/ s a drctonal unt vctor, whch mak th lngth modl xactly a sprng systm modl. L I L I o kp ara constant h drvatvs rlatd wth ara forcs ar gvn hr, but n my mplmntaton, I skppd ths part bcaus I found that for a trangular msh systm, th forc modl whch to kp th lngths constant suffcs. (- ), whr ( ), and, th notaton s prtty strang, but anyway. s th ara of th trangl, and s th cross product of two adacnt dg vctors. 4 ( - ) ( k - ) ( -) ( k - ) ( - k) ( k - ) ( - k) (( ) ) (( ) ) - k - k æ ö ( k) - ( k) - è ø (( - k) ) ( -k) - I ( -k) ( k -) - (( - k) ) ( -k) - ( - I) ( -k) ( - ) + k k Lt a, w hav all th trms n valuatng th drvatvs:
(, k) ( k, ) a ( - ) ( k, ) ( k,) ( k, ) k(,) k (,) k (, ) a ( k (,) -k (, )) a( k (,) -k (, )) ( k (, ) -(, k) ) - a ( k (, ) -k(,) ) ( (, k) - k (,)) + o kp curvatur constant B ( q -q) h B q h Hr all th vctors ar normalzd q (cos q + sn q) q cosq snq - snq cos q sn q So, thngs ar rducd to fnd cos q and cos q n n sn q ( n n) q cos q sn q - sn q cos q sn q (( n n) ) æ ( n n) ö æ ö + ( n n) è ø è ø cos q ( n n) æ n ö æ n ö n + n è ø è ø ( n n) n n n -n q æ cosq snq - snq cos q ö / è ø snq æ cosq ö snq cosq æ snq ö cos q cosq sn q + - - è ø è ø
æ ( n n) ( n n) + sn q è ø ( n n ) ( n n ) ( n n ) + + + ( n n) æ n n ö n n + è ø cos q n n n n n n n + + n + ö æ n n ö n n - ( ) n n è ø n n n n n n + n - -n In th abov drvatvs,,,,, 4 Lt s only look at th frst trangl 4, and as for th scond trangl 4, vrythng s smlar. For th frst drvatvs of fac normal wth rspctv to th vrtcs, w hav ì n ( -4) ì n n ( -4) 4 4 n 0 n n 0 í, and t follows that n ( 4 -) í n ( 4 ) n - 4 4 n ( -) n ( ) n - 4 î 4 4 4 î 4 Now th scond drvatvs ì n n n n n n n 0 (,,4) 4 4 n n n I í 4 4 4 n n n I 4 4 î 4 hngs ar asy for th drvatvs on th dg: ì 0 I í 4 - I î 4 4 - nd for all,,,, 4, 0
Rfrncs [] Davd Baraff, ndrw Wtkn, Larg stps n cloth smulaton, rocdngs of th 5th Sggraph, p.p. 4-54, 998 [] Etan Grnspun, nl Hran, t al, Dscrt Shlls, rocdngs of th 00 M SIGGRH/Eurographcs Symposum on omputr anmaton, p.p.6-67, 00 [] Dan. Macr, Ral-tm loth, 000 GD rocdngs, avalabl onln at http://www.gdconf.com/archvs/000/ [4] Davd rtchard, Implmntng Baraff & Wtkn's loth Smulaton, onln rsourc: http://frcloth.ngmat.ca/documntaton.html