{"id":3671,"date":"2012-06-15T08:36:31","date_gmt":"2012-06-15T13:36:31","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=3671"},"modified":"2012-06-15T08:36:31","modified_gmt":"2012-06-15T13:36:31","slug":"library-of-3d-geometry","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2012\/06\/15\/library-of-3d-geometry\/","title":{"rendered":"Library of 3D Geometry"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\">Jiro<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/24484-geom3d\">geom3d<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/18756\">David Legland<\/a>.\r\n   <\/p>\r\n   <p>If you have explored around the File Exchange, you probably have realized that there are entries with varying complexity and\r\n      quality. Some are very simple few liners (which could still be very useful), while others can be as big as a full toolbox.\r\n      But what makes certain entries better than others? Is it just the relevancy? Well, if that's the case, then every entry is\r\n      relevant to someone, so they're all good!\r\n   <\/p>\r\n   <p>What I've noticed over the years is that there are certain characteristics that make some entries more popular than others.\r\n      We (Pick of the Week authors) like well-written entries, and if you're hoping to get your entries highlighted in this blog,\r\n      here are some things to note:\r\n   <\/p>\r\n   <div>\r\n      <ul>\r\n         <li><b>Relevancy still matters.<\/b> Tools that resonate with many people are generally good. However, that's not to say that a niche tool isn't useful.\r\n         <\/li>\r\n         <li><b>Good documentation.<\/b> Imagine that the user of your function knows nothing about how it's written or how to use it. The more help you provide,\r\n            the better it is.\r\n         <\/li>\r\n         <li><b>Lots of examples.<\/b> I learn a lot from examples. If they're full demos, those are the best.\r\n         <\/li>\r\n         <li><b>Good comments.<\/b> I like to look through the code, just to see how things are done. I've learned a lot of new techniques just by examining\r\n            people's code. If you have good comments in your code, it makes it easier for people to follow your thought process.\r\n         <\/li>\r\n         <li><b>Bug free.<\/b> Um... yeah.\r\n         <\/li>\r\n         <li><b>Good error handling.<\/b> The code may be bug free, but you're not guaranteed that the user will provide the appropriate inputs. So if you gracefully\r\n            handle bad inputs and provide meaningful error messages, that improves the usability trememdously.\r\n         <\/li>\r\n      <\/ul>\r\n   <\/div>\r\n   <p>Obviously, the list above isn't exhaustive, but it's representative of what I look for in a good entry.<\/p>\r\n   <p>So, let's take a look at \"geom3d\" by David. This is a <i>huge<\/i> library of functions for visualizing and creating 3D geometries. There are close to 180 functions for 3d and over 200 functions\r\n      for 2d. Besides the extensive help that each function has, which is extremely impressive BTW, the part that really caught\r\n      my eyes was the set of published demo scripts included with the entry. The nice thing about <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2012a\/techdoc\/matlab_env\/f6-14058.html\">publishing<\/a> your example files is that File Exchange will nicely display those pages with appropriate syntax highlighting. <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/24484-geom3d\/content\/geom3d\/geom3d-demos\/html\/drawSoccerBall.html\">Here<\/a>'s one of David's published demo scripts.\r\n   <\/p>\r\n   <p>Let's take a look at one of many examples he has:<\/p><pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">[v f] = createSoccerBall;\r\ndrawMesh(v, f);\r\nview(3); axis(<span style=\"color: #A020F0\">'vis3d'<\/span>); axis <span style=\"color: #A020F0\">off<\/span>;\r\ntitle(<span style=\"color: #A020F0\">'Soccer Ball'<\/span>);<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_geom3d\/potw_geom3d_01.png\"> <p>Some of the functionalities require his other entry, <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/7844-geom2d\">geom2d<\/a>. Download both and give them a try! Thanks David for a great entry and the extra effort you put in to make it high quality!\r\n   <\/p>\r\n   <p><b>Comments<\/b><\/p>\r\n   <p>Let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=3671#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/24484-geom3d#comments\">comment<\/a> for David.\r\n   <\/p>\r\n   <p>If you have your own favorite File Exchange entry, and we haven't picked it yet, please tell us about it <a href=\"https:\/\/blogs.mathworks.com\/pick\/2012\/04\/13\/what-is-your-favorite-unrecognized-file-exchange-submission\/\">here<\/a>.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_67817d1004d848f8861ab986841a26cd() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='67817d1004d848f8861ab986841a26cd ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 67817d1004d848f8861ab986841a26cd';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Jiro Doke';\r\n        copyright = 'Copyright 2012 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_67817d1004d848f8861ab986841a26cd()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.14<br><\/p>\r\n<\/div>\r\n<!--\r\n67817d1004d848f8861ab986841a26cd ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\r\n% Jiro>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/24484-geom3d geom3d> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/18756 David\r\n% Legland>.\r\n%\r\n% If you have explored around the File Exchange, you probably have realized\r\n% that there are entries with varying complexity and quality. Some are very\r\n% simple few liners (which could still be very useful), while others can be\r\n% as big as a full toolbox. But what makes certain entries better than\r\n% others? Is it just the relevancy? Well, if that's the case, then every\r\n% entry is relevant to someone, so they're all good!\r\n%\r\n% What I've noticed over the years is that there are certain\r\n% characteristics that make some entries more popular than others. We (Pick\r\n% of the Week authors) like well-written entries, and if you're hoping to\r\n% get your entries highlighted in this blog, here are some things to note:\r\n%\r\n% * *Relevancy still matters.* Tools that resonate with many people are\r\n% generally good. However, that's not to say that a niche tool isn't\r\n% useful.\r\n% * *Good documentation.* Imagine that the user of your function knows\r\n% nothing about how it's written or how to use it. The more help you\r\n% provide, the better it is.\r\n% * *Lots of examples.* I learn a lot from examples. If they're full demos,\r\n% those are the best.\r\n% * *Good comments.* I like to look through the code, just to see how\r\n% things are done. I've learned a lot of new techniques just by examining\r\n% people's code. If you have good comments in your code, it makes it easier\r\n% for people to follow your thought process.\r\n% * *Bug free.* Um... yeah.\r\n% * *Good error handling.* The code may be bug free, but you're not\r\n% guaranteed that the user will provide the appropriate inputs. So if you\r\n% gracefully handle bad inputs and provide meaningful error messages, that\r\n% improves the usability trememdously.\r\n%\r\n% Obviously, the list above isn't exhaustive, but it's representative of\r\n% what I look for in a good entry.\r\n%\r\n% So, let's take a look at \"geom3d\" by David. This is a _huge_ library of\r\n% functions for visualizing and creating 3D geometries. There are close to\r\n% 180 functions for 3d and over 200 functions for 2d. Besides the extensive\r\n% help that each function has, which is extremely impressive BTW, the part\r\n% that really caught my eyes was the set of published demo scripts included\r\n% with the entry. The nice thing about\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2012a\/techdoc\/matlab_env\/f6-14058.html\r\n% publishing> your example files is that File Exchange will nicely display\r\n% those pages with appropriate syntax highlighting.\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/24484-geom3d\/content\/geom3d\/geom3d-demos\/html\/drawSoccerBall.html\r\n% Here>'s one of David's published demo scripts.\r\n%\r\n% Let's take a look at one of many examples he has:\r\n\r\n[v f] = createSoccerBall;\r\ndrawMesh(v, f);\r\nview(3); axis('vis3d'); axis off;\r\ntitle('Soccer Ball');\r\n\r\n%%\r\n% Some of the functionalities require his other entry,\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/7844-geom2d geom2d>.\r\n% Download both and give them a try! Thanks David for a great entry and the\r\n% extra effort you put in to make it high quality!\r\n%\r\n% *Comments*\r\n%\r\n% Let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=3671#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/24484-geom3d#comments\r\n% comment> for David.\r\n%\r\n% If you have your own favorite File Exchange entry, and we haven't picked\r\n% it yet, please tell us about it\r\n% <https:\/\/blogs.mathworks.com\/pick\/2012\/04\/13\/what-is-your-favorite-unrecognized-file-exchange-submission\/\r\n% here>.\r\n\r\n##### SOURCE END ##### 67817d1004d848f8861ab986841a26cd\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   Jiro's pick this week is geom3d by David Legland.\r\n   \r\n   If you have explored around the File Exchange, you probably have realized that there are entries with varying complexity and\r\n     ... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2012\/06\/15\/library-of-3d-geometry\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3671"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=3671"}],"version-history":[{"count":7,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3671\/revisions"}],"predecessor-version":[{"id":3679,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3671\/revisions\/3679"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=3671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=3671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=3671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}