// icosidodecahedron vers 5 // based on 12 pentagons and 20 triangles // do top half and turn through 180 degree on x axis for bottom half // everything derived from the length of side. // side=12; wall=2; ////////////////////////////////////////////////// function centre(num)= side/(2*(sin(180/num))); // centre of circle circumscribing a polygon dpentip = centre(5); // distance from center to tip of pentagon dpenflat = 0.5*side/tan(180/5); // apothem of pentagon pensize = dpentip+dpenflat; // height of pentagon (flat to tip) pendiag = (1 + sqrt(5)) * side/2; //diagonal of pentagon trisize = side*sin(60); // height of triangle dtritip = centre(3); // centre to tip of triangle dtriflat = trisize - dtritip; // centre to flat of triangle dicostip = centre(10); // distance from centre to tip on base dicosflat= 0.5*side/tan(180/10);// distance from centre to flat on base dicospoints= pendiag/(2*(sin(180/5))); //distance from centre to points of triangles and pentagons httrib = sqrt((trisize*trisize)-((dicosflat-dicospoints)*(dicosflat-dicospoints))); // height of pentpoints and triangle points tribang= asin(httrib/trisize); // angle triangle base htpen = sqrt((pensize*pensize)-((dicosflat-dpentip)*(dicosflat-dpentip))); // height to top tip of pentagon penang = (acos((dicosflat-dpentip)/pensize)); // angle of pentagon tritang = asin((htpen-httrib)/trisize); // angle triangle top module poly(num){ // generate an equal side length polygon circle(r= (side)/(2*sin(180/num)),\$fn=num); } module penface(){ // pentagon linear_extrude(wall)poly(5); // sphere(side/5); // add surface object for pentagon } module pen(){ // pentagon at angle rotate([0,270+penang,0]) // vertical angle of pentagon translate([0,0,dpenflat]) rotate([0,-90,0]) penface(); } module offpen(){ // offset pentagon translate([dicosflat,0,0]) pen(); } module rotpen(){ // ring of pentagons for(j=[0:72:360]) rotate([0,0,j]) offpen(); } module toppen(){ // top pentagon translate([0,0,htpen]) rotate([180,0,0]) penface(); } module triface(){ // triangle linear_extrude(wall)poly(3); // sphere(side/5); // add surface object for triangle } module tribase(){ // base triangle at angle rotate([0,270+tribang,0]) // vertical angle of bottom triangle translate([0,0,dtriflat]) rotate([0,-90,0]) triface(); } module offtribase(){ // offset triangle translate([dicosflat,0,0]) tribase(); } module rottribase(){ // rotete bottom triangles for(j=[72/2:72:360]) rotate([0,0,j]) offtribase(); } module tritop(){ // top triangle at angle rotate([0,270+tritang,0]) // vertical angle of top triangle translate([0,0,dtritip]) rotate([0,90,180]) triface(); } module offtritop(){ // offset triangle translate([dicospoints,0,httrib]) tritop(); } module rottritop(){ //rotate top triangles for(j=[72/2:72:360]) rotate([0,0,j]) offtritop(); } module top(){ // top half of icosidodecahedron rotpen(); rottribase(); toppen(); rottritop(); } module icosi(){ // icosidodecahedron top(); rotate([180,0,72/2])top(); } icosi();