pages tagged polyhedron http://meng6net.localhost/tag/polyhedron/ <p><small>Copyright © 2005-2020 by <code>Meng Lu &lt;lumeng3@gmail.com&gt;</code></small></p> Meng Lu's home page ikiwiki Tue, 16 May 2017 23:59:39 +0000 Drawing polyhedra with textured faces in Mathematica http://meng6net.localhost/blog/drawing_polyhedra_with_textured_faces_in_Mathematica/ http://meng6net.localhost/blog/drawing_polyhedra_with_textured_faces_in_Mathematica/ blog computing geometry graphics mathematics note polyhedron programming Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <p>In Mathematica and Wolfram Language, with the feature called <a href= "https://reference.wolfram.com/language/ref/Texture.html">Texture</a> it's easy to draw 3D solids such as polyhedra with <a href= "https://en.wikipedia.org/wiki/Image_texture">image textures</a> on the surface such as the faces of polyhedra. When playing with this, I drew a <a href= "https://en.wikipedia.org/wiki/Rhombic_hexecontahedron">rhombic hexecontahedron</a> (<a href= "https://www.wolframalpha.com/input/?t=crmtb01&amp;f=ob&amp;i=rhombic+hexecontahedron">properties</a>), the logo of <a href= "https://www.wolframalpha.com/">Wolfram|Alpha</a> with national flags on its faces:</p> <p><a href= "http://meng6net.localhost/blog/drawing_polyhedra_with_textured_faces_in_Mathematica/image/rhombic_hexecontahedron__60-largest-countries-flags.png"> <img src= "http://meng6net.localhost/blog/drawing_polyhedra_with_textured_faces_in_Mathematica/900x-rhombic_hexecontahedron__60-largest-countries-flags.png" width="900" height="902" class="img" /></a></p> <p>☝ Rhombic hexecontahedron wrapped with the 60 most populous countries' national flags, one different flag drawn on each of the 60 rhombic faces. (It's somewhat odd that the most populous countries happen to have a lot of red and green colors in their national flags.)</p> <p>The code is in <a href= "https://github.com/lumeng/repo-meng-lib/blob/master/Mathematica/Notebook/polyhedra_with_textured_faces.nb"> my Git repository</a>.</p> <p>Remarks:</p> <ul> <li>It was a bit tricky to understand what the option <a href= "https://reference.wolfram.com/language/ref/VertexTextureCoordinates.html"> VertexTextureCoordinates</a> is and does, and how to set it up for what I'm trying to draw. It turns out for putting the national flags on the faces of a rhombic hexecontahedron, since both are (usually) isomorphic to a square, <code>VertexTextureCoordinates -&gt; {{0, 0}, {1, 0}, {1, 1}, {0, 1}}</code> is would work as it aligns the four vertices of a rectangular flag to the four vertices of a rhombic face.</li> </ul> <p>Something left to be improved:</p> <ul> <li> <p>Avoid flags that's not isomorphic to the face of the given polyhedron;</p> </li> <li> <p>Compute the suitable values of <code>VertexTextureCoordinates</code> to reduce or even avoid distortion of the flags;</p> </li> <li> <p>Find a reasonable way to align national flags of shapes not isomorphic to the shape of a face of a given polyhedron, such that the main feature of the national flag wrapped on a polyhedron face is well recognizable.</p> </li> </ul> /blog/drawing_polyhedra_with_textured_faces_in_Mathematica/#comments