diff options
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | README.rst | 8 | ||||
-rw-r--r-- | src/die.scad | 3 | ||||
-rw-r--r-- | src/piecepack.scad | 50 | ||||
-rw-r--r-- | src/suite_die.scad | 3 |
6 files changed, 63 insertions, 29 deletions
@@ -5,9 +5,13 @@ CONFDIR=conf SLIC3R=~/opt/Slic3r/bin/slic3r SUITES=suns moons crowns arms -#SUITES=clubs diamonds hearts spades +#SUITES=suns moons crowns arms # Basic piecepack +SUITES=clubs diamonds hearts spades # Playing cards expansion VALUES=null ace 2 3 4 5 +all: tiles coins dice pawns saucers pyramids +.PHONY : all + tiles: mkdir -p ${DESTDIR} for SUITE in ${SUITES}; do \ @@ -29,11 +33,16 @@ coins: dice: mkdir -p ${DESTDIR} for SUITE in ${SUITES}; do \ - openscad -o ${DESTDIR}/die-$$SUITE.stl \ - -D suite=\"$$SUITE\" src/die.scad; \ + for S in 12 16; do \ + openscad -o ${DESTDIR}/die-$$SUITE-$$S.stl \ + -D suite=\"$$SUITE\" -D s=$$S src/die.scad; \ + done \ + done + for S in 12 16; do \ + openscad -o ${DESTDIR}/suite_die-$$S.stl \ + -D suite='["'`echo ${SUITES} | sed 's/ /","/g'`'"]' \ + -D s-$$S src/suite_die.scad; \ done - openscad -o ${DESTDIR}/suite_die.stl \ - -D suite='["'`echo ${SUITES} | sed 's/ /","/g'`'"]' src/suite_die.scad pawns: mkdir -p ${DESTDIR} @@ -77,4 +86,3 @@ gcode: tiles coins dice saucers pyramids ${SLIC3R} --load ${CONFDIR}/pyramids.ini $$T; \ done -all: tiles coins dice pawns saucers pyramids @@ -26,6 +26,12 @@ dependencies just run: from the root directory of this repository and wait. +If you want to print an expansion you can change the value of the +`SUITES` variable on line 7: decomment one of the options, or set it to +a combination of available suites. Note that the suite die expect at +least 4 suites, and if more are available they are printed instead of +the ace and null values. + Example settings for [Slic3r](http://slic3r.org/) are available in the conf directory: you can load them in Slic3r, change the settings (expecially those related to the printer) and re-export them in place. @@ -56,7 +62,7 @@ and is included in the repo for the benefit of gitorious. License ------- -OpenSCAD code and SVG artwork Copyright 2013 Elena Grandi +OpenSCAD code and SVG artwork Copyright 2013-2014 Elena Grandi This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit @@ -30,6 +30,12 @@ dependencies just run:: from the root directory of this repository and wait. +If you want to print an expansion you can change the value of the +``SUITES`` variable on line 7: decomment one of the options, or +set it to a combination of available suites. +Note that the suite die expect at least 4 suites, and if more are +available they are printed instead of the ace and null values. + Example settings for Slic3r_ are available in the conf directory: you can load them in Slic3r, change the settings (expecially those related to the printer) and re-export them in place. @@ -66,7 +72,7 @@ and is included in the repo for the benefit of gitorious. License ------- -OpenSCAD code and SVG artwork Copyright 2013 Elena Grandi +OpenSCAD code and SVG artwork Copyright 2013-2014 Elena Grandi This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit 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); |