From f9d5958260bb6168faeea051ba0f901a9fe1824c Mon Sep 17 00:00:00 2001 From: Elena of Valhalla'' Grandi Date: Sun, 22 Jun 2014 10:46:28 +0200 Subject: New source layout; added d6 and pips faces --- lib/dice.scad | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/dice.scad (limited to 'lib/dice.scad') diff --git a/lib/dice.scad b/lib/dice.scad new file mode 100644 index 0000000..c3cab85 --- /dev/null +++ b/lib/dice.scad @@ -0,0 +1,20 @@ +module d6(side=false, size=false) { + l = side ? side : size; + if (l == false) { + echo("ERROR: d6: one of side or size should be defined"); + } + echo(l); + difference() { + intersection() { + cube(l, center=true); + sphere(l*0.79); + } + translate([0, 0, l/2]) child(0); + rotate([90, 0, 0]) translate([0, 0, l/2]) child(1); + rotate([0, 90, 0]) translate([0, 0, l/2]) child(2); + rotate([-90, 0, 0]) translate([0, 0, l/2]) child(3); + rotate([0, -90, 0]) translate([0, 0, l/2]) child(4); + rotate([180, 0, 0]) translate([0, 0, l/2]) child(5); + } +} + -- cgit v1.2.3