From e96a2cdf57e0d576b3ca4d7d9186ae879a677c36 Mon Sep 17 00:00:00 2001 From: Elena of Valhalla'' Grandi Date: Sun, 22 Jun 2014 17:24:50 +0200 Subject: d12: new die --- lib/dice.scad | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'lib/dice.scad') diff --git a/lib/dice.scad b/lib/dice.scad index e87bbb6..d42d1ea 100644 --- a/lib/dice.scad +++ b/lib/dice.scad @@ -69,3 +69,36 @@ module d8(size=false, side=false) { rotate([180, 0, 0]) translate([0, 0, i_r]) child(0); } } + +module d12(size=false, side=false) { + l = side ? side : s2s_d12(size); + if (l == false) { + echo("ERROR: d12: one of side or size should be defined"); + } + r = l*sqrt(3)*(1+sqrt(5))/4; + c = r*2; + i_r = (l/2)*sqrt(5/2 + 11*sqrt(5)/10); + difference() { + intersection() { + sphere(r*0.96, $fn=64); + cube([c, c, i_r*2], center=true); + intersection_for ( i = [0:4] ) { + + rotate([0, 0, 72*i]) rotate([acos(-1/sqrt(5)), 0, 0]) cube([c, c, i_r*2], center=true); + } + } + translate([0, 0, i_r]) child(0); + rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) child(1); + rotate([0, 0, 72]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) child(3); + rotate([0, 0, 144]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) child(5); + rotate([0, 0, 216]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) child(4); + rotate([0, 0, 288]) rotate([acos(-1/sqrt(5))+180, 0, 0]) translate([0, 0, i_r]) child(2); + + rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) child(10); + rotate([0, 0, 72]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) child(8); + rotate([0, 0, 144]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) child(6); + rotate([0, 0, 216]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) child(7); + rotate([0, 0, 288]) rotate([acos(-1/sqrt(5)), 0, 0]) translate([0, 0, i_r]) child(9); + rotate([180, 0, 0]) translate([0, 0, i_r]) child(11); + } +} -- cgit v1.2.3