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 --- designs/pips_d12.scad | 22 ++++++++++++++++++++++ lib/dice.scad | 33 +++++++++++++++++++++++++++++++++ lib/utils.scad | 2 ++ 3 files changed, 57 insertions(+) create mode 100644 designs/pips_d12.scad diff --git a/designs/pips_d12.scad b/designs/pips_d12.scad new file mode 100644 index 0000000..6f5e510 --- /dev/null +++ b/designs/pips_d12.scad @@ -0,0 +1,22 @@ +use <../lib/dice.scad> +use <../lib/utils.scad> +use <../lib/faces/pips.scad> + +size = 16; + +side = s2s_d12(size); + +rotate([180, 0, 0]) d12(size) { + pips_1(side); + pips_2(side); + pips_3(side); + pips_4(side); + pips_5(side); + pips_6(side); + pips_1(side); + pips_2(side); + pips_3(side); + pips_4(side); + pips_5(side); + pips_6(side); +} 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); + } +} diff --git a/lib/utils.scad b/lib/utils.scad index c1b62dd..7661b2f 100644 --- a/lib/utils.scad +++ b/lib/utils.scad @@ -7,3 +7,5 @@ function s2s_d6(size) = size; function s2s_d8(size) = circ_rad(size)*2/sqrt(2); +function s2s_d12(size) = circ_rad(size)*4/(sqrt(3)*(1+sqrt(5))); + -- cgit v1.2.3