Files
BoardGameInlets/HeroesKeepOut/Box-Figure-Big.scad
Elias Schröter 17f110f2bd Color
adapt design to have text in second color
2026-05-20 10:41:04 +02:00

103 lines
2.7 KiB
OpenSCAD

include <BOSL2/std.scad>
use <../Color.scad>
boxHelper(45, 39, 53, "Drache", "Gorgone", "Träumer");
translate([ 91.5, 39, 0 ]) zrot(180, cp=[0, 0, 0]) boxHelper(48, 39, 53, "Sensenmann", "Steintroll", "König Schleim");
module boxHelper(x, y, z, frontName, middleName, backName) {
makeColor("yellow") 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, frontName, backName);
// 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);
}
translate([ 1, y / 2, z / 2 ]) rotate([ 0, -90, 0 ]) linear_extrude(height = 1.2) text(
middleName,
size = 4,
font = "Arial:style=Bold",
halign="center"
);
}
makeColor("white") {
translate([ x / 2, 1, 4 ]) rotate([ 90, 0, 0 ]) linear_extrude(height = 0.2) text(
frontName,
size = 4,
font = "Arial:style=Bold",
halign="center",
valign="center"
);
translate([ 1, y / 2, z / 2 ]) rotate([ 0, -90, 0 ]) linear_extrude(height = 0.2) text(
middleName,
size = 4,
font = "Arial:style=Bold",
halign="center"
);
zrot(180, cp=[ x / 2, y / 2, 0 ]) translate([ x / 2, 1, 4 ]) rotate([ 90, 0, 0 ]) linear_extrude(height = 0.2) text(
backName,
size = 4,
font = "Arial:style=Bold",
halign="center",
valign="center"
);
}
}
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 + 1, 4 ]) rotate([ 90, 0, 0 ]) linear_extrude(height = 1.2) text(
name,
size = 4,
font = "Arial:style=Bold",
halign="center",
valign="center"
);
}