papercraft/dodecahedron.scad

22 lines
815 B
OpenSCAD
Raw Permalink Normal View History

2015-01-26 00:09:17 +01:00
//create a dodecahedron by intersecting 6 boxes
module dodecahedron(height)
{
scale([height,height,height]) //scale by height parameter
{
intersection(){
//make a cube
cube([2,2,1], center = true);
intersection_for(i=[0:4]) //loop i from 0 to 4, and intersect results
{
//make a cube, rotate it 116.565 degrees around the X axis,
//then 72*i around the Z axis
rotate([0,0,72*i])
rotate([116.565,0,0])
cube([2,2,1], center = true);
}
}
}
}
2015-01-26 04:24:01 +01:00
dodecahedron(150);