From 5a38c3a05ecc31b9ffabe9483002e7c4fa14cb08 Mon Sep 17 00:00:00 2001 From: Elena of Valhalla'' Grandi Date: Tue, 4 Mar 2014 20:58:14 +0100 Subject: Pyramids --- Makefile | 16 +++++++++++++++- src/piecepack.scad | 23 +++++++++++++++++++++++ src/pyramid.scad | 6 ++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/pyramid.scad diff --git a/Makefile b/Makefile index dcf3403..f394ddc 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,20 @@ saucers: -D suite=\"$$SUITE\" src/saucer.scad; \ done +pyramids: + mkdir -p ${DESTDIR} + for SUITE in ${SUITES}; do \ + for VALUE in ${VALUES}; do \ + for S in "25 45" "20 35" "14 25"; do \ + W=`echo $$S | cut -d' ' -f 1`; \ + H=`echo $$S | cut -d' ' -f 2`; \ + openscad -o ${DESTDIR}/pyramid-$${W}x$$H-$$SUITE-$$VALUE.stl \ + -D suite=\"$$SUITE\" -D value=\"$$VALUE\" \ + -D w=$$W -D h=$$H src/pyramid.scad; \ + done \ + done \ + done + gcode: tiles coins dice saucers for T in ${DESTDIR}/tile*.stl; do \ ${SLIC3R} --load ${CONFDIR}/tiles.ini $$T; \ @@ -60,4 +74,4 @@ gcode: tiles coins dice saucers ${SLIC3R} --load ${CONFDIR}/dice.ini $$T; \ done -all: tiles coins dice pawns saucers +all: tiles coins dice pawns saucers pyramids diff --git a/src/piecepack.scad b/src/piecepack.scad index ef8806b..b35c6ad 100644 --- a/src/piecepack.scad +++ b/src/piecepack.scad @@ -93,3 +93,26 @@ module saucer(suite) { } } +module plain_pyramid(w,h,z) { + polyhedron(points=[[-w/2,-w/2,z], [w/2,-w/2,z], + [w/2,w/2,z], [-w/2,w/2,z], [z,z,h]], + triangles=[[0,1,2], [0,2,3], + [0,4,1], [1,4,2], [2,4,3], [3,4,0]]); +} + +module pyramid(w,h,suite,value) { + difference() { + plain_pyramid(w,h,0); + plain_pyramid(w-4,h-4,-0.01); + if ( suite != "null") { + translate([0,-w/2+1,0]) rotate([atan(h/(w/2)),0,0]) linear_extrude(height=2) + scale(0.9*w/50) translate([-25,0,0]) import(str("../graphics/",suite,".dxf")); + } + if ( value != "null") { + translate([0,w/2-1,0]) + rotate([-atan(h/(w/2)),0,0]) rotate([0,0,180]) linear_extrude(height=2) + scale(0.9*w/50) translate([-25,0,0]) import(str("../graphics/",value,".dxf")); + } + } +} + diff --git a/src/pyramid.scad b/src/pyramid.scad new file mode 100644 index 0000000..47850ca --- /dev/null +++ b/src/pyramid.scad @@ -0,0 +1,6 @@ +use ; + +suite="arms"; +value="ace"; + +pyramid(25,45,suite,value); -- cgit v1.2.3