Finding missing faces in a mesh

Questions and answers about the how and why of making maps.
Post Reply
User avatar
gnu-sense
Private First Class
Private First Class
Posts: 78
Joined: Wed Nov 22, 2006 1:21 am

Finding missing faces in a mesh

Post by gnu-sense »

I'm doing some experimentation with creating meshes in R, using the rgl package for creating and displaying meshes in R. I wrote an exporter script that allows me to export the mesh in BZW format (it's not ready for general use, but I'll probably post it when it works better). As an example to work with, I created a trefoil knot based on a cylinder. Evidently there is still a bug somewhere, because two faces are missing from the mesh (you can shoot and fly through the space there); either the vertices are enumerated in the wrong order, or they're just not enumerated at all (probably the latter). Since I'd like to fix whatever is wrong, I have to figure out how to hunt down the missing faces. Does anyone have a general approach for doing this in an arbitrarily large mesh? The trefoil knot has 192 faces. I can think of a few things like setting different materials on different faces to try to figure out which are which, but it seems to me that this is a general problem and there must be a better way. If it's any help, I can work in text/bzw, text/obj, Wings 3D, Blender (if I have to; it still freaks me out)...

Thanks in advance for any help. For reference, here is the trefoil knot bzw code, with the missing faces.

Code: Select all

define knot
 mesh
  vertex 0.168898463480783 -0.140748719567319 -0.230803596619179 
   vertex -0.298409372540578 0.248674477117148 -0.30063396507233 
   vertex -0.590913045266914 0.492427537722428 -0.780143471723014 
   vertex -0.537267870259078 0.447723225215898 -1.38844195086209 
   vertex -0.168898463480783 0.140748719567319 -1.76919640338082 
   vertex 0.298409372540578 -0.248674477117148 -1.69936603492767 
   vertex 0.590913045266914 -0.492427537722428 -1.21985652827699 
   vertex 0.537267870259078 -0.447723225215898 -0.611558049137907 
   vertex 1.50890596159834 0.870458919954984 -0.235288449900922 
   vertex 1.05916160567298 1.22300147910505 -0.0154087592006968 
   vertex 0.726373869936765 1.68755348334393 -0.235288449900923 
   vertex 0.70548529659253 1.99198666901608 -0.766124981279809 
   vertex 1.00873212860671 1.95796820479121 -1.2969615126587 
   vertex 1.45847648453206 1.60542564564114 -1.51684120335892 
   vertex 1.79126422026828 1.14087364140226 -1.2969615126587 
   vertex 1.81215279361251 0.836440455730113 -0.766124981279809 
   vertex 2.35539927164862 1.21461345326785 -0.22315491142755 
   vertex 1.86922400810926 1.33701891912192 0.128347343377029 
   vertex 1.59558776290092 1.84778971055759 0.326184963676285 
   vertex 1.6947829373098 2.4477232252159 0.254467354646531 
   vertex 2.10870234348913 2.78538654673215 -0.0447942810035732 
   vertex 2.59487760702849 2.66298108087808 -0.396296535808152 
   vertex 2.86851385223683 2.15221028944241 -0.594134156107408 
   vertex 2.76931867782796 1.5522767747841 -0.522416547077654 
   vertex 2.71852880698981 0.820885027979221 0.170608144095486 
   vertex 2.15304514020191 0.946634686623033 0.368897241194379 
   vertex 1.91212326831212 1.34628570920207 0.765304899896719 
   vertex 2.13689195640116 1.7857279469058 1.12762088996324 
   vertex 2.69568475538329 2.00754209676697 1.24360541827761 
   vertex 3.26116842217119 1.88179243812316 1.04531632117872 
   vertex 3.50209029406098 1.48214141554412 0.648908662476376 
   vertex 3.27732160597193 1.04269917784039 0.286592672409855 
   vertex 2.59138248063119 -0.467047187732301 0.850521656711813 
   vertex 2.03895506189363 -0.236293737115595 0.978896545754274 
   vertex 1.81405322949992 0.132877379999604 1.41252677089441 
   vertex 2.04842142666374 0.424210730043638 1.89739762730004 
   vertex 2.60476994207545 0.467047187732302 2.14947834328819 
   vertex 3.157197360813 0.236293737115596 2.02110345424572 
   vertex 3.38209919320671 -0.132877379999603 1.58747322910558 
   vertex 3.14773099604289 -0.424210730043638 1.10260237269996 
   vertex 1.68203368124977 -1.68667126124717 1.29432692340628 
   vertex 1.32812892697237 -1.24979321777158 1.53679820028257 
   vertex 1.34783694627519 -0.909230382233501 2.04525849283907 
   vertex 1.72961304873814 -0.864479844850898 2.52185865762438 
   vertex 2.24981797132837 -1.14175586349902 2.68741278193651 
   vertex 2.60372272560577 -1.57863390697461 2.44494150506023 
   vertex 2.58401470630295 -1.91919674251269 1.93648121250373 
   vertex 2.20223860384 -1.96394727989529 1.45988104771842 
   vertex 0.810498350363024 -1.82820034533591 1.2419934014521 
   vertex 0.89546549619852 -1.326031797668 1.58186198479408 
   vertex 1.04166753662498 -1.21866468231796 2.16667014649993 
   vertex 1.16346129920721 -1.56899319930497 2.65384519682883 
   vertex 1.18950164963698 -2.17179965466409 2.7580065985479 
   vertex 1.10453450380148 -2.673968202332 2.41813801520592 
   vertex 0.958332463375019 -2.78133531768204 1.83332985350007 
   vertex 0.836538700792794 -2.43100680069503 1.34615480317117 
   vertex 0.236374860979414 -1.35992348021798 0.7222924129749 
   vertex 0.542829594503044 -0.996869706315123 1.10853168290621 
   vertex 0.511341924791072 -0.878290303117938 1.70840731324531 
   vertex 0.160356901713247 -1.07364747680123 2.17052029547666 
   vertex -0.304523208401276 -1.46850364452821 2.22417111195781 
   vertex -0.610977941924907 -1.83155741843107 1.83793184202651 
   vertex -0.579490272212935 -1.95013682162825 1.23805621168741 
   vertex -0.228505249135109 -1.75477964794496 0.775943229456058 
   vertex -0.473514251950566 -0.132776581294875 -0.184328411762723 
   vertex -0.138865861121513 0.1819445192049 0.220473272395031 
   vertex -0.230177668375384 0.390084987953897 0.789017922538007 
   vertex -0.693960455427659 0.369718961237646 1.18825979342712 
   vertex -1.25853655561831 0.132776581294875 1.18432841176273 
   vertex -1.59318494644736 -0.181944519204901 0.779526727604971 
   vertex -1.50187313919349 -0.390084987953898 0.210982077461995 
   vertex -1.03809035214122 -0.369718961237647 -0.188259793427114 
   vertex -1.07918932920638 0.9640725594075 -1.33296916623292 
   vertex -0.601677497942107 1.2455439017225 -1.07285447126308 
   vertex -0.529070461438774 1.62581964368575 -0.598489739853036 
   vertex -0.903900436956315 1.88213941309667 -0.187751398151325 
   vertex -1.50659710842053 1.86435456533869 -0.0812443961401731 
   vertex -1.9841089396848 1.58288322302369 -0.341359091110015 
   vertex -2.05671597618813 1.20260748106044 -0.815723822520058 
   vertex -1.68188600067059 0.946287711649519 -1.22646216422177 
   vertex -1.44375136847665 1.23278199524387 -1.94701556176283 
   vertex -0.875054465857447 1.29721935045102 -1.72944952515221 
   vertex -0.51548117849522 1.77333607879058 -1.59188778595133 
   vertex -0.575664661459684 2.38222945807396 -1.61491214532043 
   vertex -1.02035024666111 2.76721800475613 -1.78503524580605 
   vertex -1.58904714928031 2.70278064954898 -2.00260128241667 
   vertex -1.94862043664254 2.22666392120942 -2.14016302161754 
   vertex -1.88843695367807 1.61777054192604 -2.11713866224844 
   vertex -1.30260431665046 0.948699218827111 -2.36919067790646 
   vertex -0.839545063568564 1.06389902734101 -1.9855131409893 
   vertex -0.31886544967789 1.38430833938028 -2.01918705549888 
   vertex -0.0455725311444054 1.72223572546295 -2.45048669901369 
   vertex -0.179757593144501 1.87972790591908 -3.02676258980943 
   vertex -0.642816846226395 1.76452809740519 -3.41044012672659 
   vertex -1.16349646011707 1.44411878536592 -3.37676621221701 
   vertex -1.43678937865055 1.10619139928324 -2.9454665687022 
   vertex -0.642520973367068 -0.321260486683533 -2.64792259589787 
   vertex -0.231657635393986 -0.115828817696992 -2.24308624998975 
   vertex 0.314907603565611 0.157453801782806 -2.28163971329095 
   vertex 0.677004239250883 0.338502119625442 -2.74099888987609 
   vertex 0.642520973367067 0.321260486683535 -3.35207740410213 
   vertex 0.231657635393986 0.115828817696994 -3.75691375001025 
   vertex -0.314907603565611 -0.157453801782805 -3.71836028670905 
   vertex -0.677004239250883 -0.338502119625441 -3.25900111012391 
   vertex 0.158024794919063 -1.53871715597314 -2.16465895342732 
   vertex 0.605843046520815 -1.18436980231765 -1.94375153713959 
   vertex 1.13294040934641 -0.964661806075809 -2.16465895342732 
   vertex 1.4305503969437 -1.00829513168427 -2.69797663385795 
   vertex 1.32433711487589 -1.28970996877304 -3.23129431428857 
   vertex 0.876518863274142 -1.64405732242853 -3.4522017305763 
   vertex 0.349421500448548 -1.86376531867038 -3.23129431428857 
   vertex 0.0518115128512531 -1.82013199306192 -2.69797663385795 
   vertex 0.529780686215363 -1.72680650526709 -1.59735834013551 
   vertex 0.915895116752221 -1.27514393497117 -1.74507390873308 
   vertex 1.48720926314804 -1.24809221680075 -1.96364122274243 
   vertex 1.90905504681976 -1.66149788037456 -2.12502651390835 
   vertex 1.93432092892239 -2.27319349473291 -2.13469246743337 
   vertex 1.54820649838553 -2.72485606502883 -1.9869768988358 
   vertex 0.976892351989713 -2.75190778319925 -1.76840958482645 
   vertex 0.555046568317994 -2.33850211962544 -1.60702429366053 
   vertex 0.531558130817719 -1.35586019387991 -0.945777617637143 
   vertex 0.911811235612446 -1.02366727415003 -1.29212824988216 
   vertex 1.51529699779029 -0.920251073326744 -1.29578124004472 
   vertex 1.98850164256653 -1.10619139928324 -0.954596716030801 
   vertex 2.05422830680919 -1.47256693086628 -0.468435944735957 
   vertex 1.67397520201446 -1.80475985059617 -0.12208531249094 
   vertex 1.07048943983662 -1.90817605141945 -0.118432322328384 
   vertex 0.597284795060379 -1.72223572546295 -0.459616846342299 
   vertex 0.149378354487898 -0.161427237575466 0.183206291566079 
   vertex 0.508919573343805 0.153936869358309 -0.199127217405724 
   vertex 1.07764854446933 0.37912684597124 -0.171921484245418 
   vertex 1.52241154989363 0.382229458073954 0.248886741535993 
   vertex 1.58267245308098 0.161427237575464 0.816793708433917 
   vertex 1.22313123422508 -0.153936869358311 1.19912721740572 
   vertex 0.654402263099552 -0.379126845971243 1.17192148424541 
   vertex 0.209639257675246 -0.382229458073956 0.751113258464003 
   vertex -0.572124216302415 0.89465171766105 1.4224478923436 
   vertex -0.43422702907754 1.14736800581332 0.882057141553742 
   vertex -0.0220053485348103 1.5563988019393 0.687968465963717 
   vertex 0.423066955568073 1.88213941309667 0.953876379431133 
   vertex 0.640272563724284 1.93377540708513 1.52401563258911 
   vertex 0.50237537649941 1.68105911893287 2.06440638337897 
   vertex 0.0901536959566795 1.27202832280688 2.25849505896899 
   vertex -0.354918608146204 0.946287711649515 1.99258714550158 
   vertex -1.05826201303498 1.23691799704691 2.23304805213991 
   vertex -0.910329980648443 1.29055804345855 1.64131992259377 
   vertex -0.814925429459794 1.75977956629568 1.25970171783918 
   vertex -0.827935051643221 2.36971896123765 1.31174020657289 
   vertex -0.941737986965022 2.7630820029531 1.76695194786009 
   vertex -1.08967001935155 2.70944195654145 2.35868007740623 
   vertex -1.1850745705402 2.24022043370432 2.74029828216082 
   vertex -1.17206494835678 1.63028103876235 2.68825979342711 
   vertex -1.64252695968025 0.846857580136866 2.45295248867593 
   vertex -1.31413968765061 0.952417123172975 1.94706485043581 
   vertex -1.36755989586859 1.32849075723691 1.46683758840552 
   vertex -1.77149475086489 1.75477964794496 1.2935813196611 
   vertex -2.28932469289788 1.98156954460933 1.52878721666687 
   vertex -2.61771196492752 1.87601000157322 2.03467485490698 
   vertex -2.56429175670954 1.49993636750928 2.51490211693727 
   vertex -2.16035690171325 1.07364747680123 2.6881583856817 
   vertex -2.17143518457743 -0.462917462300263 1.9936444645381 
   vertex -1.83125338581488 -0.223657352749339 1.54427349991136 
   vertex -1.94026599831548 0.146618200717687 1.06896771949027 
   vertex -2.43461491214611 0.431006800695036 0.846154803171176 
   vertex -3.02471723812919 0.462917462300273 1.00635553546191 
   vertex -3.36489903689175 0.223657352749349 1.45572650008865 
   vertex -3.25588642439115 -0.146618200717678 1.93103228050974 
   vertex -2.76153751056052 -0.431006800695026 2.15384519682883 
   vertex -2.00321910699607 -1.63794039172846 1.01449651417923 
   vertex -1.94797206351004 -1.18087736119198 0.610832705566063 
   vertex -2.33741584197065 -0.860499512714786 0.263564944746445 
   vertex -2.94341955873748 -0.864479844850899 0.176117976233571 
   vertex -3.41099445537703 -1.19048673301773 0.399717048193869 
   vertex -3.46624149886305 -1.64754976355421 0.803380856807034 
   vertex -3.07679772040245 -1.9679276120314 1.15064861762665 
   vertex -2.47079400363562 -1.96394727989529 1.23809558613953 
   vertex -1.60030217544719 -1.8203555405252 0.322776467266929 
   vertex -1.88827810870131 -1.32173363896192 0.114571325089672 
   vertex -2.37763142657845 -1.2204309727933 -0.239228646915673 
   vertex -2.78170559225845 -1.57578926995636 -0.531372223515598 
   vertex -2.86379943969057 -2.1796444594748 -0.590725659698048 
   vertex -2.57582350643644 -2.67826636103808 -0.382520517520792 
   vertex -2.08647018855931 -2.7795690272067 -0.0287205455154462 
   vertex -1.6823960228793 -2.42421073004364 0.263423031084478 
   vertex -0.957832673554466 -1.33606137942567 -0.0290364923974438 
   vertex -1.40337486115518 -0.932175300787077 -0.144238552409971 
   vertex -1.76423821223216 -0.810660698202824 -0.623733248198677 
   vertex -1.82903386988791 -1.04269917784039 -1.1866390900565 
   vertex -1.55980541665058 -1.49236574532052 -1.50321347016217 
   vertex -1.11426322904987 -1.89625182395912 -1.38801141014964 
   vertex -0.753399877972891 -2.01776642654337 -0.908516714360938 
   vertex -0.688604220317138 -1.7857279469058 -0.345610872503116 
   vertex 0.168898463480782 -0.14074871956732 -0.230803596619179 
   vertex -0.298409372540579 0.248674477117147 -0.30063396507233 
   vertex -0.590913045266915 0.492427537722427 -0.780143471723014 
   vertex -0.537267870259079 0.447723225215897 -1.38844195086209 
   vertex -0.168898463480784 0.140748719567317 -1.76919640338082 
   vertex 0.298409372540577 -0.24867447711715 -1.69936603492767 
   vertex 0.590913045266912 -0.49242753772243 -1.21985652827699 
   vertex 0.537267870259077 -0.4477232252159 -0.611558049137907 
 face
   vertices 1 9 10 2 
  endface
  face
   vertices 2 10 11 3 
  endface
  face
   vertices 3 11 12 4 
  endface
  face
   vertices 4 12 13 5 
  endface
  face
   vertices 5 13 14 6 
  endface
  face
   vertices 6 14 15 7 
  endface
  face
   vertices 7 15 8 0 
  endface
  face
   vertices 0 8 9 1 
  endface
  face
   vertices 9 17 18 10 
  endface
  face
   vertices 10 18 19 11 
  endface
  face
   vertices 11 19 20 12 
  endface
  face
   vertices 12 20 21 13 
  endface
  face
   vertices 13 21 22 14 
  endface
  face
   vertices 14 22 23 15 
  endface
  face
   vertices 15 23 16 8 
  endface
  face
   vertices 8 16 17 9 
  endface
  face
   vertices 17 25 26 18 
  endface
  face
   vertices 18 26 27 19 
  endface
  face
   vertices 19 27 28 20 
  endface
  face
   vertices 20 28 29 21 
  endface
  face
   vertices 21 29 30 22 
  endface
  face
   vertices 22 30 31 23 
  endface
  face
   vertices 23 31 24 16 
  endface
  face
   vertices 16 24 25 17 
  endface
  face
   vertices 25 33 34 26 
  endface
  face
   vertices 26 34 35 27 
  endface
  face
   vertices 27 35 36 28 
  endface
  face
   vertices 28 36 37 29 
  endface
  face
   vertices 29 37 38 30 
  endface
  face
   vertices 30 38 39 31 
  endface
  face
   vertices 31 39 32 24 
  endface
  face
   vertices 24 32 33 25 
  endface
  face
   vertices 33 41 42 34 
  endface
  face
   vertices 34 42 43 35 
  endface
  face
   vertices 35 43 44 36 
  endface
  face
   vertices 36 44 45 37 
  endface
  face
   vertices 37 45 46 38 
  endface
  face
   vertices 38 46 47 39 
  endface
  face
   vertices 39 47 40 32 
  endface
  face
   vertices 32 40 41 33 
  endface
  face
   vertices 41 49 50 42 
  endface
  face
   vertices 42 50 51 43 
  endface
  face
   vertices 43 51 52 44 
  endface
  face
   vertices 44 52 53 45 
  endface
  face
   vertices 45 53 54 46 
  endface
  face
   vertices 46 54 55 47 
  endface
  face
   vertices 47 55 48 40 
  endface
  face
   vertices 40 48 49 41 
  endface
  face
   vertices 49 57 58 50 
  endface
  face
   vertices 50 58 59 51 
  endface
  face
   vertices 51 59 60 52 
  endface
  face
   vertices 52 60 61 53 
  endface
  face
   vertices 53 61 62 54 
  endface
  face
   vertices 54 62 63 55 
  endface
  face
   vertices 55 63 56 48 
  endface
  face
   vertices 48 56 57 49 
  endface
  face
   vertices 57 65 66 58 
  endface
  face
   vertices 58 66 67 59 
  endface
  face
   vertices 59 67 68 60 
  endface
  face
   vertices 60 68 69 61 
  endface
  face
   vertices 61 69 70 62 
  endface
  face
   vertices 62 70 71 63 
  endface
  face
   vertices 63 71 64 56 
  endface
  face
   vertices 56 64 65 57 
  endface
  face
   vertices 65 73 74 66 
  endface
  face
   vertices 66 74 75 67 
  endface
  face
   vertices 67 75 76 68 
  endface
  face
   vertices 68 76 77 69 
  endface
  face
   vertices 69 77 78 70 
  endface
  face
   vertices 70 78 79 71 
  endface
  face
   vertices 71 79 72 64 
  endface
  face
   vertices 64 72 73 65 
  endface
  face
   vertices 73 81 82 74 
  endface
  face
   vertices 74 82 83 75 
  endface
  face
   vertices 75 83 84 76 
  endface
  face
   vertices 76 84 85 77 
  endface
  face
   vertices 77 85 86 78 
  endface
  face
   vertices 78 86 87 79 
  endface
  face
   vertices 79 87 80 72 
  endface
  face
   vertices 72 80 81 73 
  endface
  face
   vertices 81 89 90 82 
  endface
  face
   vertices 82 90 91 83 
  endface
  face
   vertices 83 91 92 84 
  endface
  face
   vertices 84 92 93 85 
  endface
  face
   vertices 85 93 94 86 
  endface
  face
   vertices 86 94 95 87 
  endface
  face
   vertices 87 95 88 80 
  endface
  face
   vertices 80 88 89 81 
  endface
  face
   vertices 89 97 98 90 
  endface
  face
   vertices 90 98 99 91 
  endface
  face
   vertices 91 99 100 92 
  endface
  face
   vertices 92 100 101 93 
  endface
  face
   vertices 93 101 102 94 
  endface
  face
   vertices 94 102 103 95 
  endface
  face
   vertices 95 103 96 88 
  endface
  face
   vertices 88 96 97 89 
  endface
  face
   vertices 97 105 106 98 
  endface
  face
   vertices 98 106 107 99 
  endface
  face
   vertices 99 107 108 100 
  endface
  face
   vertices 100 108 109 101 
  endface
  face
   vertices 101 109 110 102 
  endface
  face
   vertices 102 110 111 103 
  endface
  face
   vertices 103 111 104 96 
  endface
  face
   vertices 96 104 105 97 
  endface
  face
   vertices 105 113 114 106 
  endface
  face
   vertices 106 114 115 107 
  endface
  face
   vertices 107 115 116 108 
  endface
  face
   vertices 108 116 117 109 
  endface
  face
   vertices 109 117 118 110 
  endface
  face
   vertices 110 118 119 111 
  endface
  face
   vertices 111 119 112 104 
  endface
  face
   vertices 104 112 113 105 
  endface
  face
   vertices 113 121 122 114 
  endface
  face
   vertices 114 122 123 115 
  endface
  face
   vertices 115 123 124 116 
  endface
  face
   vertices 116 124 125 117 
  endface
  face
   vertices 117 125 126 118 
  endface
  face
   vertices 118 126 127 119 
  endface
  face
   vertices 119 127 120 112 
  endface
  face
   vertices 112 120 121 113 
  endface
  face
   vertices 121 129 130 122 
  endface
  face
   vertices 122 130 131 123 
  endface
  face
   vertices 123 131 132 124 
  endface
  face
   vertices 124 132 133 125 
  endface
  face
   vertices 125 133 134 126 
  endface
  face
   vertices 126 134 135 127 
  endface
  face
   vertices 127 135 128 120 
  endface
  face
   vertices 120 128 129 121 
  endface
  face
   vertices 129 137 138 130 
  endface
  face
   vertices 130 138 139 131 
  endface
  face
   vertices 131 139 140 132 
  endface
  face
   vertices 132 140 141 133 
  endface
  face
   vertices 133 141 142 134 
  endface
  face
   vertices 134 142 143 135 
  endface
  face
   vertices 135 143 136 128 
  endface
  face
   vertices 128 136 137 129 
  endface
  face
   vertices 137 145 146 138 
  endface
  face
   vertices 138 146 147 139 
  endface
  face
   vertices 139 147 148 140 
  endface
  face
   vertices 140 148 149 141 
  endface
  face
   vertices 141 149 150 142 
  endface
  face
   vertices 142 150 151 143 
  endface
  face
   vertices 143 151 144 136 
  endface
  face
   vertices 136 144 145 137 
  endface
  face
   vertices 145 153 154 146 
  endface
  face
   vertices 146 154 155 147 
  endface
  face
   vertices 147 155 156 148 
  endface
  face
   vertices 148 156 157 149 
  endface
  face
   vertices 149 157 158 150 
  endface
  face
   vertices 150 158 159 151 
  endface
  face
   vertices 151 159 152 144 
  endface
  face
   vertices 144 152 153 145 
  endface
  face
   vertices 153 161 162 154 
  endface
  face
   vertices 154 162 163 155 
  endface
  face
   vertices 155 163 164 156 
  endface
  face
   vertices 156 164 165 157 
  endface
  face
   vertices 157 165 166 158 
  endface
  face
   vertices 158 166 167 159 
  endface
  face
   vertices 159 167 160 152 
  endface
  face
   vertices 152 160 161 153 
  endface
  face
   vertices 161 169 170 162 
  endface
  face
   vertices 162 170 171 163 
  endface
  face
   vertices 163 171 172 164 
  endface
  face
   vertices 164 172 173 165 
  endface
  face
   vertices 165 173 174 166 
  endface
  face
   vertices 166 174 175 167 
  endface
  face
   vertices 167 175 168 160 
  endface
  face
   vertices 160 168 169 161 
  endface
  face
   vertices 169 177 178 170 
  endface
  face
   vertices 170 178 179 171 
  endface
  face
   vertices 171 179 180 172 
  endface
  face
   vertices 172 180 181 173 
  endface
  face
   vertices 173 181 182 174 
  endface
  face
   vertices 174 182 183 175 
  endface
  face
   vertices 175 183 176 168 
  endface
  face
   vertices 168 176 177 169 
  endface
  face
   vertices 177 185 186 178 
  endface
  face
   vertices 178 186 187 179 
  endface
  face
   vertices 179 187 188 180 
  endface
  face
   vertices 180 188 189 181 
  endface
  face
   vertices 181 189 190 182 
  endface
  face
   vertices 182 190 191 183 
  endface
  face
   vertices 183 191 184 176 
  endface
  face
   vertices 176 184 185 177 
  endface
  face
   vertices 185 1 2 186 
  endface
  face
   vertices 186 2 3 187 
  endface
  face
   vertices 187 3 4 188 
  endface
  face
   vertices 188 4 5 189 
  endface
  face
   vertices 189 5 6 190 
  endface
  face
   vertices 190 6 7 191 
  endface
  face
   vertices 191 7 0 184 
  endface
  face
   vertices 184 0 1 185 
  endface
 end
enddef

group knot
 position -200 -200 40
 size 10 10 10
 matref LinkMaterial
end
-- gnu-sense
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Finding missing faces in a mesh

Post by blast »

Running bzfs with debug level 3 (-ddd) provided this output:

Code: Select all

non-planar mesh face (-0.009293): 54 62 63 55  face
  # plane normal = -0.237834 -0.816635 -0.525873 -200.652
    vertices 54 62 63 55 # -190.417 -227.813 58.3333 -205.795 -219.501 52.3806 -202.285 -217.548 47.7594 -191.635 -224.31 53.4615
    matref 0
  endface

non-planar mesh face (0.005470): 112 120 121 113  face
  # plane normal = -0.76993 0.555459 -0.314123 -21.6764
    vertices 112 120 121 113 # -194.702 -217.268 24.0264 -194.684 -213.559 30.5422 -190.882 -210.237 27.0787 -190.841 -212.751 22.5493
    matref 0
  endface
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
gnu-sense
Private First Class
Private First Class
Posts: 78
Joined: Wed Nov 22, 2006 1:21 am

Re: Finding missing faces in a mesh

Post by gnu-sense »

blast wrote:Running bzfs with debug level 3 (-ddd) provided this output:
Thanks, blast, that does the trick. I'll add the next debug level to my test .conf file :)
I'll have to see what I can do about non-planar faces; my best guess is that some rounding is taking place somewhere that ends up torquing the faces. Triangles are probably safer anyway, if I can figure out how to make a cylinder with triangle faces, I'll do that...

-- gnu-sense
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Finding missing faces in a mesh

Post by JeffM »

If you break all faces into triangles then you don't have to worry about them being planar or not ;)
ImageJeffM
User avatar
gnu-sense
Private First Class
Private First Class
Posts: 78
Joined: Wed Nov 22, 2006 1:21 am

Re: Finding missing faces in a mesh

Post by gnu-sense »

JeffM wrote:If you break all faces into triangles then you don't have to worry about them being planar or not ;)
I broke them into triangles, two per quad face, and now ALL of the formerly quadrilateral faces are folded, in or out. They must not have been planar?

/me scratches head... time to do some more digging on this one.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Finding missing faces in a mesh

Post by JeffM »

yeah if they picked up a visible crease along the split then they were not planar :) you can smooth the vertex normals between the shared edge to make it graphically smooth (give all verts the normal for the planar face they are suposed to represent). If you don't provide normals then each vertex uses the surface normal of the face and that will make it look worse.
ImageJeffM
Post Reply