aboutsummaryrefslogtreecommitdiff
path: root/lib/dice.scad
diff options
context:
space:
mode:
authorElena of Valhalla'' Grandi <valhalla@trueelena.org>2014-06-22 10:46:28 +0200
committerElena of Valhalla'' Grandi <valhalla@trueelena.org>2014-06-22 10:46:28 +0200
commitf9d5958260bb6168faeea051ba0f901a9fe1824c (patch)
treef6912fd715449583bb0f5090b8a9ab70bbadbddd /lib/dice.scad
parent3383067cf5958242bff20bf998789106ed3f7a49 (diff)
New source layout; added d6 and pips faces
Diffstat (limited to 'lib/dice.scad')
-rw-r--r--lib/dice.scad20
1 files changed, 20 insertions, 0 deletions
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);
+ }
+}
+