Welcome to MakerHome




We've completed our yearlong print-a-day project!
All new material is now at Hacktastic: www.mathgrrl.com


Sunday, February 16, 2014

Day 174 - MAA icosahedron

In a couple of days I'll be speaking at the Carriage House, the headquarters of the Mathematical Association of America. Since the MAA's logo is an icosahedron, I'll be bringing them one as a present:



STL file: http://www.geekhaus.com/makerhome/day174_MAAisosahedron.stl
OpenSCAD file: http://www.geekhaus.com/makerhome/day174_MAAisosahedron.scad
Thingiverse link: http://www.thingiverse.com/thing:252515

Settings: MakerWare .3mm/low with 5% infill (half as much as usual), on a Replicator 2, in about an hour. The black was added after printing with a Sharpie.

Technical notes: We printed hollow icosahedra on Day 32 and Day 100, but used a Community Shape Script file from Tinkercad that needed rotating to print on a flat face. Since I don't know how to rotate by non-integer degrees in Tinkercad, the rotation was not exact and some flat triangles had to be added to the top and base in order for the model to print correctly.  Today we finally got off our Keister and made a new icosahedron, constructing the triangle faces explicitly using the polyhedron command in OpenSCAD.  We used Harlan Martin's write.scad code from Thingiverse to add the text.

// mathgrrl MAA icosahedron

use <write.scad>

////////////////////////////////////////////////////////////////////
// parameters
////////////////////////////////////////////////////////////////////

$fn=12;
phi = (sqrt(5)-1)/2; 
scalefactor = 50; // 15 for small

////////////////////////////////////////////////////////////////////
// renders
////////////////////////////////////////////////////////////////////

// MAA logo sized for scalefactor 50
translate([1,-5,35])
color("red")
write("MAA",t=30,h=32,center=true);

icosahedron(scalefactor);

// uncomment this to see the vertices
//showvertices(scalefactor);

////////////////////////////////////////////////////////////////////
// module for icosahedron 
// vertex coords from Wikipedia
// http://en.wikipedia.org/wiki/Icosahedron#Cartesian_coordinates
////////////////////////////////////////////////////////////////////

module icosahedron(thescale){
scale(thescale)
// rotate to have flat top and base
rotate(-atan(1-phi),[1,0,0])
polyhedron(
// list the vertices in some order
points=[
[0,1,phi], //vx 0
[0,1,-phi], //vx 1
[0,-1,phi], //vx 2
[0,-1,-phi], //vx 3
[1,phi,0], //vx 4
[1,-phi,0], //vx 5
[-1,phi,0], //vx 6
[-1,-phi,0], //vx 7
[phi,0,1], //vx 8
[-phi,0,1], //vx 9
[phi,0,-1], //vx 10
[-phi,0,-1], //vx 11
],  
// define faces, each oriented counter-clockwise
triangles=[
// top face
[8,9,2],
// faces with edges incident with top face
[8,2,5],
[2,9,7],
[9,8,0],
// faces next row down
[8,4,0],
[8,5,4],
[2,3,5],
[2,7,3],
[9,6,7],
[9,0,6],
// faces another row down
[0,1,6],
[0,4,1],
[5,10,4],
[5,3,10],
[7,11,3],
[7,6,11],
// and one more down, with edges incident to bottom face
[4,10,1],
[3,11,10],
[6,1,11],
// bottom face
[10,11,1]
]
); 
}  

OpenSCAD's polyhedron command takes a list of vertices as inputs, followed by a list of triples of those vertices that determine oriented triangle faces. We got the coordinates for the vertices from Wikipedia's icosahedron page, and wrote a vertex visualizer to keep track of the twelve vertices and determine how to construct and orient the triangles. In case you want to use the same trick, here is the code for that vertex visualizer:

////////////////////////////////////////////////////////////////////
// vertex visualizer module 
// use for constructing oriented faces
////////////////////////////////////////////////////////////////////
module showvertices(thescale){
scale(thescale)
// rotate to have flat top and base
rotate(-atan(1-phi),[1,0,0])
union(){
// vertices in yz-plane
color("red") translate([0,1,phi]) sphere(.1); //vx 0
color("red") translate([0,1,-phi]) sphere(.2); //vx 1
color("red") translate([0,-1,phi]) cube(.1); //vx 2
color("red") translate([0,-1,-phi]) cube(.2); //vx 3
// vertices in xy-plane
color("blue") translate([1,phi,0]) sphere(.1); //vx 4
color("blue") translate([1,-phi,0]) sphere(.2); //vx 5
color("blue") translate([-1,phi,0]) cube(.1); //vx 6
color("blue") translate([-1,-phi,0]) cube(.2); //vx 7
// vertices in xz-plane
color("yellow") translate([phi,0,1]) sphere(.1); //vx 8
color("yellow") translate([-phi,0,1]) sphere(.2); //vx 9
color("yellow") translate([phi,0,-1]) cube(.1); //vx 10
color("yellow") translate([-phi,0,-1]) cube(.2); //vx 11
}
}