diff --git a/.helperHerosKeepOut.sh b/.helperHerosKeepOut.sh index b1d7533..7792287 100755 --- a/.helperHerosKeepOut.sh +++ b/.helperHerosKeepOut.sh @@ -16,6 +16,6 @@ while IFS=',' read -r b t h name; do -D "b=$b" \ -D "t=$t" \ -D "h=$h" \ - -D "text_label=\"$name\"" \ + -D "name=\"$name\"" \ -o "$output" "$SCAD_FILE" -done <./HeroesKeepOut/.cardConfigs.txt +done <./HeroesKeepOut/cardConfigs.txt diff --git a/CardHolder.scad b/CardHolder.scad index b20613f..c24f7e5 100644 --- a/CardHolder.scad +++ b/CardHolder.scad @@ -2,57 +2,84 @@ include // Parameter for console overwrite b = 58; -t = 14; +t = 3; h = 88; name = "Cards"; -module cardHolder(b,t,h,name){ +module cardHolder(b, t, h, name) { - // floor - cube([b+4,t+4,1],false); - - // left - translate([0,0,1]){ - cuboid([1,t+4,h+3], anchor=[-1,-1,-1], rounding=min(10,t+4), edges=FRONT+TOP); - } - - // right - translate([b+3,0,1]){ - cuboid([1,t+4,h+3], anchor=[-1,-1,-1], rounding=min(10,t+4), edges=FRONT+TOP); - } - - // back - translate([1,t+3,1]){ - cuboid([10,1,h+3], anchor=[-1,-1,-1], rounding=5, edges=RIGHT+TOP); - translate([b-8,0,0]) { - cuboid([10,1,h+3], anchor=[-1,-1,-1], rounding=5, edges=LEFT+TOP); - } - translate([10,0,0]) { - difference(){ - cube([b-18,1,h+3],false); - translate([0,-1,15]) { - cuboid([b-18,3,h-12], anchor=[-1,-1,-1], rounding=10, edges=[LEFT+BOTTOM,RIGHT+BOTTOM]); - } - } + // floor + bInner = b - 10; + tInner = t - 10; + if (bInner >= 6 && tInner >= 6) { + difference() { + cube([ b, t, 1.5 ], false); + bSpace = 5 + (((bInner + 2) % 8) / 2); + bAmount = (((bInner + 2) - bSpace + 5) / 8); + tSpace = 5 + (((tInner + 2) % 8) / 2); + tAmount = (((tInner + 2) - tSpace + 5) / 8); + for (i = [0:bAmount - 1], j = [0:tAmount - 1]) { + translate([ bSpace + i * 8, tSpace + j * 8, -1 ]) { + cube([ 6, 6, 3.5 ], false); } + } } + } else { + cube([ b, t, 1.5 ], false); + } - // front - translate([1,0,1]){ - difference(){ - cuboid([10,1,h-17], anchor=[-1,-1,-1], rounding=5, edges=RIGHT+TOP); - translate([7.5,0.4,2.5]){ - rotate([0,-90,90]){ - linear_extrude(height = 0.6) { - text(name, size = 5, font = "Arial:style=Bold"); - } - } - } - } - translate([b-8,0,0]) { - cuboid([10,1,h-17], anchor=[-1,-1,-1], rounding=5, edges=LEFT+TOP); - } + // left + translate([ 0, 0, 1.5 ]) { + cuboid([ 1.5, t, h - 1.5 ], anchor = [ -1, -1, -1 ], + rounding = min(10, t - 1.5), edges = FRONT + TOP); + } + + // right + translate([ b - 1.5, 0, 1.5 ]) { + cuboid([ 1.5, t, h - 1.5 ], anchor = [ -1, -1, -1 ], + rounding = min(10, t - 1.5), edges = FRONT + TOP); + } + + // back + translate([ 1.5, t - 1.5, 1.5 ]) { + cuboid([ 10, 1.5, h -1.5], anchor = [ -1, -1, -1 ], rounding = 5, + edges = RIGHT + TOP); + translate([ b - 13, 0, 0 ]) { + cuboid([ 10, 1.5, h - 1.5 ], anchor = [ -1, -1, -1 ], rounding = 5, + edges = LEFT + TOP); } + translate([ 10, 0, 0 ]) { + difference() { + difference() { + cube([ b - 23, 1.5, h - 1 ], false); + translate([ 0, -1, 15 ]) { + cuboid([ b - 23, 3, h - 12 ], anchor = [ -1, -1, -1 ], + rounding = 10, edges = [ LEFT + BOTTOM, RIGHT + BOTTOM ]); + } + } + translate([ -1, -1, 35 ]) { cube([ b - 21, 3, h - 20 ], false); } + } + } + } + + // front + translate([ 1, 0, 1 ]) { + difference() { + cuboid([ 10, 1.5, h - 21 ], anchor = [ -1, -1, -1 ], rounding = 5, + edges = RIGHT + TOP); + translate([ 7.5, 0.4, 2.5 ]) { + rotate([ 0, -90, 90 ]) { + linear_extrude(height = 0.6) { + text(name, size = 5, font = "Arial:style=Bold"); + } + } + } + } + translate([ b - 12, 0, 0 ]) { + cuboid([ 10, 1.5, h - 21 ], anchor = [ -1, -1, -1 ], rounding = 5, + edges = LEFT + TOP); + } + } } -cardHolder(b,t,h,name); +cardHolder(b + 5, t + 3, h + 4, name); diff --git a/HeroesKeepOut/.cardConfigs.txt b/HeroesKeepOut/.cardConfigs.txt deleted file mode 100644 index e66635d..0000000 --- a/HeroesKeepOut/.cardConfigs.txt +++ /dev/null @@ -1 +0,0 @@ -58,14,88,Test 123 diff --git a/HeroesKeepOut/cardConfigs.txt b/HeroesKeepOut/cardConfigs.txt new file mode 100644 index 0000000..f93de5d --- /dev/null +++ b/HeroesKeepOut/cardConfigs.txt @@ -0,0 +1,31 @@ +58,7,88,Träumer +58,6,88,Roter Drache +58,6,88,Hexen +58,6,88,Geister +58,6,88,Unholde +58,6,88,Echsenvolk +58,6,88,Skelette +58,6,88,Gnolle +58,6,88,Schleim +58,6,88,Rattenvolk +58,7,88,Geheim A +58,8,88,Geheim B +58,4,88,Geheim C +58,3,88,Geheim D +58,7,88,Geheim E +58,7,88,Geheim F +58,4,88,Geheim G +58,7,88,Geheim H +58,7,88,Geheim I +58,7,88,Geheim J +58,14,88,Geheim K +58,7,88,Geheim L +58,7,88,Geheim M +58,7,88,Geheim N +58,7,88,Geheim O +58,27,88,Beute +58,3,88,Geräte +58,14,88,Helden +58,13,88,Heldenklassen +58,50,88,Szenarien +58,44,88,Boss diff --git a/makefile b/makefile index a946de8..9b734be 100644 --- a/makefile +++ b/makefile @@ -3,5 +3,5 @@ HerosKeepOut: ./CardHolder.scad ./.helperHerosKeepOut.sh -clear: +clean: rm -r ./STL