format&heroes

cleanup the formaat and make heroes box
This commit is contained in:
2026-04-29 15:45:31 +02:00
parent 6c4deab335
commit bd6ea68d9a
9 changed files with 263 additions and 348 deletions

107
Box.scad
View File

@@ -3,82 +3,71 @@ include <BOSL2/std.scad>
// Parameter for console overwrite
b = 30.0;
t = 30.0;
h = 30.0;
h = 20.0;
module box(b, t, h) {
difference() {
// base
cuboid(
[ b, t, h],
[ b, t, h - 2],
anchor = [ -1, -1, -1 ],
rounding = 1,
edges = [ TOP, FRONT + LEFT, FRONT + RIGHT, BACK + LEFT, BACK + RIGHT ]
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 ]
);
}
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
]
);
// left lower
sideCut(b,t);
// left upper
translate([0, 0, h]) {
mirror([0, 0, 1]) {
sideCut(b, t);
}
}
// right lower
translate([b, 0, 0]) {
mirror([1, 0, 0]) {
sideCut(b,t);
}
}
// right upper
translate([b, 0, h]) {
mirror([1, 0, 0]) {
mirror([0, 0, 1]) {
sideCut(b, t);
}
}
}
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(b,t) {
translate([0,-1,0]) {
rotate([-90,-90,0]) {
linear_extrude(t/4+4) {
polygon(points=[[-1,-1], [-1,1.85], [3.35, 1.85], [6.35,-1]]);
}
}
}
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([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]]);
}
}
}
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 - 2);
box(b, t, h);