Files
BoardGameInlets/Box.scad
Elias Schröter bd6ea68d9a format&heroes
cleanup the formaat and make heroes box
2026-04-29 15:45:31 +02:00

74 lines
1.5 KiB
OpenSCAD

include <BOSL2/std.scad>
// Parameter for console overwrite
b = 30.0;
t = 30.0;
h = 20.0;
module box(b, t, h) {
difference() {
// base
cuboid(
[ b, t, h - 2],
anchor = [ -1, -1, -1 ],
rounding = 1,
edges = [
TOP,
FRONT + LEFT,
FRONT + RIGHT,
BACK + LEFT,
BACK + RIGHT
]
);
// inner
translate([ 5, 1.5, 1.5 ]) cuboid(
[ b - 10, t - 3, h - 0.5 ],
anchor = [ -1, -1, -1 ],
rounding = 8,
edges = [
BOTTOM + FRONT,
BOTTOM + LEFT,
BOTTOM + BACK,
BOTTOM + RIGHT,
FRONT + LEFT,
FRONT + RIGHT,
BACK + LEFT,
BACK + RIGHT
]
);
sideCut(t); // left lower
translate([0, 0, h - 2]) mirror([0, 0, 1]) sideCut(t); // left upper
translate([b, 0, 0]) mirror([1, 0, 0]) sideCut(t); // right lower
translate([b, 0, h - 2]) mirror([1, 0, 0]) mirror([0, 0, 1]) sideCut(t); // right upper
}
}
module sideCut(t) {
translate([0,-1,0]) rotate([-90,-90,0]) linear_extrude(t/4+4) polygon(points=[
[-1,-1],
[-1,2.1],
[3.05, 2.1],
[6.35,-1]
]);
difference() {
translate([0,t/4+2,0]) rotate([-90,-90,0]) linear_extrude(0.75 * t) polygon(points=[
[-1,-1],
[-1,3.45],
[7.15, 3.45],
[11.45,-1]
]);
translate([2.45,0.75 * t - 2.4, 0]) rotate([90,-90,0]) linear_extrude(0.4 * t + 5) polygon(points=[
[-1,-1],
[-1,0.35],
[3.05, 0.35],
[4.65,-1]
]);
}
}
box(b, t, h);