Disabled external gits
This commit is contained in:
834
cs457-gc/assignment_2_1/data/ball.obj
Normal file
834
cs457-gc/assignment_2_1/data/ball.obj
Normal file
@@ -0,0 +1,834 @@
|
||||
v 3.06161699786838e-17 -7.49879891330929e-33 0.5
|
||||
v 3.06161699786838e-17 -7.49879891330929e-33 -0.5
|
||||
v 0.154508497187474 -3.78436673043416e-17 -0.475528258147577
|
||||
v 0.293892626146237 -7.19829327805997e-17 -0.404508497187474
|
||||
v 0.404508497187474 -9.90760072617093e-17 -0.293892626146236
|
||||
v 0.475528258147577 -1.16470831848909e-16 -0.154508497187473
|
||||
v 0.5 -1.22464679914735e-16 7.6571373978539e-16
|
||||
v 0.475528258147577 -1.16470831848909e-16 0.154508497187474
|
||||
v 0.404508497187474 -9.90760072617092e-17 0.293892626146237
|
||||
v 0.293892626146237 -7.19829327805998e-17 0.404508497187473
|
||||
v 0.154508497187475 -3.78436673043417e-17 0.475528258147576
|
||||
v 0.21857645514496 0.136716465258129 0.428407447861946
|
||||
v 0.475945187701446 -0.132880263668928 0.0762824608354488
|
||||
v 0.218576349120797 -0.134908613951094 -0.428980239040003
|
||||
v 0.228603425820446 -0.140038091834834 0.422054269660211
|
||||
v 0.437104447096958 0.151793486569612 0.189468835862535
|
||||
v 0.42898023903994 0.134908613950884 -0.21857634912105
|
||||
v 0.428980239039898 -0.134908613951062 -0.218576349121023
|
||||
v 0.218576349121032 0.134908613951053 -0.428980239039896
|
||||
v 0.340440645253916 0.134908613951044 0.34044064525392
|
||||
v 0.476615030125843 -0.131924241455095 -0.0737163996315581
|
||||
v 0.407622547196207 -0.259520994885 -0.128423955051913
|
||||
v 0.338436818269637 -0.252043139096244 -0.26820659215246
|
||||
v 0.340989631871085 -0.116746524471516 -0.34654915954341
|
||||
v 0.075316277025205 -0.134908613951047 0.475528258147578
|
||||
v 0.0753162770252058 0.134908613951052 -0.475528258147577
|
||||
v 0.337051887252752 0.13152434625125 -0.345104870499591
|
||||
v 0.342307229899869 0.259749321291958 -0.255648294433281
|
||||
v 0.235302886190634 0.257758938760451 0.358040334654413
|
||||
v 0.0930553185121102 0.241091096498632 0.428037137273972
|
||||
v 0.414887348894352 0.253233345682864 -0.117223548665273
|
||||
v 0.309219636002729 0.365205559163796 -0.144941768535501
|
||||
v 0.116382730487621 0.357335962703667 0.329797013029059
|
||||
v 0.220295554503833 0.356044147287606 -0.273317459830304
|
||||
v 0.173924737961772 0.443407381211481 -0.152118637293744
|
||||
v 0.0757439138278267 0.415836842579461 -0.2671003179923
|
||||
v 0.0224933467184133 0.480041055177656 -0.138038526134294
|
||||
v 0.248065266401332 0.358015947011543 0.245536566096914
|
||||
v 0.138163331821839 0.43047956133561 0.21353744639334
|
||||
v 0.360552014587397 0.346405942121308 -0.00227333235984791
|
||||
v 0.123093945281709 0.484207258358844 -0.0197790694319915
|
||||
v -0.0375624502146155 0.498585389330104 0.0012930121510933
|
||||
v -0.0319756224028659 0.329253812136088 0.374925975048146
|
||||
v -0.0571707300985015 0.188277472409031 0.459655415505214
|
||||
v 0.44634465869394 0.222444950782125 0.0359817943817138
|
||||
v 0.114071738612042 0.30750614917439 -0.377395822274126
|
||||
v 0.236387555749274 0.430565411758525 0.0934577427723124
|
||||
v 0.378115930351658 0.292151103254715 0.147227973161872
|
||||
v 0.0698331513994325 -0.131524346251195 -0.477309833660296
|
||||
v -0.0276507157238025 0.368077837732622 -0.337274581446689
|
||||
v -0.132019323454869 0.46789161623721 -0.116826083086996
|
||||
v -0.178527337205295 0.268217150323689 0.382344805303572
|
||||
v -0.195982573985885 0.117715178528912 0.444672876885665
|
||||
v -0.188769871137012 0.462097824846099 0.0288363663352296
|
||||
v -0.311118332326446 0.185953595932789 0.344422187801651
|
||||
v 0.298513275017753 -0.364576673892107 -0.167253321318123
|
||||
v -0.27446477920923 0.408828269442573 -0.0867671082739308
|
||||
v -0.321076581736832 0.0337877006396921 0.381796044958135
|
||||
v -0.406068994209582 0.0890512487956863 0.27780901178606
|
||||
v -0.396337226815336 -0.0658166787739775 0.297632268807486
|
||||
v 0.137344602759695 -0.267387515925555 0.399550217644719
|
||||
v -0.469353412437567 -0.00745235730436951 0.172197086513736
|
||||
v -0.438850244007533 -0.16046355744979 0.17793793880195
|
||||
v -0.488260481987745 -0.0978280168539874 0.0450708425427184
|
||||
v -0.433483128474169 -0.244453321072111 0.0483213321946162
|
||||
v -0.460620100758965 -0.173287974513347 -0.0883198769579221
|
||||
v -0.383511806626786 -0.309356779000242 -0.08495338406711
|
||||
v -0.336717499334961 -0.365993326701377 0.0516740791080927
|
||||
v -0.267862281691792 -0.414575366652434 -0.0798565176542698
|
||||
v -0.205085219904653 -0.452251021719178 0.0583872069088724
|
||||
v -0.389473197418456 -0.226083984285031 -0.217247924138414
|
||||
v -0.445256364809781 -0.0799966822341631 -0.212949055945092
|
||||
v -0.00351125947165275 -0.267035886479874 0.422704987418922
|
||||
v -0.353169743739217 -0.125114465368412 -0.331085340452809
|
||||
v -0.38892388844103 0.0261181792321889 -0.313139026174485
|
||||
v -0.278756909608118 -0.262391732725563 -0.321628922740179
|
||||
v -0.249429844449192 -0.39750217428021 0.172559480007787
|
||||
v -0.125203314206269 -0.478452051724907 -0.0735375027587528
|
||||
v -0.0528582364531956 -0.493487744300911 0.0606288138087549
|
||||
v 0.271731582933658 -0.249600298700644 0.337433901267964
|
||||
v -0.495847117939593 0.0542719818547096 0.034499095880349
|
||||
v 0.341636271151409 -0.364235836672196 -0.0248377438078891
|
||||
v -0.278221380393658 -0.0165162196036634 -0.415114535979952
|
||||
v -0.385894465893779 0.231366911979078 0.218070661102819
|
||||
v 0.129422773211733 -0.26368230955868 -0.404624993543385
|
||||
v 0.17079787798835 -0.360453290963367 0.301498772648173
|
||||
v -0.2972397651044 0.134475553784439 -0.378899521608367
|
||||
v -0.390729424978202 0.17308135749756 -0.259563788196669
|
||||
v 0.0302401087170613 -0.494617483324727 -0.0666264287973931
|
||||
v -0.0447104151313644 -0.455911463185833 -0.200363960118914
|
||||
v -0.289781305004565 -0.107480642258869 0.393032704503674
|
||||
v -0.28072748874216 0.276043192337753 -0.308208100199367
|
||||
v 0.106085899784673 -0.483055958177403 0.0735032185430484
|
||||
v -0.143288452953271 0.380504725979635 0.291006138693707
|
||||
v -0.0207720062787277 -0.262149359393134 -0.425260199319106
|
||||
v -0.0793282266177742 -0.112493174960849 0.480679017691543
|
||||
v -0.210229488803243 0.104747954203238 -0.441397131988602
|
||||
v 0.435024352571936 -0.127806035969131 0.210759174982314
|
||||
v 0.298839864283654 -0.34288662805342 0.207661974894498
|
||||
v -0.343961566185834 -0.213169748618088 0.293681969588004
|
||||
v -0.217656630917657 -0.259665634918282 0.367694641054313
|
||||
v -0.318981501523703 0.381763369474201 0.0500752574969736
|
||||
v -0.395445063483211 0.303503289973959 -0.0388452666581461
|
||||
v 0.00695685172784659 -0.466794760772503 0.179037017204205
|
||||
v -0.141786434074944 -0.0639250457860653 -0.475194902785753
|
||||
v 0.123376202006679 -0.445805073774975 -0.189831896621448
|
||||
v 0.0273264572598231 -0.36207385125428 -0.343737968475292
|
||||
v -0.179178868825853 0.231344360320625 -0.40543152308883
|
||||
v -0.131442519100517 -0.37228536331636 -0.30680037880178
|
||||
v 0.213344976802497 -0.44944368426887 -0.0498427080320272
|
||||
v -0.095411435088729 0.468568967697982 0.146081417588813
|
||||
v 0.19556911033449 -0.349389679263868 -0.299465482329545
|
||||
v -0.212579734450761 0.392914303643436 -0.22456225527287
|
||||
v 0.00442729082563762 0.431790532829453 0.252066131907487
|
||||
v 0.251435921428911 -0.424020659066107 0.0835850351458869
|
||||
v -0.0716881267417996 0.0362403081699758 0.493505271043782
|
||||
v 0.409702957808806 -0.250532734704164 0.139200701163351
|
||||
v 0.354048851093961 -0.123591021755264 0.33071841554491
|
||||
v -0.409329654955812 0.269763307055223 0.0983717019288848
|
||||
v -0.23775056881332 0.409432492346691 0.160747321096556
|
||||
v -0.280167779637764 0.310303261210272 0.274258821799984
|
||||
v 0.0390199999029228 -0.340176969429353 0.364358434892671
|
||||
v -0.106955495739533 -0.389774683020182 0.294340310538035
|
||||
v -0.125152025350624 -0.457070129870627 0.159448634144933
|
||||
v 0.250205349609497 0.430527105380925 -0.0452072401182732
|
||||
v -0.15862733630032 -0.0449406159687499 0.472035707563119
|
||||
v -0.372118237460504 -0.283526014116421 0.176468174662014
|
||||
v -0.235245742246689 -0.152187819676347 -0.41412354231191
|
||||
v 0.479986141812706 0.124680814448665 -0.063780860578784
|
||||
v -0.0761042573074939 0.431963531953512 -0.240032600039915
|
||||
v -0.288453021308633 -0.353652776154199 -0.204265925734934
|
||||
v -0.458840137015611 0.057463941494015 -0.190167358112447
|
||||
v -0.444083105517519 0.194920415588484 -0.121639742603844
|
||||
v -0.178055249060845 -0.43316536366806 -0.175111667230364
|
||||
v -0.491963173165518 -0.0298523928793253 -0.0841490991531884
|
||||
v -0.45636138284715 0.138396610027018 0.150268648023688
|
||||
v -0.345904715972311 0.313415014736247 -0.179223201639723
|
||||
v -0.153169726530236 -0.269052072762942 -0.392619430258638
|
||||
v -0.0419923946510265 0.170189522618945 -0.468265058681734
|
||||
v 0.243612070418092 0.241981955824921 -0.363452737232445
|
||||
v 0.338867576345089 0.252678472264692 0.2670624559087
|
||||
v 0.426863022631355 -0.25994025908482 0.0147993789376581
|
||||
v 0.158342102182598 -0.434609327079221 0.18984865417522
|
||||
v 0.0452931243905481 0.0952764475019849 0.488744239285072
|
||||
v -0.237259629761916 0.0166159415076913 0.439808797744033
|
||||
v 0.247175666187241 -0.238473344419651 -0.363365730423495
|
||||
v 0.0577997827759178 0.48434516267528 0.10985876616872
|
||||
v -0.334770924239934 0.332574086299653 0.165296416795679
|
||||
v -0.153183582101622 0.339412359720881 -0.333667559470828
|
||||
v 0.36785960116632 -0.228792320684729 0.249666553277471
|
||||
v 0.483390586525237 0.102332156736947 0.0765615475049495
|
||||
v 0.139648641361451 0.213951152339616 -0.429794324507027
|
||||
v -0.0358864034291634 0.302032201639968 -0.396848478920397
|
||||
v -0.180786711862885 -0.175443810495746 0.431897712627121
|
||||
v 0.348215026659532 -0.346723777603642 0.0923521372398145
|
||||
v -0.114480413553308 -0.290654614949134 0.390402522688358
|
||||
v -0.272442803422386 -0.321472772094441 0.269128548588341
|
||||
v -0.466114498296331 0.180818120755528 0.00648703972541844
|
||||
v -0.129415184584831 -0.203585571998795 -0.437955048918034
|
||||
v 0.0643376427947934 -0.412575814735467 0.275030661590622
|
||||
v -0.485934856252322 0.0906364933467189 -0.0751820560562512
|
||||
v -2.77555756156289e-16 3.19189119579733e-16 -1.2490009027033e-16
|
||||
v -0.251828742757562 0.0139490906784806 -0.0181338406388946
|
||||
v 0.197996662720562 -0.0791211777945037 0.136432807235424
|
||||
v 0.125255777218953 0.210831018463626 -0.063969097850248
|
||||
v -0.139628236563409 -0.21265335644906 0.00545121255949739
|
||||
v -0.145223690886062 0.189924594351579 0.11159305462841
|
||||
v -0.112897563504534 -0.0373976158431084 -0.223966661594476
|
||||
v 0.225528258147577 -0.0232431701377701 -0.114912387106339
|
||||
v -0.118530098445147 -0.0689806932344922 0.2117841676383
|
||||
v 0.098269738040353 0.147959392484917 0.178021817259433
|
||||
v 0.100852235573853 -0.219450649709681 -0.0387973024559412
|
||||
v -0.100480207820675 0.192284757140571 -0.148991345058649
|
||||
v 0.08807336311451 0.0516996280513727 -0.271061939721184
|
||||
v 0.272113071694785 0.101244013250397 0.0512575837900759
|
||||
v 0.0341720627218518 -0.221571915156144 0.170600381517002
|
||||
v 0.113793744063312 -0.150466918879953 -0.232830800332848
|
||||
v 0.068592399702004 -0.0245878691620408 0.288679790541826
|
||||
v -0.0741210186337665 0.111594614690448 0.278407708187608
|
||||
v -0.0351094203418499 0.30351870487887 -0.00261521319733849
|
||||
v -0.258447343925187 0.0495111872633636 0.167086499211952
|
||||
v -0.271439309774019 -0.125349807194904 0.104052998028547
|
||||
v -0.0485204373172835 -0.250891695571267 -0.169649174254392
|
||||
v -0.245408905954284 -0.137064807392418 -0.132337064396614
|
||||
v -0.247561324014027 0.19563057757812 -0.0400712992459122
|
||||
v -0.245489451032576 0.0855397985783712 -0.187709278356085
|
||||
v 0.27254656245515 -0.16399276001755 -0.00766125806031415
|
||||
v 0.273716986928946 0.149504817170547 -0.136480234333616
|
||||
v 0.0525334922800396 0.245214764318482 -0.222591039627852
|
||||
v -0.025453222260026 0.265072731295802 0.212780231418037
|
||||
v 0.10188342337719 0.303246953287615 0.102540160700209
|
||||
v -0.14157478784597 -0.241776139413833 0.180194715613577
|
||||
v -0.0121617817639016 -0.325829668630181 0.0394634260162139
|
||||
v 0.222619980200421 0.0438990087026778 0.254181668630204
|
||||
v 0.187862004819913 -0.26556009247797 0.101876795667186
|
||||
v 0.342239361396159 -0.0424148965243595 0.0738730045314498
|
||||
v -0.120466338945889 0.114580505991094 -0.297963959751455
|
||||
v 0.15154406307463 -0.163641254596307 0.268108582070898
|
||||
f 166 170 163 182
|
||||
f 165 162 171 180
|
||||
f 167 171 162 180
|
||||
f 4 5 27 169
|
||||
f 163 166 162 170
|
||||
f 4 24 169 177
|
||||
f 167 173 163 185
|
||||
f 162 163 167 173
|
||||
f 158 136 181 185
|
||||
f 162 171 170 178
|
||||
f 162 163 170 181
|
||||
f 162 167 163 181
|
||||
f 4 169 27 174
|
||||
f 170 171 162 179
|
||||
f 162 173 165 174
|
||||
f 170 178 171 179
|
||||
f 158 181 163 185
|
||||
f 162 176 164 178
|
||||
f 162 170 167 181
|
||||
f 162 170 176 178
|
||||
f 162 166 163 184
|
||||
f 167 170 162 179
|
||||
f 129 169 6 196
|
||||
f 162 165 169 174
|
||||
f 73 176 170 178
|
||||
f 119 181 136 185
|
||||
f 4 169 174 177
|
||||
f 72 132 135 163
|
||||
f 27 174 169 188
|
||||
f 158 119 136 185
|
||||
f 64 66 163 182
|
||||
f 167 162 171 179
|
||||
f 66 135 64 163
|
||||
f 7 129 6 196
|
||||
f 162 173 167 180
|
||||
f 95 177 168 183
|
||||
f 162 177 172 183
|
||||
f 4 24 5 169
|
||||
f 27 169 5 188
|
||||
f 162 169 165 175
|
||||
f 162 164 169 175
|
||||
f 129 175 169 196
|
||||
f 168 177 162 183
|
||||
f 132 161 135 163
|
||||
f 119 148 84 167
|
||||
f 162 165 173 180
|
||||
f 164 162 171 175
|
||||
f 165 171 162 175
|
||||
f 158 81 161 163
|
||||
f 30 171 178 179
|
||||
f 64 81 62 163
|
||||
f 169 162 174 177
|
||||
f 66 163 182 184
|
||||
f 169 177 23 187
|
||||
f 162 170 166 176
|
||||
f 54 167 102 185
|
||||
f 68 166 67 182
|
||||
f 162 168 163 173
|
||||
f 164 171 162 178
|
||||
f 161 158 163 185
|
||||
f 65 68 67 182
|
||||
f 166 168 162 183
|
||||
f 129 6 169 188
|
||||
f 162 163 168 184
|
||||
f 165 175 40 191
|
||||
f 129 169 175 188
|
||||
f 119 167 84 181
|
||||
f 62 64 163 182
|
||||
f 18 169 23 187
|
||||
f 67 182 166 184
|
||||
f 162 168 166 184
|
||||
f 168 174 162 177
|
||||
f 164 162 169 172
|
||||
f 167 181 119 185
|
||||
f 126 178 170 179
|
||||
f 72 163 135 184
|
||||
f 72 132 163 186
|
||||
f 54 180 167 185
|
||||
f 62 163 81 181
|
||||
f 162 168 173 174
|
||||
f 66 135 163 184
|
||||
f 165 174 173 189
|
||||
f 38 141 171 191
|
||||
f 140 174 188 189
|
||||
f 161 163 132 186
|
||||
f 24 23 18 169
|
||||
f 62 163 181 182
|
||||
f 65 182 67 184
|
||||
f 166 162 172 183
|
||||
f 140 174 27 188
|
||||
f 162 166 172 176
|
||||
f 4 14 24 177
|
||||
f 23 169 24 177
|
||||
f 169 172 162 177
|
||||
f 163 173 168 186
|
||||
f 60 181 170 182
|
||||
f 119 148 167 185
|
||||
f 57 173 51 180
|
||||
f 72 163 184 186
|
||||
f 41 35 165 180
|
||||
f 41 37 35 180
|
||||
f 141 171 48 175
|
||||
f 56 177 172 187
|
||||
f 135 161 81 163
|
||||
f 95 49 168 177
|
||||
f 102 54 120 167
|
||||
f 34 140 188 189
|
||||
f 176 178 73 198
|
||||
f 162 172 164 176
|
||||
f 141 171 175 194
|
||||
f 60 170 91 182
|
||||
f 130 37 180 189
|
||||
f 56 23 177 187
|
||||
f 22 18 23 187
|
||||
f 121 55 167 179
|
||||
f 6 169 21 196
|
||||
f 60 91 100 182
|
||||
f 12 30 171 178
|
||||
f 65 66 182 184
|
||||
f 91 170 100 182
|
||||
f 164 172 169 187
|
||||
f 116 178 126 179
|
||||
f 125 165 40 191
|
||||
f 69 67 166 184
|
||||
f 96 73 170 178
|
||||
f 113 51 57 173
|
||||
f 57 173 180 185
|
||||
f 136 119 84 181
|
||||
f 84 167 121 181
|
||||
f 83 75 74 186
|
||||
f 134 131 69 183
|
||||
f 167 179 55 181
|
||||
f 130 180 173 189
|
||||
f 145 179 170 181
|
||||
f 48 171 141 191
|
||||
f 48 175 171 191
|
||||
f 102 167 148 185
|
||||
f 64 135 81 163
|
||||
f 30 178 144 179
|
||||
f 57 180 54 185
|
||||
f 121 52 55 179
|
||||
f 40 175 165 188
|
||||
f 60 91 170 181
|
||||
f 130 51 173 180
|
||||
f 76 183 168 184
|
||||
f 74 75 72 184
|
||||
f 140 19 27 174
|
||||
f 165 180 171 191
|
||||
f 49 174 168 177
|
||||
f 83 74 168 186
|
||||
f 84 121 55 181
|
||||
f 69 70 78 166
|
||||
f 120 167 54 180
|
||||
f 121 167 55 181
|
||||
f 148 121 84 167
|
||||
f 74 128 168 184
|
||||
f 131 166 69 183
|
||||
f 156 170 176 192
|
||||
f 74 75 184 186
|
||||
f 67 68 69 166
|
||||
f 65 67 66 184
|
||||
f 117 164 150 196
|
||||
f 96 156 154 170
|
||||
f 98 150 164 196
|
||||
f 145 170 58 181
|
||||
f 161 133 158 185
|
||||
f 24 18 5 169
|
||||
f 78 183 166 193
|
||||
f 34 32 165 188
|
||||
f 98 117 150 196
|
||||
f 41 35 125 165
|
||||
f 35 34 32 165
|
||||
f 73 156 170 176
|
||||
f 74 184 168 186
|
||||
f 72 184 75 186
|
||||
f 133 161 132 186
|
||||
f 119 102 148 185
|
||||
f 150 164 117 195
|
||||
f 34 188 165 189
|
||||
f 57 54 102 185
|
||||
f 148 102 120 167
|
||||
f 170 181 163 182
|
||||
f 12 178 171 194
|
||||
f 6 18 21 169
|
||||
f 5 169 6 188
|
||||
f 136 62 81 181
|
||||
f 171 180 167 190
|
||||
f 58 170 91 181
|
||||
f 78 166 70 193
|
||||
f 2 168 49 174
|
||||
f 34 140 28 188
|
||||
f 40 125 32 165
|
||||
f 38 48 141 191
|
||||
f 169 174 165 188
|
||||
f 40 175 48 191
|
||||
f 113 130 51 173
|
||||
f 66 72 135 184
|
||||
f 169 187 21 196
|
||||
f 131 166 183 184
|
||||
f 74 128 83 168
|
||||
f 18 21 169 187
|
||||
f 7 6 21 196
|
||||
f 64 65 66 182
|
||||
f 69 166 131 184
|
||||
f 56 112 172 177
|
||||
f 76 168 128 184
|
||||
f 166 182 68 192
|
||||
f 159 95 168 183
|
||||
f 34 165 35 189
|
||||
f 96 170 126 178
|
||||
f 172 183 89 193
|
||||
f 150 118 98 164
|
||||
f 172 177 106 183
|
||||
f 168 183 166 184
|
||||
f 111 167 120 180
|
||||
f 17 5 6 188
|
||||
f 30 171 179 190
|
||||
f 130 37 51 180
|
||||
f 40 165 32 188
|
||||
f 100 182 170 192
|
||||
f 112 106 172 177
|
||||
f 74 76 128 184
|
||||
f 170 179 167 181
|
||||
f 32 125 35 165
|
||||
f 41 165 125 191
|
||||
f 113 173 57 185
|
||||
f 2 168 174 197
|
||||
f 18 6 5 169
|
||||
f 167 180 111 190
|
||||
f 126 170 145 179
|
||||
f 12 144 30 178
|
||||
f 91 126 154 170
|
||||
f 69 68 70 166
|
||||
f 4 27 19 174
|
||||
f 137 92 173 186
|
||||
f 25 73 178 198
|
||||
f 29 171 141 194
|
||||
f 60 58 91 181
|
||||
f 120 167 111 190
|
||||
f 111 120 54 180
|
||||
f 150 118 164 198
|
||||
f 30 33 29 171
|
||||
f 69 131 67 184
|
||||
f 95 49 159 168
|
||||
f 68 182 127 192
|
||||
f 117 187 164 196
|
||||
f 166 176 170 192
|
||||
f 33 171 30 190
|
||||
f 57 51 54 180
|
||||
f 137 92 113 173
|
||||
f 22 23 56 187
|
||||
f 37 36 35 189
|
||||
f 29 38 141 171
|
||||
f 150 164 195 198
|
||||
f 180 190 171 191
|
||||
f 145 91 58 170
|
||||
f 41 180 165 191
|
||||
f 82 187 172 195
|
||||
f 137 173 185 186
|
||||
f 113 137 173 185
|
||||
f 112 106 177 183
|
||||
f 164 187 117 195
|
||||
f 154 170 156 192
|
||||
f 148 120 121 167
|
||||
f 165 188 174 189
|
||||
f 76 138 168 183
|
||||
f 116 96 126 178
|
||||
f 76 138 128 168
|
||||
f 82 56 172 187
|
||||
f 172 176 166 193
|
||||
f 9 98 118 164
|
||||
f 30 29 12 171
|
||||
f 70 166 192 193
|
||||
f 33 38 29 171
|
||||
f 165 175 169 188
|
||||
f 96 73 156 170
|
||||
f 141 175 16 194
|
||||
f 96 25 73 178
|
||||
f 45 175 40 188
|
||||
f 98 164 9 196
|
||||
f 121 94 52 190
|
||||
f 106 56 112 172
|
||||
f 70 68 77 166
|
||||
f 70 192 124 193
|
||||
f 169 175 164 196
|
||||
f 31 45 40 188
|
||||
f 172 177 169 187
|
||||
f 106 89 172 183
|
||||
f 113 149 130 173
|
||||
f 149 189 173 197
|
||||
f 121 167 94 190
|
||||
f 171 175 165 191
|
||||
f 93 110 193 195
|
||||
f 172 193 110 195
|
||||
f 125 40 47 191
|
||||
f 3 49 14 177
|
||||
f 96 154 126 170
|
||||
f 78 90 183 193
|
||||
f 152 26 174 189
|
||||
f 113 57 137 185
|
||||
f 16 194 175 196
|
||||
f 60 62 181 182
|
||||
f 110 82 172 195
|
||||
f 92 149 113 173
|
||||
f 146 23 24 177
|
||||
f 34 28 32 188
|
||||
f 163 185 173 186
|
||||
f 72 75 132 186
|
||||
f 91 145 126 170
|
||||
f 38 171 33 191
|
||||
f 124 192 104 193
|
||||
f 18 22 21 187
|
||||
f 77 166 68 192
|
||||
f 130 36 37 189
|
||||
f 30 179 43 190
|
||||
f 131 183 76 184
|
||||
f 89 110 172 193
|
||||
f 121 120 94 167
|
||||
f 9 164 118 194
|
||||
f 173 174 168 197
|
||||
f 12 171 29 194
|
||||
f 56 23 112 177
|
||||
f 116 1 96 178
|
||||
f 17 27 5 188
|
||||
f 140 27 28 188
|
||||
f 104 192 176 193
|
||||
f 120 94 167 190
|
||||
f 112 177 107 183
|
||||
f 82 56 110 172
|
||||
f 169 164 187 196
|
||||
f 164 175 171 194
|
||||
f 118 194 164 198
|
||||
f 3 174 49 177
|
||||
f 9 164 194 196
|
||||
f 70 166 77 192
|
||||
f 167 180 173 185
|
||||
f 146 24 14 177
|
||||
f 30 44 43 179
|
||||
f 101 154 156 192
|
||||
f 152 174 140 189
|
||||
f 166 182 163 184
|
||||
f 92 149 173 197
|
||||
f 171 190 33 191
|
||||
f 60 63 62 182
|
||||
f 45 129 175 188
|
||||
f 163 181 167 185
|
||||
f 150 195 99 198
|
||||
f 167 179 171 190
|
||||
f 143 193 176 195
|
||||
f 164 176 172 195
|
||||
f 171 178 164 194
|
||||
f 164 178 176 198
|
||||
f 9 194 16 196
|
||||
f 129 17 6 188
|
||||
f 78 89 90 193
|
||||
f 10 118 15 194
|
||||
f 10 15 178 194
|
||||
f 150 99 80 198
|
||||
f 83 186 168 197
|
||||
f 111 190 180 191
|
||||
f 77 68 127 192
|
||||
f 127 68 65 182
|
||||
f 118 15 194 198
|
||||
f 10 15 11 178
|
||||
f 19 3 4 174
|
||||
f 9 16 8 196
|
||||
f 45 31 129 188
|
||||
f 30 144 44 179
|
||||
f 149 153 189 197
|
||||
f 40 32 31 188
|
||||
f 159 168 138 183
|
||||
f 124 123 104 192
|
||||
f 89 183 90 193
|
||||
f 104 176 143 193
|
||||
f 62 63 64 182
|
||||
f 137 185 133 186
|
||||
f 178 194 15 198
|
||||
f 47 40 48 191
|
||||
f 89 110 106 172
|
||||
f 75 83 87 186
|
||||
f 123 176 104 192
|
||||
f 105 49 2 168
|
||||
f 107 177 95 183
|
||||
f 87 186 83 197
|
||||
f 173 186 92 197
|
||||
f 73 122 176 198
|
||||
f 159 138 95 183
|
||||
f 149 153 50 189
|
||||
f 112 107 106 183
|
||||
f 137 133 88 186
|
||||
f 120 111 94 190
|
||||
f 110 56 106 172
|
||||
f 93 193 143 195
|
||||
f 170 182 166 192
|
||||
f 173 180 165 189
|
||||
f 10 178 11 194
|
||||
f 114 190 111 191
|
||||
f 52 53 55 179
|
||||
f 173 189 174 197
|
||||
f 139 174 26 189
|
||||
f 19 140 152 174
|
||||
f 116 145 53 179
|
||||
f 36 34 35 189
|
||||
f 100 127 182 192
|
||||
f 116 126 145 179
|
||||
f 134 78 90 183
|
||||
f 112 23 146 177
|
||||
f 89 93 110 193
|
||||
f 115 110 93 195
|
||||
f 63 60 100 182
|
||||
f 159 128 138 168
|
||||
f 11 144 12 178
|
||||
f 46 140 34 189
|
||||
f 168 184 163 186
|
||||
f 16 175 151 196
|
||||
f 106 90 89 183
|
||||
f 76 131 109 183
|
||||
f 41 42 37 180
|
||||
f 2 3 26 174
|
||||
f 143 176 86 195
|
||||
f 70 77 124 192
|
||||
f 137 88 92 186
|
||||
f 16 151 8 196
|
||||
f 73 122 156 176
|
||||
f 3 2 49 174
|
||||
f 150 80 118 198
|
||||
f 155 117 187 195
|
||||
f 160 143 104 176
|
||||
f 84 55 59 181
|
||||
f 25 61 73 198
|
||||
f 33 30 43 190
|
||||
f 166 183 172 193
|
||||
f 105 168 2 197
|
||||
f 107 85 95 177
|
||||
f 150 117 99 195
|
||||
f 79 78 70 193
|
||||
f 141 16 20 194
|
||||
f 16 141 48 175
|
||||
f 111 180 147 191
|
||||
f 45 129 151 175
|
||||
f 86 195 176 198
|
||||
f 156 122 123 176
|
||||
f 122 86 176 198
|
||||
f 11 178 12 194
|
||||
f 29 141 20 194
|
||||
f 92 108 149 197
|
||||
f 156 176 123 192
|
||||
f 82 22 56 187
|
||||
f 160 104 123 176
|
||||
f 95 85 49 177
|
||||
f 48 40 45 175
|
||||
f 84 59 136 181
|
||||
f 51 37 42 180
|
||||
f 105 159 49 168
|
||||
f 13 187 117 196
|
||||
f 43 179 52 190
|
||||
f 139 174 189 197
|
||||
f 134 109 131 183
|
||||
f 160 86 143 176
|
||||
f 96 1 25 178
|
||||
f 114 111 147 191
|
||||
f 59 55 58 181
|
||||
f 19 26 3 174
|
||||
f 99 195 86 198
|
||||
f 110 115 82 195
|
||||
f 155 187 82 195
|
||||
f 60 62 59 181
|
||||
f 71 74 72 184
|
||||
f 25 178 15 198
|
||||
f 158 103 119 185
|
||||
f 152 140 46 189
|
||||
f 175 194 164 196
|
||||
f 43 44 52 179
|
||||
f 164 172 187 195
|
||||
f 59 62 136 181
|
||||
f 100 157 127 192
|
||||
f 93 104 143 193
|
||||
f 15 25 11 178
|
||||
f 59 58 60 181
|
||||
f 73 61 122 198
|
||||
f 99 86 80 198
|
||||
f 54 51 42 180
|
||||
f 102 119 103 185
|
||||
f 67 71 66 184
|
||||
f 71 72 66 184
|
||||
f 39 33 190 191
|
||||
f 64 63 65 182
|
||||
f 152 139 26 189
|
||||
f 160 123 122 176
|
||||
f 39 38 33 191
|
||||
f 132 88 133 186
|
||||
f 21 187 13 196
|
||||
f 92 186 87 197
|
||||
f 124 79 70 193
|
||||
f 2 26 139 174
|
||||
f 76 109 138 183
|
||||
f 114 39 33 190
|
||||
f 38 47 48 191
|
||||
f 117 13 142 187
|
||||
f 142 155 117 187
|
||||
f 153 152 46 189
|
||||
f 25 1 11 178
|
||||
f 41 147 42 180
|
||||
f 42 111 54 180
|
||||
f 98 13 117 196
|
||||
f 122 61 86 198
|
||||
f 105 83 128 168
|
||||
f 176 192 166 193
|
||||
f 107 112 85 177
|
||||
f 122 86 160 176
|
||||
f 41 147 180 191
|
||||
f 76 74 71 184
|
||||
f 13 21 142 187
|
||||
f 2 174 139 197
|
||||
f 131 71 67 184
|
||||
f 85 146 14 177
|
||||
f 142 82 155 187
|
||||
f 36 130 50 189
|
||||
f 97 87 83 197
|
||||
f 87 92 88 186
|
||||
f 41 125 47 191
|
||||
f 42 147 111 180
|
||||
f 83 168 105 197
|
||||
f 155 99 117 195
|
||||
f 155 82 115 195
|
||||
f 45 151 16 175
|
||||
f 57 102 103 185
|
||||
f 49 85 14 177
|
||||
f 158 133 103 185
|
||||
f 39 190 114 191
|
||||
f 44 144 116 179
|
||||
f 115 93 143 195
|
||||
f 8 98 9 196
|
||||
f 1 144 11 178
|
||||
f 63 100 127 182
|
||||
f 168 186 173 197
|
||||
f 146 85 112 177
|
||||
f 139 189 153 197
|
||||
f 108 153 149 197
|
||||
f 52 44 53 179
|
||||
f 32 28 31 188
|
||||
f 44 116 53 179
|
||||
f 108 92 87 197
|
||||
f 21 22 142 187
|
||||
f 176 195 164 198
|
||||
f 90 106 107 183
|
||||
f 10 11 12 194
|
||||
f 138 107 95 183
|
||||
f 82 142 22 187
|
||||
f 28 27 17 188
|
||||
f 7 21 13 196
|
||||
f 131 76 71 184
|
||||
f 100 101 157 192
|
||||
f 176 193 172 195
|
||||
f 20 16 9 194
|
||||
f 152 26 19 174
|
||||
f 88 132 75 186
|
||||
f 164 194 178 198
|
||||
f 129 31 17 188
|
||||
f 57 103 137 185
|
||||
f 127 65 63 182
|
||||
f 159 105 128 168
|
||||
f 139 152 153 189
|
||||
f 138 109 107 183
|
||||
f 137 103 133 185
|
||||
f 79 89 78 193
|
||||
f 94 43 52 190
|
||||
f 16 48 45 175
|
||||
f 25 15 61 198
|
||||
f 36 46 34 189
|
||||
f 12 29 20 194
|
||||
f 75 87 88 186
|
||||
f 77 127 157 192
|
||||
f 9 118 10 194
|
||||
f 111 114 94 190
|
||||
f 97 83 105 197
|
||||
f 99 143 86 195
|
||||
f 80 15 118 198
|
||||
f 8 151 7 196
|
||||
f 124 104 79 193
|
||||
f 134 90 109 183
|
||||
f 39 114 147 191
|
||||
f 33 43 114 190
|
||||
f 79 93 89 193
|
||||
f 77 123 124 192
|
||||
f 36 50 46 189
|
||||
f 79 104 93 193
|
||||
f 31 28 17 188
|
||||
f 97 105 139 197
|
||||
f 61 80 86 198
|
||||
f 139 105 2 197
|
||||
f 109 90 107 183
|
||||
f 8 7 13 196
|
||||
f 143 99 115 195
|
||||
f 98 8 13 196
|
||||
f 47 38 39 191
|
||||
f 41 47 147 191
|
||||
f 153 46 50 189
|
||||
f 157 101 123 192
|
||||
f 94 114 43 190
|
||||
f 115 99 155 195
|
||||
f 157 123 77 192
|
||||
f 12 20 10 194
|
||||
f 156 123 101 192
|
||||
f 61 15 80 198
|
||||
f 20 9 10 194
|
||||
f 47 39 147 191
|
||||
f 97 108 87 197
|
||||
f 139 153 108 197
|
||||
f 139 108 97 197
|
||||
f 181 158 81 136
|
||||
f 181 81 158 163
|
||||
f 69 183 78 134
|
||||
f 78 183 69 166
|
||||
f 185 161 186 163
|
||||
f 185 186 161 133
|
||||
f 180 35 189 37
|
||||
f 180 189 35 165
|
||||
f 179 121 190 167
|
||||
f 179 190 121 52
|
||||
f 177 3 4 14
|
||||
f 177 4 3 174
|
||||
f 55 181 53 58
|
||||
f 55 53 181 179
|
||||
f 145 53 181 58
|
||||
f 145 181 53 179
|
||||
f 100 192 91 101
|
||||
f 100 91 192 170
|
||||
f 154 91 192 101
|
||||
f 154 192 91 170
|
||||
f 196 129 151 7
|
||||
f 196 151 129 175
|
||||
f 189 149 130 50
|
||||
f 189 130 149 173
|
||||
f 116 178 144 1
|
||||
f 116 144 178 179
|
486
cs457-gc/assignment_2_1/data/beam.obj
Normal file
486
cs457-gc/assignment_2_1/data/beam.obj
Normal file
@@ -0,0 +1,486 @@
|
||||
v 0 1 0
|
||||
v 1 1 0
|
||||
v 2 1 0
|
||||
v 3 1 0
|
||||
v 4 1 0
|
||||
v 5 1 0
|
||||
v 6 1 0
|
||||
v 7 1 0
|
||||
v 8 1 0
|
||||
v 9 1 0
|
||||
v 10 1 0
|
||||
v 0 0 0
|
||||
v 1 0 0
|
||||
v 2 0 0
|
||||
v 3 0 0
|
||||
v 4 0 0
|
||||
v 5 0 0
|
||||
v 6 0 0
|
||||
v 7 0 0
|
||||
v 8 0 0
|
||||
v 9 0 0
|
||||
v 10 0 0
|
||||
v 0 1 2
|
||||
v 1 1 2
|
||||
v 2 1 2
|
||||
v 3 1 2
|
||||
v 4 1 2
|
||||
v 5 1 2
|
||||
v 6 1 2
|
||||
v 7 1 2
|
||||
v 8 1 2
|
||||
v 9 1 2
|
||||
v 10 1 2
|
||||
v 0 2 2
|
||||
v 1 2 2
|
||||
v 2 2 2
|
||||
v 3 2 2
|
||||
v 4 2 2
|
||||
v 5 2 2
|
||||
v 6 2 2
|
||||
v 7 2 2
|
||||
v 8 2 2
|
||||
v 9 2 2
|
||||
v 10 2 2
|
||||
v 1 0 1
|
||||
v 2 0 1
|
||||
v 3 0 1
|
||||
v 4 0 1
|
||||
v 5 0 1
|
||||
v 6 0 1
|
||||
v 7 0 1
|
||||
v 8 0 1
|
||||
v 9 0 1
|
||||
v 10 0 1
|
||||
v 0 0 2
|
||||
v 1 0 2
|
||||
v 2 0 2
|
||||
v 3 0 2
|
||||
v 4 0 2
|
||||
v 5 0 2
|
||||
v 6 0 2
|
||||
v 7 0 2
|
||||
v 8 0 2
|
||||
v 9 0 2
|
||||
v 10 0 2
|
||||
v 10 1 1
|
||||
v 10 2 0
|
||||
v 9 2 0
|
||||
v 8 2 0
|
||||
v 7 2 0
|
||||
v 6 2 0
|
||||
v 5 2 0
|
||||
v 4 2 0
|
||||
v 3 2 0
|
||||
v 2 2 0
|
||||
v 1 2 0
|
||||
v 0 2 0
|
||||
v 10 2 1
|
||||
v 9 2 1
|
||||
v 8 2 1
|
||||
v 7 2 1
|
||||
v 6 2 1
|
||||
v 5 2 1
|
||||
v 4 2 1
|
||||
v 3 2 1
|
||||
v 2 2 1
|
||||
v 1 2 1
|
||||
v 0 2 1
|
||||
v 0 1 1
|
||||
v 0 0 1
|
||||
v 2.51022314298935 1.66666666734905 0.333333356706744
|
||||
v 6.5038986868305 1.66666666734905 0.333333348448228
|
||||
v 1.41304168673757 1.66666667779573 0.333333333192237
|
||||
v 4.52815518561683 1.66666664336266 0.333333332650945
|
||||
v 3.53193742824908 1.66666666572512 1.66666665537717
|
||||
v 5.5724872830131 1.66666663994982 0.333333333192237
|
||||
v 7.47453499493164 1.66666666734905 0.333333321950017
|
||||
v 8.58595000182103 1.66666669276468 0.333333332650945
|
||||
v 4.15888962504899 1 1
|
||||
v 7.12019383987445 1 1
|
||||
v 6.5 0.94551796216449 0.567320199509105
|
||||
v 8.92715091673299 1 1
|
||||
v 5.70664055187346 1.0895869039962 1.0895869039962
|
||||
v 7.94522720695394 1.16116000103177 0.838839998968228
|
||||
v 6.98921684566362 1.33897006803824 0.50851934829753
|
||||
v 1.5 1.17677467586179 1.17677467586179
|
||||
v 2.5 1.18050331869877 1.18050331869877
|
||||
v 0.700160914479175 1.29983908552083 1.29983908552083
|
||||
v 2.00321717021229 0.747225966728042 0.747225966728042
|
||||
v 1.96163240573044 1.41876165907376 0.649342721084843
|
||||
v 1.23482454703747 0.659293555195857 0.659293555195857
|
||||
v 4.9379505567614 0.801542900957198 1.1984570990428
|
||||
v 0.914541947157469 1.28019711508133 0.634737483550074
|
||||
v 3.32955775380848 1.21040848022 0.971132809002493
|
||||
v 5.05032123289685 1.285671858205 0.667177322648327
|
||||
v 2.83515918585762 0.687849458381568 0.687849458381568
|
||||
v 0.620146271013575 0.620146271013575 1.04905612878929
|
||||
f 62 31 63 100
|
||||
f 50 29 101 103
|
||||
f 21 9 20 102
|
||||
f 10 98 9 102
|
||||
f 25 46 106 109
|
||||
f 35 24 23 108
|
||||
f 106 110 111 113
|
||||
f 28 83 103 112
|
||||
f 81 97 80 104
|
||||
f 109 106 110 111
|
||||
f 89 55 90 117
|
||||
f 49 6 99 112
|
||||
f 7 8 92 101
|
||||
f 29 100 101 103
|
||||
f 46 14 109 116
|
||||
f 36 25 106 107
|
||||
f 23 89 108 117
|
||||
f 76 3 93 2
|
||||
f 86 87 93 106
|
||||
f 106 107 109 110
|
||||
f 68 11 79 10
|
||||
f 27 59 47 48
|
||||
f 46 25 107 109
|
||||
f 81 97 100 105
|
||||
f 46 57 25 106
|
||||
f 97 9 104 105
|
||||
f 3 4 91 116
|
||||
f 2 13 111 117
|
||||
f 2 111 113 117
|
||||
f 41 100 29 81
|
||||
f 19 8 7 101
|
||||
f 47 46 58 107
|
||||
f 63 52 31 102
|
||||
f 83 103 112 115
|
||||
f 4 74 91 114
|
||||
f 6 99 112 115
|
||||
f 95 26 107 114
|
||||
f 37 84 95 85
|
||||
f 3 91 109 116
|
||||
f 43 66 44 32
|
||||
f 11 68 79 67
|
||||
f 79 11 78 66
|
||||
f 26 57 25 107
|
||||
f 3 75 93 110
|
||||
f 50 29 100 101
|
||||
f 74 86 91 85
|
||||
f 6 72 94 115
|
||||
f 62 63 51 100
|
||||
f 106 86 107 110
|
||||
f 102 21 66 53
|
||||
f 80 31 42 100
|
||||
f 69 10 98 9
|
||||
f 49 6 112 115
|
||||
f 86 36 106 107
|
||||
f 96 7 101 103
|
||||
f 93 86 106 110
|
||||
f 43 102 66 32
|
||||
f 57 46 25 107
|
||||
f 47 58 26 107
|
||||
f 98 97 80 69
|
||||
f 35 87 106 108
|
||||
f 26 37 95 107
|
||||
f 83 72 96 115
|
||||
f 84 5 99 114
|
||||
f 47 46 107 116
|
||||
f 60 61 49 112
|
||||
f 57 26 58 107
|
||||
f 90 56 45 117
|
||||
f 6 5 99 115
|
||||
f 86 91 107 110
|
||||
f 24 45 56 117
|
||||
f 55 24 56 117
|
||||
f 90 1 89 117
|
||||
f 86 75 91 110
|
||||
f 96 92 7 71
|
||||
f 48 27 99 114
|
||||
f 83 28 99 112
|
||||
f 27 58 47 59
|
||||
f 25 106 107 109
|
||||
f 95 37 85 107
|
||||
f 97 98 80 104
|
||||
f 96 92 71 82
|
||||
f 29 60 28 112
|
||||
f 3 109 110 111
|
||||
f 84 95 85 114
|
||||
f 89 1 113 117
|
||||
f 108 89 113 117
|
||||
f 66 53 32 102
|
||||
f 100 41 29 30
|
||||
f 106 108 113 117
|
||||
f 58 27 47 26
|
||||
f 86 91 85 107
|
||||
f 34 35 23 108
|
||||
f 97 81 100 104
|
||||
f 82 83 96 103
|
||||
f 8 9 97 105
|
||||
f 48 49 99 112
|
||||
f 82 81 100 101
|
||||
f 30 61 50 62
|
||||
f 22 66 11 10
|
||||
f 75 3 91 110
|
||||
f 48 60 49 112
|
||||
f 19 100 101 51
|
||||
f 61 30 50 29
|
||||
f 33 64 53 65
|
||||
f 76 88 77 113
|
||||
f 92 70 81 105
|
||||
f 62 100 50 30
|
||||
f 33 65 53 54
|
||||
f 18 50 51 101
|
||||
f 29 40 81 82
|
||||
f 80 41 81 100
|
||||
f 9 8 100 104
|
||||
f 100 19 101 8
|
||||
f 79 68 10 98
|
||||
f 92 81 101 105
|
||||
f 18 7 50 101
|
||||
f 29 40 41 81
|
||||
f 21 66 22 10
|
||||
f 43 66 78 44
|
||||
f 64 33 53 32
|
||||
f 66 79 43 78
|
||||
f 47 27 48 114
|
||||
f 31 80 42 102
|
||||
f 53 64 32 102
|
||||
f 100 62 50 51
|
||||
f 8 92 101 105
|
||||
f 31 52 100 104
|
||||
f 80 31 100 104
|
||||
f 9 52 102 104
|
||||
f 89 88 108 113
|
||||
f 109 91 110 116
|
||||
f 70 82 92 81
|
||||
f 83 96 103 115
|
||||
f 31 30 42 100
|
||||
f 73 6 94 5
|
||||
f 100 8 101 105
|
||||
f 79 80 98 102
|
||||
f 53 33 66 32
|
||||
f 11 67 79 78
|
||||
f 39 28 83 103
|
||||
f 4 75 3 91
|
||||
f 72 83 94 115
|
||||
f 7 18 50 103
|
||||
f 100 82 101 103
|
||||
f 29 82 100 103
|
||||
f 30 50 29 100
|
||||
f 45 24 56 106
|
||||
f 72 7 96 6
|
||||
f 7 6 103 115
|
||||
f 80 98 102 104
|
||||
f 69 81 97 80
|
||||
f 52 31 102 104
|
||||
f 66 79 10 102
|
||||
f 81 100 101 105
|
||||
f 75 86 93 110
|
||||
f 53 21 20 102
|
||||
f 10 9 21 102
|
||||
f 19 18 51 101
|
||||
f 46 106 109 111
|
||||
f 18 19 7 101
|
||||
f 82 92 81 101
|
||||
f 92 96 7 101
|
||||
f 91 4 114 116
|
||||
f 50 61 29 103
|
||||
f 81 70 97 105
|
||||
f 51 50 100 101
|
||||
f 92 96 101 103
|
||||
f 24 23 108 117
|
||||
f 7 50 101 103
|
||||
f 74 86 75 91
|
||||
f 19 51 52 100
|
||||
f 66 44 32 33
|
||||
f 79 11 66 10
|
||||
f 77 2 76 113
|
||||
f 96 92 82 103
|
||||
f 82 92 101 103
|
||||
f 66 53 21 54
|
||||
f 53 33 54 66
|
||||
f 46 45 106 111
|
||||
f 21 66 54 22
|
||||
f 21 102 66 10
|
||||
f 75 4 74 91
|
||||
f 70 8 97 105
|
||||
f 8 71 7 92
|
||||
f 8 100 104 105
|
||||
f 70 82 71 92
|
||||
f 71 8 70 92
|
||||
f 46 57 58 107
|
||||
f 87 75 86 93
|
||||
f 76 3 75 93
|
||||
f 111 106 113 117
|
||||
f 75 87 76 93
|
||||
f 83 84 72 94
|
||||
f 52 9 20 100
|
||||
f 84 73 72 94
|
||||
f 73 6 72 94
|
||||
f 5 73 84 94
|
||||
f 81 29 82 100
|
||||
f 38 27 26 95
|
||||
f 37 38 26 95
|
||||
f 24 35 106 108
|
||||
f 37 84 38 95
|
||||
f 98 97 9 104
|
||||
f 82 83 71 96
|
||||
f 72 7 71 96
|
||||
f 52 9 100 104
|
||||
f 83 72 71 96
|
||||
f 103 49 61 112
|
||||
f 9 70 8 97
|
||||
f 98 97 69 9
|
||||
f 69 81 70 97
|
||||
f 70 9 69 97
|
||||
f 29 40 82 103
|
||||
f 79 80 68 98
|
||||
f 69 10 68 98
|
||||
f 100 97 104 105
|
||||
f 80 69 68 98
|
||||
f 8 70 92 105
|
||||
f 32 31 43 102
|
||||
f 87 76 93 113
|
||||
f 88 76 87 113
|
||||
f 17 6 49 103
|
||||
f 64 53 52 102
|
||||
f 45 24 106 117
|
||||
f 91 74 85 114
|
||||
f 84 5 94 99
|
||||
f 7 96 6 115
|
||||
f 9 8 104 105
|
||||
f 28 27 99 112
|
||||
f 102 43 66 79
|
||||
f 10 79 98 102
|
||||
f 52 63 31 100
|
||||
f 9 52 20 102
|
||||
f 31 62 30 100
|
||||
f 91 107 110 116
|
||||
f 16 99 116 48
|
||||
f 99 83 112 115
|
||||
f 5 94 99 115
|
||||
f 83 84 94 99
|
||||
f 48 27 112 99
|
||||
f 81 80 100 104
|
||||
f 6 17 49 99
|
||||
f 103 49 112 115
|
||||
f 6 49 103 115
|
||||
f 6 94 5 115
|
||||
f 96 72 6 115
|
||||
f 96 7 103 115
|
||||
f 94 83 99 115
|
||||
f 38 27 95 99
|
||||
f 84 38 95 99
|
||||
f 28 39 83 99
|
||||
f 98 9 102 104
|
||||
f 31 80 102 104
|
||||
f 27 48 112 59
|
||||
f 107 91 114 116
|
||||
f 26 107 114 116
|
||||
f 16 48 49 99
|
||||
f 93 2 111 113
|
||||
f 88 87 108 113
|
||||
f 6 5 17 99
|
||||
f 17 16 49 99
|
||||
f 5 16 17 99
|
||||
f 38 84 83 99
|
||||
f 87 93 106 113
|
||||
f 28 27 39 99
|
||||
f 39 38 83 99
|
||||
f 27 38 39 99
|
||||
f 51 63 52 100
|
||||
f 9 8 20 100
|
||||
f 19 52 20 100
|
||||
f 8 19 20 100
|
||||
f 41 80 42 100
|
||||
f 30 41 42 100
|
||||
f 52 53 20 102
|
||||
f 63 64 52 102
|
||||
f 63 32 64 102
|
||||
f 32 63 31 102
|
||||
f 42 80 79 102
|
||||
f 43 42 79 102
|
||||
f 31 42 43 102
|
||||
f 87 106 108 113
|
||||
f 50 17 49 103
|
||||
f 106 93 110 113
|
||||
f 93 76 2 113
|
||||
f 110 93 111 113
|
||||
f 6 18 7 103
|
||||
f 18 17 50 103
|
||||
f 18 6 17 103
|
||||
f 29 28 40 103
|
||||
f 39 83 82 103
|
||||
f 40 39 82 103
|
||||
f 40 28 39 103
|
||||
f 88 23 89 108
|
||||
f 91 3 109 110
|
||||
f 29 28 103 112
|
||||
f 12 90 45 117
|
||||
f 88 34 23 108
|
||||
f 88 87 34 108
|
||||
f 87 35 34 108
|
||||
f 25 56 24 106
|
||||
f 56 57 45 106
|
||||
f 56 25 57 106
|
||||
f 36 25 24 106
|
||||
f 45 57 46 106
|
||||
f 86 35 87 106
|
||||
f 35 36 24 106
|
||||
f 35 86 36 106
|
||||
f 25 37 26 107
|
||||
f 86 85 36 107
|
||||
f 36 37 25 107
|
||||
f 36 85 37 107
|
||||
f 95 84 99 114
|
||||
f 13 45 111 117
|
||||
f 85 95 107 114
|
||||
f 91 85 107 114
|
||||
f 106 24 108 117
|
||||
f 1 2 113 117
|
||||
f 107 109 110 116
|
||||
f 107 46 109 116
|
||||
f 61 29 103 112
|
||||
f 93 3 110 111
|
||||
f 3 93 2 111
|
||||
f 14 46 109 111
|
||||
f 3 14 109 111
|
||||
f 45 106 111 117
|
||||
f 13 45 46 111
|
||||
f 13 14 2 111
|
||||
f 14 13 46 111
|
||||
f 14 3 2 111
|
||||
f 59 28 60 112
|
||||
f 60 29 61 112
|
||||
f 49 103 61 50
|
||||
f 48 59 60 112
|
||||
f 28 59 27 112
|
||||
f 2 77 1 113
|
||||
f 77 89 1 113
|
||||
f 89 77 88 113
|
||||
f 27 47 26 114
|
||||
f 27 95 99 114
|
||||
f 27 26 95 114
|
||||
f 73 5 84 114
|
||||
f 5 74 4 114
|
||||
f 73 84 85 114
|
||||
f 74 73 85 114
|
||||
f 74 5 73 114
|
||||
f 47 26 114 116
|
||||
f 26 47 107 116
|
||||
f 48 47 114 116
|
||||
f 14 3 109 116
|
||||
f 4 5 114 116
|
||||
f 99 16 116 5
|
||||
f 99 48 114 116
|
||||
f 5 99 114 116
|
||||
f 14 46 47 116
|
||||
f 15 4 3 116
|
||||
f 48 15 47 116
|
||||
f 15 14 47 116
|
||||
f 14 15 3 116
|
||||
f 16 15 48 116
|
||||
f 4 15 16 116
|
||||
f 4 16 5 116
|
||||
f 13 12 45 117
|
||||
f 12 1 90 117
|
||||
f 55 89 23 117
|
||||
f 56 90 55 117
|
||||
f 1 13 2 117
|
||||
f 24 55 23 117
|
||||
f 12 13 1 117
|
1526
cs457-gc/assignment_2_1/data/dinosaur.obj
Normal file
1526
cs457-gc/assignment_2_1/data/dinosaur.obj
Normal file
File diff suppressed because it is too large
Load Diff
382
cs457-gc/assignment_2_1/notebook/hw_2.1.ipynb
Normal file
382
cs457-gc/assignment_2_1/notebook/hw_2.1.ipynb
Normal file
@@ -0,0 +1,382 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Description\n",
|
||||
"\n",
|
||||
"This notebook intends to gather all the functionalities you'll have to implement for assignment 2.1. You will have to generate an elastic solid, deform it, compute the associated Jacobian of the deformation map $\\phi$, and implement pinning constraints. You will also visualize the eigenvectors and eigenvalues of the metric tensor, given a prescribed deformation.\n",
|
||||
"\n",
|
||||
"# Load libraries"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\n",
|
||||
"import igl\n",
|
||||
"import meshplot as mp\n",
|
||||
"\n",
|
||||
"import sys as _sys\n",
|
||||
"_sys.path.append(\"../src\")\n",
|
||||
"from elasticsolid import *\n",
|
||||
"from eigendecomposition_metric import *\n",
|
||||
"\n",
|
||||
"shadingOptions = {\n",
|
||||
" \"flat\":True,\n",
|
||||
" \"wireframe\":False, \n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"rot = np.array(\n",
|
||||
" [[1, 0, 0 ],\n",
|
||||
" [0, 0, 1],\n",
|
||||
" [0, -1, 0 ]]\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Load mesh\n",
|
||||
"\n",
|
||||
"Several meshes are available for you to play with under `data/`: `ball.obj`, `dinosaur.obj`, and `beam.obj`. You can also uncomment the few commented lines below to manipulate a simple mesh made out of 2 tetrahedra."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {
|
||||
"scrolled": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"application/vnd.jupyter.widget-view+json": {
|
||||
"model_id": "33e8252ccc4d4c9298094b0dc3675ee4",
|
||||
"version_major": 2,
|
||||
"version_minor": 0
|
||||
},
|
||||
"text/plain": [
|
||||
"Renderer(camera=PerspectiveCamera(children=(DirectionalLight(color='white', intensity=0.6, position=(-1.987469…"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"v, _, _, t, _, _ = igl.read_obj(\"../data/dinosaur.obj\")\n",
|
||||
"\n",
|
||||
"# t = np.array([\n",
|
||||
"# [0, 1, 2, 3],\n",
|
||||
"# [1, 2, 3, 4]\n",
|
||||
"# ])\n",
|
||||
"# v = np.array([\n",
|
||||
"# [0., 0., 0.],\n",
|
||||
"# [1., 0., 0.],\n",
|
||||
"# [0., 1., 0.],\n",
|
||||
"# [0., 0., 1.],\n",
|
||||
"# [2/3, 2/3, 2/3]\n",
|
||||
"# ])\n",
|
||||
"\n",
|
||||
"aabb = np.max(v, axis=0) - np.min(v, axis=0)\n",
|
||||
"length_scale = np.mean(aabb)\n",
|
||||
"\n",
|
||||
"p = mp.plot(v @ rot.T, t, shading=shadingOptions)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Manipulate elastic solids\n",
|
||||
"\n",
|
||||
"## Instanciation\n",
|
||||
"\n",
|
||||
"The rest shape matrices $D_m$ and their inverse matrices $B_m$ are computed during instanciation."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"rho = 131 # [kg.m-3]\n",
|
||||
"solid = ElasticSolid(v, t, rho=rho)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Deform the mesh\n",
|
||||
"\n",
|
||||
"This part involves Jacobian computation which relies on deformed shape matrices $D_s$."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {
|
||||
"scrolled": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"application/vnd.jupyter.widget-view+json": {
|
||||
"model_id": "02c94de8642645d8aab800877f8ddbce",
|
||||
"version_major": 2,
|
||||
"version_minor": 0
|
||||
},
|
||||
"text/plain": [
|
||||
"Renderer(camera=PerspectiveCamera(children=(DirectionalLight(color='white', intensity=0.6, position=(-1.987469…"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"<meshplot.Viewer.Viewer at 0x7fa7dc789070>"
|
||||
]
|
||||
},
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"v_def = v.copy()\n",
|
||||
"v_def[:, 2] *= 2.\n",
|
||||
"solid.update_def_shape(v_def)\n",
|
||||
"\n",
|
||||
"mp.plot(solid.v_def @ rot.T, solid.t, shading=shadingOptions)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Visualize some properties of the metric tensor\n",
|
||||
"\n",
|
||||
"The metric tensor measures how stretched and sheared directions in the undeformed space are under the deformation $\\phi$. It is defined from the Jacobian of the deformation $\\mathbf{F}$ as follow (see the handout for a derivation):\n",
|
||||
"\n",
|
||||
"$$\\mathbf{M} = \\mathbf{F}^T \\mathbf{F}$$\n",
|
||||
"\n",
|
||||
"We intend to plot the eigenvectors coloured by the corresponding eigenvalues in the next cell."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"application/vnd.jupyter.widget-view+json": {
|
||||
"model_id": "6ff42798692c4a29ad4a37f40ca77a84",
|
||||
"version_major": 2,
|
||||
"version_minor": 0
|
||||
},
|
||||
"text/plain": [
|
||||
"Renderer(camera=PerspectiveCamera(children=(DirectionalLight(color='white', intensity=0.6, position=(-1.987469…"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# We limit ourselves to stretching the mesh in the z direction\n",
|
||||
"# Feel free to experiment with other kinds of deformations!\n",
|
||||
"\n",
|
||||
"v_def = v.copy()\n",
|
||||
"v_def[:, 2] *= 2.0\n",
|
||||
"solid.update_def_shape(v_def)\n",
|
||||
"\n",
|
||||
"squared_eigvals, eigvecs = compute_eigendecomposition_metric(solid.F)\n",
|
||||
"plot_eigendecomposition_metric(solid, squared_eigvals, eigvecs, rot, scale=0.05)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Pin vertices of the mesh\n",
|
||||
"\n",
|
||||
"Pass a `pin_idx` to the constructor, compute the mask for deformations."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"maxZ = np.max(solid.v_rest[:, 2])\n",
|
||||
"pin_idx = np.arange(solid.v_rest.shape[0])[solid.v_rest[:, 2] > maxZ - 0.1 * aabb[2]]\n",
|
||||
"\n",
|
||||
"v_def = v.copy()\n",
|
||||
"v_def[:, 2] -= 0.1 * aabb[2]\n",
|
||||
"solid.update_def_shape(v_def)\n",
|
||||
"\n",
|
||||
"solid_pinned = ElasticSolid(v, t, rho=rho, pin_idx=pin_idx)\n",
|
||||
"solid_pinned.update_def_shape(v_def)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"application/vnd.jupyter.widget-view+json": {
|
||||
"model_id": "13f958a33ec945ca979aca15d7381e01",
|
||||
"version_major": 2,
|
||||
"version_minor": 0
|
||||
},
|
||||
"text/plain": [
|
||||
"Renderer(camera=PerspectiveCamera(children=(DirectionalLight(color='white', intensity=0.6, position=(-1.987469…"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
"output_type": "display_data"
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"1"
|
||||
]
|
||||
},
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"p = mp.plot(solid_pinned.v_def @ rot.T, t, shading=shadingOptions)\n",
|
||||
"p.add_points(solid_pinned.v_def[pin_idx, :] @ rot.T, shading={\"point_color\":\"black\", \"point_size\": 0.1 * length_scale})"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 1.2.4 Derivation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Volume of tetrahedron ($X_1, X_2, X_3, X_4$) is given by $\\frac{1}{6}|det(D_m)|$\n",
|
||||
"\n",
|
||||
"We can decompose the provided formula:\n",
|
||||
"\n",
|
||||
"$Vol = \\frac{1}{6}|det(D_m)| = \\frac{1}{6}|D_{m1}^T \\cdot (D_{m2} \\times D_{m3})|$\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"Next, we build 3 vectors:\n",
|
||||
"\n",
|
||||
"$V_0 = X_1 - X_4 = \\begin{pmatrix}X_{x1}-X_{x4} \\\\ Y_{x1}-Y_{x4} \\\\ Z_{x1}- Z_{x4} \\end{pmatrix}$\n",
|
||||
"\n",
|
||||
"$V_1 = X_2 - X_4 = \\begin{pmatrix}X_{x2}-X_{x4} \\\\ Y_{x2}-Y_{x4} \\\\ Z_{x2}- Z_{x4} \\end{pmatrix}$\n",
|
||||
"\n",
|
||||
"$V_2 = X_3 - X_4 = \\begin{pmatrix}X_{x3}-X_{x4} \\\\ Y_{x3}-Y_{x4} \\\\ Z_{x3}- Z_{x4} \\end{pmatrix}$\n",
|
||||
"\n",
|
||||
"We then compute the base as:\n",
|
||||
"\n",
|
||||
"$B = V_1 \\times V_2$\n",
|
||||
"\n",
|
||||
"And also the height as:\n",
|
||||
"\n",
|
||||
"$H = V_0$\n",
|
||||
"\n",
|
||||
"From this we can compute the volume:\n",
|
||||
"\n",
|
||||
"$Vol = \\frac{1}{6} \\cdot B \\cdot H = \\frac{1}{6} V_0 \\cdot (V_1 \\times V_2)$\n",
|
||||
"\n",
|
||||
"We can note the similarity between both fomulas. We can note the equality between both formulas: \n",
|
||||
"\n",
|
||||
"$V_0 = D_{m1}, V_1 = D_{m2}, V_2 = D_{m3}$\n",
|
||||
"\n",
|
||||
"Note that the absolute value is not directly taken into account since its absolute volume and not signed volume.\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 1.2.7 Derivation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Show that: $Vol(x_1, x_2, x_3, x_4)/Vol(X_1, X_2, X_3, X_4) = |det(F)|$\n",
|
||||
"\n",
|
||||
"Since we know that $F = D_s D_m^{-1}$, and that: $V = \\frac{1}{6}|det(D_m)|$\n",
|
||||
"\n",
|
||||
"We can drag the det and abs into it:\n",
|
||||
"\n",
|
||||
"$|det(F)| = \\frac{|det(D_s)|}{|det(D_m)|} = \\frac{\\frac{1}{6}|det(D_s)|}{\\frac{1}{6}|det(D_m)|} = \\frac{Vol(x_1, x_2, x_3, x_4)}{Vol(X_1, X_2, X_3, X_4)}$\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.9.7"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
"nav_menu": {},
|
||||
"number_sections": true,
|
||||
"sideBar": true,
|
||||
"skip_h1_title": false,
|
||||
"title_cell": "Table of Contents",
|
||||
"title_sidebar": "Contents",
|
||||
"toc_cell": false,
|
||||
"toc_position": {},
|
||||
"toc_section_display": true,
|
||||
"toc_window_display": false
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
@@ -0,0 +1,268 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\n",
|
||||
"import time"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Tutorial: Higher Order Array Manipulation\n",
|
||||
"\n",
|
||||
"For the sake of simplicity, we define $n$-th order tensors as arrays of dimension $n$. A $0$-th order array is a scalar, a $1$-st order array is a vector in $\\mathbb{R}^{d_1}$, and a $2$-nd order array is a matrix in $\\mathbb{R}^{d_1\\times d_2}$. Going further, a $n$-th order array is an element of $\\mathbb{R}^{d_1\\times...\\times d_n}$ for some dimensions $(d_i)_{i\\in[n]}$.\n",
|
||||
"\n",
|
||||
"## Declaration"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Declare a third order array \n",
|
||||
"d1, d2, d3 = 2, 3, 5\n",
|
||||
"A = np.random.rand(d1, d2, d3)\n",
|
||||
"\n",
|
||||
"print(\"The shape of A is {}\".format(A.shape))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Indexing\n",
|
||||
"\n",
|
||||
"Say we have a $3$-rd order array $\\mathbf{A}\\in\\mathbb{R}^{d_1\\times d_2\\times d_3}$. Indexing and slicing works as for lower order arrays:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"print(\"A[0] has shape {}\".format(A[0].shape))\n",
|
||||
"print(\"A[:, 1:, :] has shape {}\".format(A[:, 1:, :].shape))\n",
|
||||
"print(\"A[:, 1, 2:4] has shape {}\".format(A[:, 1, 2:4].shape))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We can also use a different indexing array $\\mathbf{b}$ to index $\\mathbf{A}$. This indexing operates on the first dimension of $\\mathbf{A}$, meaning that if $\\mathbf{b}\\in\\mathbb{R}^{l_1\\times l_2}$, then `A[b]` will have shape $l_1\\times l_2\\times d_2\\times d_3$."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"b = np.array([0, 0, 1, 0])\n",
|
||||
"print(\"If A has shape {}, b has shape {}, then A[b] has shape {}.\".format(A.shape, b.shape, A[b].shape))\n",
|
||||
"\n",
|
||||
"b = np.array([[0, 0, 1, 0], [1, 1, 0, 1]])\n",
|
||||
"print(\"If A has shape {}, b has shape {}, then A[b] has shape {}.\".format(A.shape, b.shape, A[b].shape))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"... This works provided the indexing array $\\mathbf{b}$ has integer values comprised between $0$ and $d_{1}-1$ (included)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"try:\n",
|
||||
" b = np.array([0, 0, 2, 0])\n",
|
||||
" A[b]\n",
|
||||
"except Exception as e:\n",
|
||||
" print(\"We have an out-of bound indexing: d_1=1 but max b=2\")\n",
|
||||
" print(\"The exception is: {}\".format(e))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Operations\n",
|
||||
"\n",
|
||||
"Imagine now that we have a batch of $1000$ $d\\times d$ matrices: $(\\mathbf{a}_i)_{i\\in[1000]}$, for which we want to compute the trace. We could loop over the matrices and compute the traces separately."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"d = 2\n",
|
||||
"\n",
|
||||
"ais = [np.random.rand(d, d) for i in range(1000)]\n",
|
||||
"\n",
|
||||
"start = time.time()\n",
|
||||
"traces = ...\n",
|
||||
"end = time.time()\n",
|
||||
"\n",
|
||||
"print(\"Elapsed time: {:.2e}s.\".format(end - start))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Alternatively, we could vectorize this operation using a three dimensional array $\\mathbf{A}\\in\\mathbb{R}^{3\\times d\\times d}$ that contains the stacked matrices."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"A = np.stack(ais, axis=0)\n",
|
||||
"\n",
|
||||
"print(\"A has shape {}\".format(A.shape))\n",
|
||||
"\n",
|
||||
"start = time.time()\n",
|
||||
"traces = ...\n",
|
||||
"end = time.time()\n",
|
||||
"\n",
|
||||
"print(\"Elapsed time: {:.2e}s.\".format(end - start))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"And we reduced the computation time by an order of magnitude! A different option that we will use extensively during part 3 is to use [Einstein summation](https://en.wikipedia.org/wiki/Einstein_notation). For the traces computation this would be written: $\\mathbf{A}_{i,j,j}$. This can be done with Numpy with the method [`np.einsum`](https://numpy.org/doc/stable/reference/generated/numpy.einsum.html)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"start = time.time()\n",
|
||||
"traces = ...\n",
|
||||
"end = time.time()\n",
|
||||
"\n",
|
||||
"print(\"Elapsed time: {:.2e}s.\".format(end - start))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"As efficient as the trace method! Also, `np.einsum` is highly flexible. It can compute the transpose of a batch of arrays, or various kinds of matrix multiplications."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"ais = [np.random.rand(2, 3) for i in range(1000)]\n",
|
||||
"\n",
|
||||
"# Transpose each stacked matrices\n",
|
||||
"A = np.stack(ais, axis=0)\n",
|
||||
"print(\"A has shape {}\".format(A.shape))\n",
|
||||
"AT = ...\n",
|
||||
"print(\"A^T has shape {}\".format(AT.shape))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Below we show how to compute $\\mathbf{a}_i^T\\mathbf{a}_i$ for some matrices $\\mathbf{a}_i\\in\\mathbb{R}^{2\\times 3}$ using `np.einsum`."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"print(\"A has shape {}\".format(A.shape))\n",
|
||||
"product_As = ...\n",
|
||||
"print(\"Stacked ai^T.ai has shape {}\".format(product_As.shape))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"To scale each $\\mathbf{a}_i$ by a weight $w_i$, we can still use `np.einsum`. Define the vector containing all the weights $\\mathbf{w}=(w_i)_i$, we have:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"w = np.random.rand(A.shape[0])\n",
|
||||
"weighted_A = ...\n",
|
||||
"print(\"Weighted and stacked ai has shape {}\".format(weighted_A.shape))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.7.10"
|
||||
},
|
||||
"toc": {
|
||||
"base_numbering": 1,
|
||||
"nav_menu": {},
|
||||
"number_sections": true,
|
||||
"sideBar": true,
|
||||
"skip_h1_title": false,
|
||||
"title_cell": "Table of Contents",
|
||||
"title_sidebar": "Contents",
|
||||
"toc_cell": false,
|
||||
"toc_position": {},
|
||||
"toc_section_display": true,
|
||||
"toc_window_display": false
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
96
cs457-gc/assignment_2_1/src/eigendecomposition_metric.py
Normal file
96
cs457-gc/assignment_2_1/src/eigendecomposition_metric.py
Normal file
@@ -0,0 +1,96 @@
|
||||
import numpy as np
|
||||
import meshplot as mp
|
||||
import igl
|
||||
|
||||
def compute_eigendecomposition_metric(jac):
|
||||
'''
|
||||
Input:
|
||||
- jac : a np array of shape (#t, 3, 3) containing the stacked jacobians
|
||||
|
||||
Output:
|
||||
- squared_eigvals : np array of shape (#t, 3) containing the square root of the eigenvalues of the metric tensor
|
||||
- eigvecs : np array of shape (#t, 3, 3) containing the eigenvectors of the metric tensor
|
||||
'''
|
||||
|
||||
jact = np.transpose(jac,(0,2,1))
|
||||
smt = jact @ jac
|
||||
|
||||
eigvals, eigvecs = np.linalg.eigh(smt)
|
||||
return np.sqrt(eigvals), eigvecs #/ np.linalg.norm(eigvecs)
|
||||
|
||||
def plot_eigendecomposition_metric(solid, squared_eigvals, eigvecs, rot, scale=0.05):
|
||||
'''
|
||||
Input:
|
||||
- solid : an ElasticSolid object
|
||||
- squared_eigvals : np array of shape (#t, 3) containing the square root of the eigenvalues of the metric tensor
|
||||
- eigvecs : np array of shape (#t, 3, 3) containing the eigenvectors of the metric tensor
|
||||
- rot : a rotation matrix for plotting purposes
|
||||
- scale : scaling for plotting purposes
|
||||
'''
|
||||
|
||||
scaled_eigvecs = scale * np.einsum('ik, ijk -> ijk', squared_eigvals, eigvecs)
|
||||
|
||||
start_plot0 = (solid.def_barycenters - scaled_eigvecs[..., 0]) @ rot.T
|
||||
start_plot1 = (solid.def_barycenters - scaled_eigvecs[..., 1]) @ rot.T
|
||||
start_plot2 = (solid.def_barycenters - scaled_eigvecs[..., 2]) @ rot.T
|
||||
end_plot0 = (solid.def_barycenters + scaled_eigvecs[..., 0]) @ rot.T
|
||||
end_plot1 = (solid.def_barycenters + scaled_eigvecs[..., 1]) @ rot.T
|
||||
end_plot2 = (solid.def_barycenters + scaled_eigvecs[..., 2]) @ rot.T
|
||||
|
||||
# Get boundary edges
|
||||
be = igl.edges(igl.boundary_facets(solid.t))
|
||||
|
||||
p = mp.plot(solid.v_def @ rot.T, be, shading={"line_color": "black"})
|
||||
p.add_points(solid.def_barycenters @ rot.T, shading={"point_color":"black", "point_size": 0.2})
|
||||
|
||||
# In tension
|
||||
tens0 = np.argwhere(squared_eigvals[:, 0]>1. + 1e-6)
|
||||
tens1 = np.argwhere(squared_eigvals[:, 1]>1. + 1e-6)
|
||||
tens2 = np.argwhere(squared_eigvals[:, 2]>1. + 1e-6)
|
||||
if tens0.shape[0] != 0:
|
||||
p.add_lines(start_plot0[tens0, :],
|
||||
end_plot0[tens0, :],
|
||||
shading={"line_color": "#182C94"})
|
||||
if tens1.shape[0] != 0:
|
||||
p.add_lines(start_plot1[tens1, :],
|
||||
end_plot1[tens1, :],
|
||||
shading={"line_color": "#182C94"})
|
||||
if tens2.shape[0] != 0:
|
||||
p.add_lines(start_plot2[tens2, :],
|
||||
end_plot2[tens2, :],
|
||||
shading={"line_color": "#182C94"})
|
||||
|
||||
# In compression
|
||||
comp0 = np.argwhere(squared_eigvals[:, 0]<1. - 1e-6)
|
||||
comp1 = np.argwhere(squared_eigvals[:, 1]<1. - 1e-6)
|
||||
comp2 = np.argwhere(squared_eigvals[:, 2]<1. - 1e-6)
|
||||
if comp0.shape[0] != 0:
|
||||
p.add_lines(start_plot0[comp0, :],
|
||||
end_plot0[comp0, :],
|
||||
shading={"line_color": "#892623"})
|
||||
if comp1.shape[0] != 0:
|
||||
p.add_lines(start_plot1[comp1, :],
|
||||
end_plot1[comp1, :],
|
||||
shading={"line_color": "#892623"})
|
||||
if comp2.shape[0] != 0:
|
||||
p.add_lines(start_plot2[comp2, :],
|
||||
end_plot2[comp2, :],
|
||||
shading={"line_color": "#892623"})
|
||||
|
||||
# Neutral
|
||||
# In compression
|
||||
neut0 = np.argwhere(abs(squared_eigvals[:, 0]-1.) < 1e-6)
|
||||
neut1 = np.argwhere(abs(squared_eigvals[:, 1]-1.) < 1e-6)
|
||||
neut2 = np.argwhere(abs(squared_eigvals[:, 2]-1.) < 1e-6)
|
||||
if neut0.shape[0] != 0:
|
||||
p.add_lines(start_plot0[neut0, :],
|
||||
end_plot0[neut0, :],
|
||||
shading={"line_color": "#027337"})
|
||||
if neut1.shape[0] != 0:
|
||||
p.add_lines(start_plot1[neut1, :],
|
||||
end_plot1[neut1, :],
|
||||
shading={"line_color": "#027337"})
|
||||
if neut2.shape[0] != 0:
|
||||
p.add_lines(start_plot2[neut2, :],
|
||||
end_plot2[neut2, :],
|
||||
shading={"line_color": "#027337"})
|
175
cs457-gc/assignment_2_1/src/elasticsolid.py
Normal file
175
cs457-gc/assignment_2_1/src/elasticsolid.py
Normal file
@@ -0,0 +1,175 @@
|
||||
import numpy as np
|
||||
from numpy import linalg
|
||||
from scipy import sparse
|
||||
import igl
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# -----------------------------------------------------------------------------
|
||||
# ELASTIC SOLID CLASS
|
||||
# -----------------------------------------------------------------------------
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
class ElasticSolid(object):
|
||||
|
||||
def __init__(self, v_rest, t, rho=1, pin_idx=[]):
|
||||
'''
|
||||
Input:
|
||||
- v_rest : position of the vertices of the mesh (#v, 3)
|
||||
- t : indices of the element's vertices (#t, 4)
|
||||
- rho : mass per unit volume [kg.m-3]
|
||||
- pin_idx : list of vertex indices to pin
|
||||
'''
|
||||
|
||||
self.v_rest = v_rest.copy()
|
||||
self.v_def = v_rest.copy()
|
||||
self.t = t
|
||||
self.rho = rho
|
||||
self.pin_idx = pin_idx
|
||||
self.free_idx = None
|
||||
self.pin_mask = None
|
||||
|
||||
self.W0 = None
|
||||
self.Dm = None
|
||||
self.Bm = None
|
||||
self.rest_barycenters = None
|
||||
|
||||
self.W = None
|
||||
self.Ds = None
|
||||
self.F = None
|
||||
self.def_barycenters = None
|
||||
|
||||
self.make_free_indices_and_pin_mask()
|
||||
self.update_rest_shape(self.v_rest)
|
||||
self.update_def_shape(self.v_def)
|
||||
|
||||
## Precomputation ##
|
||||
|
||||
def make_free_indices_and_pin_mask(self):
|
||||
'''
|
||||
Should list all the free indices and the pin mask.
|
||||
|
||||
Updated attributes:
|
||||
- free_index : np array of shape (#free_vertices,) containing the list of unpinned vertices
|
||||
- pin_mask : np array of shape (#v, 1) containing 1 at free vertex indices and 0 at pinned vertex indices
|
||||
'''
|
||||
self.pin_mask = np.ones((self.v_rest.shape[0],1))
|
||||
self.pin_mask[self.pin_idx] = 0
|
||||
self.free_idx = np.where(self.pin_mask==1)[0]
|
||||
|
||||
## Methods related to rest quantities ##
|
||||
|
||||
def make_rest_barycenters(self):
|
||||
'''
|
||||
Construct the barycenters of the undeformed configuration
|
||||
|
||||
Updated attributes:
|
||||
- rest_barycenters : np array of shape (#t, 3) containing the position of each tet's barycenter
|
||||
'''
|
||||
self.rest_barycenters = np.einsum("ijk->ik",self.v_rest[self.t[:,:]])/4
|
||||
|
||||
def make_rest_shape_matrices(self):
|
||||
'''
|
||||
Construct Dm that has shape (#t, 3, 3), and its inverse Bm
|
||||
|
||||
Updated attributes:
|
||||
- Dm : np array of shape (#t, 3, 3) containing the shape matrix of each tet
|
||||
- Bm : np array of shape (#t, 3, 3) containing the inverse shape matrix of each tet
|
||||
'''
|
||||
tv = self.v_rest[self.t[:,:]]
|
||||
|
||||
tva = tv[:,:3,:]
|
||||
tvb = tv[:,3,:].reshape((self.t.shape[0],1,3))
|
||||
tvb= np.repeat(tvb, 3, axis=1)
|
||||
|
||||
tvs = tva - tvb
|
||||
tvsf = np.transpose(tvs,(0,2,1))
|
||||
|
||||
self.Dm = tvsf
|
||||
self.Bm = np.linalg.inv(tvsf)
|
||||
|
||||
def update_rest_shape(self, v_rest):
|
||||
'''
|
||||
Updates the vertex position, the shape matrices Dm and Bm, the volumes W0,
|
||||
and the mass matrix at rest
|
||||
|
||||
Input:
|
||||
- v_rest : position of the vertices of the mesh at rest state (#v, 3)
|
||||
|
||||
Updated attributes:
|
||||
- v_rest : np array of shape (#v, 3) containing the position of each vertex at rest
|
||||
- W0 : np array of shape (#t) containing the volume of each tet
|
||||
'''
|
||||
self.v_rest = v_rest
|
||||
self.make_rest_barycenters()
|
||||
self.make_rest_shape_matrices()
|
||||
self.W0 = -np.linalg.det(self.Dm)/6
|
||||
|
||||
self.update_def_shape(self.v_def)
|
||||
|
||||
## Methods related to deformed quantities ##
|
||||
|
||||
def make_def_barycenters(self):
|
||||
'''
|
||||
Construct the barycenters of the deformed configuration
|
||||
|
||||
Updated attributes:
|
||||
- def_barycenters : np array of shape (#t, 3) containing the position of each tet's barycenter
|
||||
'''
|
||||
self.def_barycenters = np.einsum("ijk->ik",self.v_def[self.t[:,:]])/4
|
||||
|
||||
def make_def_shape_matrices(self):
|
||||
'''
|
||||
Construct Ds that has shape (#t, 3, 3)
|
||||
|
||||
Updated attributes:
|
||||
- Ds : np array of shape (#t, 3, 3) containing the shape matrix of each tet
|
||||
'''
|
||||
tv = self.v_def[self.t[:,:]]
|
||||
|
||||
tva = tv[:,:3,:]
|
||||
tvb = tv[:,3,:].reshape((self.t.shape[0],1,3))
|
||||
tvb= np.repeat(tvb, 3, axis=1)
|
||||
|
||||
tvs = tva - tvb
|
||||
tvsf = np.transpose(tvs,(0,2,1))
|
||||
|
||||
self.Ds = tvsf
|
||||
|
||||
def make_jacobians(self):
|
||||
'''
|
||||
Compute the current Jacobian of the deformation
|
||||
|
||||
Updated attributes:
|
||||
- F : np array of shape (#t, 3, 3) containing Jacobian of the deformation in each tet
|
||||
'''
|
||||
self.F = self.Ds @ self.Bm
|
||||
|
||||
def update_def_shape(self, v_def):
|
||||
'''
|
||||
Updates the vertex position, the Jacobian of the deformation, and the
|
||||
resulting elastic forces.
|
||||
|
||||
Input:
|
||||
- v_def : position of the vertices of the mesh (#v, 3)
|
||||
|
||||
Updated attributes:
|
||||
- v_def : np array of shape (#v, 3) containing the position of each vertex after deforming the solid
|
||||
- W : np array of shape (#t, 3) containing the volume of each tet
|
||||
'''
|
||||
self.v_def = self.v_rest
|
||||
self.v_def[self.free_idx] = v_def[self.free_idx]
|
||||
self.make_def_barycenters()
|
||||
self.make_def_shape_matrices()
|
||||
self.W = -np.linalg.det(self.Ds)/6
|
||||
self.make_jacobians()
|
||||
|
||||
def displace(self, v_disp):
|
||||
'''
|
||||
Displace the whole mesh so that v_def += v_disp
|
||||
|
||||
Input:
|
||||
- v_disp : displacement of the vertices of the mesh (#v, 3)
|
||||
'''
|
||||
self.update_def_shape(self.v_def + v_disp)
|
116
cs457-gc/assignment_2_1/test/test.py
Normal file
116
cs457-gc/assignment_2_1/test/test.py
Normal file
@@ -0,0 +1,116 @@
|
||||
import time
|
||||
import pytest
|
||||
import json
|
||||
import sys
|
||||
import igl
|
||||
import numpy as np
|
||||
sys.path.append('../')
|
||||
sys.path.append('../src')
|
||||
from elasticsolid import *
|
||||
from eigendecomposition_metric import *
|
||||
eps = 1E-6
|
||||
|
||||
with open('test_data1.json', 'r') as infile:
|
||||
homework_datas = json.load(infile)
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[0])
|
||||
def test_rest_barycenters(data):
|
||||
v, t, rest_barycenters_gt = data
|
||||
es = ElasticSolid(np.array(v), np.array(t))
|
||||
es.make_rest_barycenters()
|
||||
rest_barycenters_student = es.rest_barycenters
|
||||
if(len(v) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(rest_barycenters_gt - rest_barycenters_student) < eps
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[1])
|
||||
def test_rest_shape_matrices(data):
|
||||
v, t, Dm_gt, Bm_gt = data
|
||||
es = ElasticSolid(np.array(v), np.array(t))
|
||||
es.make_rest_shape_matrices()
|
||||
Dm, Bm = es.Dm, es.Bm
|
||||
if(len(v) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(Dm - Dm_gt) < eps
|
||||
assert np.linalg.norm(Bm - Bm_gt) < eps
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[2])
|
||||
def test_def_barycenters(data):
|
||||
v, t, v_def, def_barycenters_gt = data
|
||||
es = ElasticSolid(np.array(v), np.array(t))
|
||||
es.v_def = np.array(v_def)
|
||||
es.make_def_barycenters()
|
||||
def_barycenters_student = es.def_barycenters
|
||||
if(len(v) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(def_barycenters_gt - def_barycenters_student ) < eps
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[3])
|
||||
def test_def_shape_matrices(data):
|
||||
v, t, v_def, Ds_gt = data
|
||||
es = ElasticSolid(np.array(v), np.array(t))
|
||||
es.v_def = np.array(v_def)
|
||||
es.make_def_shape_matrices()
|
||||
Ds = es.Ds
|
||||
if(len(v) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(Ds - Ds_gt) < eps
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[4])
|
||||
def test_update_rest_shape(data):
|
||||
v, t, v_update, rest_barycenters_gt, W0_gt, F_gt = data
|
||||
es = ElasticSolid(np.array(v), np.array(t))
|
||||
es.update_rest_shape(np.array(v_update))
|
||||
if(len(v) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(es.rest_barycenters - rest_barycenters_gt) < eps
|
||||
assert np.linalg.norm(es.W0 - W0_gt) < eps
|
||||
assert np.linalg.norm(es.F - F_gt) < eps
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[5])
|
||||
def test_update_def_shape(data):
|
||||
v, t, v_def, def_barycenters_gt, W_gt, F_gt = data
|
||||
es = ElasticSolid(np.array(v), np.array(t))
|
||||
es.update_def_shape(np.array(v_def))
|
||||
if(len(v) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(es.def_barycenters - def_barycenters_gt) < eps
|
||||
assert np.linalg.norm(es.W - W_gt) < eps
|
||||
assert np.linalg.norm(es.F - F_gt) < eps
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[6])
|
||||
def test_jacobians(data):
|
||||
v, t, v_def, Ds_gt, Bm_gt, F_gt = data
|
||||
es = ElasticSolid(np.array(v), np.array(t))
|
||||
es.v_def, es.Ds, es.Bm = np.array(v_def), np.array(Ds_gt), np.array(Bm_gt)
|
||||
es.make_jacobians()
|
||||
if(len(v) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(es.F - F_gt) < eps
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[7])
|
||||
def test_pinning(data):
|
||||
v, t, pin_idx, free_idx_gt, pin_mask_gt = data
|
||||
es = ElasticSolid(np.array(v), np.array(t), pin_idx = np.array(pin_idx))
|
||||
if(len(v) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(es.free_idx - free_idx_gt) < eps
|
||||
assert np.linalg.norm(es.pin_mask.astype(float) - np.array(pin_mask_gt).astype(float)) < eps
|
||||
|
||||
@pytest.mark.timeout(0.5)
|
||||
@pytest.mark.parametrize("data", homework_datas[8])
|
||||
def test_eig(data):
|
||||
F, eigvals_gt, eigvecs_gt = data
|
||||
eigvals, eigvecs = compute_eigendecomposition_metric(np.array(F))
|
||||
if(len(F) > 5000):
|
||||
return
|
||||
assert np.linalg.norm(eigvals - eigvals_gt) < eps
|
||||
assert np.linalg.norm(abs(np.diagonal(np.einsum('ijk, ijl -> ikl', eigvecs, eigvecs_gt), axis1 = 1, axis2 = 2)) - 1) < eps
|
1
cs457-gc/assignment_2_1/test/test_data1.json
Normal file
1
cs457-gc/assignment_2_1/test/test_data1.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user