aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElena of Valhalla'' Grandi <valhalla@trueelena.org>2014-03-08 22:06:26 +0100
committerElena of Valhalla'' Grandi <valhalla@trueelena.org>2014-03-08 22:06:26 +0100
commit4828fc7979470f5b920152e748ebd512d8b911f2 (patch)
tree1fdb909a034749f1a401b4e4a8bec44ed70ddd85 /src
parent26ddc474e28572f4895afb09b59e31ff3a788931 (diff)
Improved dice
Diffstat (limited to 'src')
-rw-r--r--src/die.scad3
-rw-r--r--src/piecepack.scad50
-rw-r--r--src/suite_die.scad3
3 files changed, 35 insertions, 21 deletions
diff --git a/src/die.scad b/src/die.scad
index 7e53cb0..8a7acd8 100644
--- a/src/die.scad
+++ b/src/die.scad
@@ -1,5 +1,6 @@
use <piecepack.scad>;
suite="arms";
+s=12;
-die(suite);
+die(suite,s);
diff --git a/src/piecepack.scad b/src/piecepack.scad
index 0947862..33406a3 100644
--- a/src/piecepack.scad
+++ b/src/piecepack.scad
@@ -35,43 +35,55 @@ module coin(suite,value) {
}
}
-module die(suite) {
+module die(suite,s) {
difference() {
- cube(12);
- translate([0,0,11]) linear_extrude(height=1.5) scale(0.24)
+ intersection() {
+ cube(s);
+ translate([s/2,s/2,s/2]) sphere(r=s*0.79);
+ }
+ translate([0,0,s-1]) linear_extrude(height=1.5) scale(s*0.02)
import(str("../graphics/",suite,".dxf"));
translate([1,0,0]) rotate([0,-90,0])
- linear_extrude(height=1.5) scale(0.24)
+ linear_extrude(height=1.5) scale(s*0.02)
import("../graphics/2.dxf");
- translate([11,0,12]) rotate([0,90,0])
- linear_extrude(height=1.5) scale(0.24)
+ translate([s-1,0,s]) rotate([0,90,0])
+ linear_extrude(height=1.5) scale(s*0.02)
import("../graphics/5.dxf");
translate([0,1,0]) rotate([90,0,0])
- linear_extrude(height=1.5) scale(0.24)
+ linear_extrude(height=1.5) scale(s*0.02)
import("../graphics/3.dxf");
- translate([0,11,12]) rotate([-90,0,0])
- linear_extrude(height=1.5) scale(0.24)
+ translate([0,s-1,s]) rotate([-90,0,0])
+ linear_extrude(height=1.5) scale(s*0.02)
import("../graphics/4.dxf");
}
}
-module suite_die(suites) {
+module suite_die(suites,s) {
difference() {
- cube(12);
- translate([0,0,11]) linear_extrude(height=1.5) scale(0.24)
- import("../graphics/ace.dxf");
+ cube(s);
translate([1,0,0]) rotate([0,-90,0])
- linear_extrude(height=1.5) scale(0.24)
+ linear_extrude(height=1.5) scale(s*0.02)
import(str("../graphics/",suites[0],".dxf"));
- translate([11,0,12]) rotate([0,90,0])
- linear_extrude(height=1.5) scale(0.24)
+ translate([s-1,0,s]) rotate([0,90,0])
+ linear_extrude(height=1.5) scale(s*0.02)
import(str("../graphics/",suites[1],".dxf"));
translate([0,1,0]) rotate([90,0,0])
- linear_extrude(height=1.5) scale(0.24)
+ linear_extrude(height=1.5) scale(s*0.02)
import(str("../graphics/",suites[2],".dxf"));
- translate([0,11,12]) rotate([-90,0,0])
- linear_extrude(height=1.5) scale(0.24)
+ translate([0,s-1,s]) rotate([-90,0,0])
+ linear_extrude(height=1.5) scale(s*0.02)
import(str("../graphics/",suites[3],".dxf"));
+ if ( len(suites) >= 5) {
+ translate([0,0,s-1]) linear_extrude(height=1.5) scale(s*0.02)
+ import(str("../graphics/",suites[4],".dxf"));
+ } else {
+ translate([0,0,s-1]) linear_extrude(height=1.5) scale(s*0.02)
+ import("../graphics/ace.dxf");
+ }
+ if ( len(suites) >= 6) {
+ translate([0,0,-0.5]) linear_extrude(height=1.5) scale(s*0.02)
+ import(str("../graphics/",suites[5],".dxf"));
+ }
}
}
diff --git a/src/suite_die.scad b/src/suite_die.scad
index 272875c..ed7b723 100644
--- a/src/suite_die.scad
+++ b/src/suite_die.scad
@@ -1,5 +1,6 @@
use <piecepack.scad>;
suites=["suns","moons","crowns","arms"];
+s=12;
-suite_die(suites);
+suite_die(suites,s);