From a91812def9c8c0292e6fb47985e869078fdb5fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20Schr=C3=B6ter?= Date: Thu, 7 May 2026 15:15:36 +0200 Subject: [PATCH] fix figure boxes --- HeroesKeepOut/Box-Figure-Configs.txt | 10 ++-- HeroesKeepOut/Box-Figure.scad | 73 ++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 HeroesKeepOut/Box-Figure.scad diff --git a/HeroesKeepOut/Box-Figure-Configs.txt b/HeroesKeepOut/Box-Figure-Configs.txt index b92c645..ed612e4 100644 --- a/HeroesKeepOut/Box-Figure-Configs.txt +++ b/HeroesKeepOut/Box-Figure-Configs.txt @@ -1,5 +1,5 @@ -38,33,31.5,Geister -29,83,26.5,Pilze -38,53,27,Spinne -51,45,33.5,Werwolf -55,25,35.5,Vampir +33,31,29,Geister +26,82,25,Pilzknilche +36,51,27,Spinnen +45,52,34,Werwolf +21,53,35,Vampir diff --git a/HeroesKeepOut/Box-Figure.scad b/HeroesKeepOut/Box-Figure.scad new file mode 100644 index 0000000..6647e28 --- /dev/null +++ b/HeroesKeepOut/Box-Figure.scad @@ -0,0 +1,73 @@ +include + +x = 28; +y = 29; +z = 28; +name = "Figure"; + +figureBox(x + 3, y + 3, z + 1.5, name); + +module figureBox(x, y, z, name) { + difference() { + cube([ x, y, z ], false); + translate([ 1.5, 1.5, 1.5 ]) cube([ x - 3, y - 3, z - 1 ], false); + + // windows + window(x / 2, y, z, name, ""); + + // floor + xInner = x - 10; + yInner = y - 10; + + if (xInner >= 6 && yInner >= 6) { + xSpace = 5 + (((xInner + 2) % 8) / 2); + xAmount = (((xInner + 2) - xSpace + 5) / 8); + ySpace = 5 + (((yInner + 2) % 8) / 2); + yAmount = (((yInner + 2) - ySpace + 5) / 8); + + for (i = [0:xAmount - 1], j = [0:yAmount - 1]) translate([ xSpace + i * 8, ySpace + j * 8, -1 ]) cube([ 6, 6, 3.5 ], false); + } + } +} + +module window(x, y, z, frontName, backName) { + windowHelper(x, 0, z, frontName); + zrot(180, cp=[x, y / 2, 0]) windowHelper(x, 0, z, backName); +} + +module windowHelper(x, y, z, name) { + translate([ 7, y - 1, 8 ]) cuboid( + [ 2 * (x - 7), 3.5, z - 8 ], + anchor = [-1, -1, -1], + rounding = 3, + edges = [ + BOTTOM + LEFT, + BOTTOM + RIGHT + ] + ); + + difference() { + translate([ 1.5, y - 1, z - 5 ]) cube([ 2 * (x - 1.5), 3.5, 6 ], false); + translate([ 1, y - 1, z - 6 ]) cuboid( + [ 6, 3.5 , 6 ], + anchor = [-1, -1, -1], + rounding = 5, + edges = TOP + RIGHT + ); + + translate([ 2 * x - 7, y - 1, z - 6 ]) cuboid( + [ 6, 3.5 , 6 ], + anchor = [-1, -1, -1], + rounding = 5, + edges = TOP + LEFT + ); + } + + translate([ x, y + 0.6, 4 ]) rotate([ 90, 0, 0 ]) linear_extrude(height = 1.6) text( + name, + size = 4, + font = "Arial:style=Bold", + halign="center", + valign="center" + ); +}