rs=4; rc1=4; rc2=rc1; a=35; wedgehalflength=sqrt(3)*a/14/2; wedgefactor=sin(22.5); // determines the angle of the wedges $fa=0.5; // default minimum facet angle is now 0.5 $fs=0.5; // default minimum facet size is now 0.5 mm module cutout45(p) { polyhedron( points = [ [ 0, 0, -wedgehalflength ], [ 0, 0, wedgehalflength ], [ rc1, rc1*p, wedgehalflength ], [ rc1, -rc1*p, wedgehalflength ], [ rc1, rc1*p, -wedgehalflength ], [ rc1, -rc1*p, -wedgehalflength ] ], faces = [ [ 1, 3, 5, 0 ], [ 3, 2, 4, 5 ], [ 2, 1, 0, 4 ], [ 4, 0, 5 ], [ 1, 2, 3 ] ], convexity = 10 ); } for (angle = [0 : 120 : 240]) { rotate ([0, 0, angle]) { translate (-a/6*sqrt(3)*[1,0,0]) { // bottom rotate ([90, 0, 0]) { difference() { cylinder(r=rc1,h=a,center=true); rotate ([0, 0, 180]) cutout45(wedgefactor); if (angle == 0) rotate ([0, 0, -90]) cutout45(wedgefactor); } } // top translate ([0,0,a*sqrt(3)]) { rotate ([90, 0, 0]) { difference() { cylinder(r=rc2,h=a,center=true); rotate ([0, 0, 180]) cutout45(wedgefactor); rotate ([0, 0, 90 + acos(1/3)]) cutout45(wedgefactor); } } } } translate (a/3*sqrt(3)*[1,0,0]) { sphere(rs); difference() { cylinder(r1=rc1,r2=rc2,h=a*sqrt(3)); //translate ([0, 0, (25 - angle/30)*wedgehalflength ] ) cutout45(1); for (index = [ 3 : 4 : 11 ]) { translate ([0, 0, index*wedgehalflength ] ) { rotate ([0, 0, 60]) cutout45(wedgefactor); rotate ([0, 0, -60]) cutout45(wedgefactor); cutout45(1); } } for (index = [ 17 : 4 : 25 ]) { translate ([0, 0, index*wedgehalflength ] ) { rotate ([0, 0, 60]) cutout45(wedgefactor); rotate ([0, 0, -60]) cutout45(wedgefactor); if (index != 25 - angle/30) cutout45(1); } } } translate(a*sqrt(3)*[0,0,1]) { sphere(rs); rotate ([0,-90+atan(sqrt(2)),0]) difference() { cylinder(r=rc2,h=a); translate([0, 0, .5*a]) { rotate ([0, 0, (360-acos(1/3))/2-90]) cutout45(wedgefactor); rotate ([0, 0, -(360-acos(1/3))/2+90]) cutout45(wedgefactor); } } } } } } translate (a*[0,0,sqrt(3)+1/3*sqrt(6)]) { sphere(rs); //cylinder(r1=rc1,r2=rc2,h=a*1/3*sqrt(6)); } //translate (a*[0,0,sqrt(3)]) { // //cylinder(r1=4,r2=4,h=a*1/3*sqrt(6)); // difference() { // //cylinder(r=1,h=4); // cylinder(r1=10,r2=10,h=2); // cylinder(r1=2,r2=2,h=4,center=true); // } //} //difference() { //cylinder(r=1,h=4); // cylinder(r1=10,r2=10,h=20,center=true); // cylinder(r1=2,r2=2,h=30,center=true); // } //translate (a*[0,0,sqrt(3)+1/12*sqrt(6)]) sphere(6); //translate (a*[0,0,sqrt(3)+3/12*sqrt(6)]) sphere(4);