fix figure boxes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
38,33,31.5,Geister
|
33,31,29,Geister
|
||||||
29,83,26.5,Pilze
|
26,82,25,Pilzknilche
|
||||||
38,53,27,Spinne
|
36,51,27,Spinnen
|
||||||
51,45,33.5,Werwolf
|
45,52,34,Werwolf
|
||||||
55,25,35.5,Vampir
|
21,53,35,Vampir
|
||||||
|
|||||||
73
HeroesKeepOut/Box-Figure.scad
Normal file
73
HeroesKeepOut/Box-Figure.scad
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
include <BOSL2/std.scad>
|
||||||
|
|
||||||
|
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"
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user