From 2b9dfde03d56d6298cd168175a9fa8db13eb4a63 Mon Sep 17 00:00:00 2001 From: Elena of Valhalla'' Grandi Date: Sun, 17 Nov 2013 10:08:30 +0100 Subject: Generation of tiles via Makefile --- Makefile | 12 ++++++++++++ models/tiles.scad | 20 -------------------- src/piecepack.scad | 21 +++++++++++++++++++++ src/tile.scad | 6 ++++++ 4 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 Makefile delete mode 100644 models/tiles.scad create mode 100644 src/piecepack.scad create mode 100644 src/tile.scad diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dd0ffe6 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ + +DESTDIR=build + +tiles: + mkdir -p ${DESTDIR} + for SUITE in suns moons crowns arms; do \ + for VALUE in null ace 2 3 4 5; do \ + openscad -o ${DESTDIR}/tile-$$SUITE-$$VALUE.stl \ + -D suite=\"$$SUITE\" -D value=\"$$VALUE\" src/tile.scad; \ + done \ + done + diff --git a/models/tiles.scad b/models/tiles.scad deleted file mode 100644 index f325d1d..0000000 --- a/models/tiles.scad +++ /dev/null @@ -1,20 +0,0 @@ - -suite="arms"; -value="arms"; - -module tile(suite,value) { - union() { - difference(){ - translate([0,0,0.4]) cube([50,50,4.6]); - translate([0,0,4]) linear_extrude(height=2) - import(str("../graphics/",value,".dxf")); - translate([2,38,4]) linear_extrude(height=2) scale(0.2) import(str("../graphics/",suite,".dxf")); - } - cube([24.5,24.5,1]); - translate([25.5,0,0]) cube([24.5,24.5,1]); - translate([0,25.5,0]) cube([24.5,24.5,1]); - translate([25.5,25.5,0]) cube([24.5,24.5,1]); - } -} - -tile(suite,value); diff --git a/src/piecepack.scad b/src/piecepack.scad new file mode 100644 index 0000000..0af95e5 --- /dev/null +++ b/src/piecepack.scad @@ -0,0 +1,21 @@ + +module tile(suite,value) { + union() { + difference(){ + translate([0,0,0.4]) cube([50,50,4.6]); + if (value == "ace") { + translate([0,0,4]) linear_extrude(height=2) + import(str("../graphics/",suite,".dxf")); + } else if (value != "null") { + translate([0,0,4]) linear_extrude(height=2) + import(str("../graphics/",value,".dxf")); + } + translate([2,38,4]) linear_extrude(height=2) scale(0.2) import(str("../graphics/",suite,".dxf")); + } + cube([24.5,24.5,1]); + translate([25.5,0,0]) cube([24.5,24.5,1]); + translate([0,25.5,0]) cube([24.5,24.5,1]); + translate([25.5,25.5,0]) cube([24.5,24.5,1]); + } +} + diff --git a/src/tile.scad b/src/tile.scad new file mode 100644 index 0000000..b168051 --- /dev/null +++ b/src/tile.scad @@ -0,0 +1,6 @@ +use ; + +suite="arms"; +value="ace"; + +tile(suite,value); -- cgit v1.2.3