// size is the XY plane size, height in Z module hexagram(size, height) { boxWidth=size/1.75; for (v = [[0,1],[0,-1],[1,-1]]) { intersection() { rotate([0,0,60*v[0]]) cube([size, boxWidth, height], true); rotate([0,0,60*v[1]]) cube([size, boxWidth, height], true); } } } // size is the XY plane size, height in Z module hexagon(size, height) { boxWidth = size/1.75; rotate([0, 0, 90]) {for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);} } module box(size) { cube([2*size, 2*size, size], center = true); } module octahedron(size) { dihedral = 109.47122; n = 3; intersection(){ box(size); intersection_for(i=[1:n]) { rotate([dihedral, 0, 360 /n * i]) box(size); } } } module truncated_octa(side) { intersection() { rotate([125, 0, 45]) octahedron(side); cube(size=side*1.15, center=true);} } module hollow(side) { difference() { truncated_octa(5); % truncated_octa(4); }} difference () { //hollow(4); truncated_octa(5); // union() { truncated_octa(4); translate([2,2,2]) rotate([0,60, 45]) hexagon(3, 4); translate([-2,-2,2]) rotate([0,50, 180+45]) hexagon(3, 4); translate([-2,2,1.75]) rotate([0,69, 90+45]) hexagon(3, 4); translate([2,-2,1.75]) rotate([0,69, 90+180+45]) hexagon(3, 4); rotate([0,0,45]) translate([0,0,3])cube([1.5, 1.5, 1.5], center = true); rotate([90,45,90]) cube([1.5, 1.5, 6], center = true); rotate([90,45,180]) cube([1.5, 1.5, 6], center = true); } } //rotate([90,45,180]) cube([1.5, 1.5, 6], center = true); //rotate([90,45,90]) cube([1.5, 1.5, 6], center = true); //translate([2,-2,1.75]) rotate([0,69, 90+180+45]) hexagon(3, 4); //rotate([0,0,45]) translate([0,0,3]) box(.75); //translate([-2,2,1.75]) rotate([0,69, 90+45]) hexagon(3, 4); //translate([5,5,5]) truncated_octa(3); // size is the XY plane size, height in Z module dodecagon(size, height) { intersection() { hexagon(size, height); rotate([0,0,90]) hexagon(size, height); } } //octahedron(3); //rotate([0, 90, 0]) dodecagon(2, 2); /* Truncated octahedron. */ module truncocta() { // octahedron based on code by Willliam A Adams octapoints = [ [+1, 0, 0], // + x axis [-1, 0, 0], // - x axis [0, +1, 0], // + y axis [0, -1, 0], // - y axis [0, 0, +1], // + z axis [0, 0, -1] // - z axis ]; octafaces = [ [4,2,0],[4,0,3],[4,3,1],[4,1,2],[5,0,2],[5,3,0],[5,1,3], [5,2,1] ]; intersection() { scale(v=3) { polyhedron(points=octapoints,triangles=octafaces); } % cube(size=4,center=true); } } //truncocta(); //translate([4,4,4]) { truncocta(); }