restyle code

This commit is contained in:
2026-05-07 14:53:47 +02:00
parent 2074bd832e
commit 961793c975
8 changed files with 59 additions and 67 deletions

View File

@@ -20,8 +20,8 @@ echo "Rendering Box-Figures-Heroes..."
echo "Rendering Box-Figures-Big..." echo "Rendering Box-Figures-Big..."
"$OPENSCAD" -o "$FOLDER/Box/Box-Figure-Big.stl" "./HeroesKeepOut/Box-Figure-Big.scad" "$OPENSCAD" -o "$FOLDER/Box/Box-Figure-Big.stl" "./HeroesKeepOut/Box-Figure-Big.scad"
echo "Rendering Box-Figures-Monster-1..." echo "Rendering Box-Figures-Monsters..."
"$OPENSCAD" -o "$FOLDER/Box/Box-Figure-Monster-1.stl" "./HeroesKeepOut/Box-Figure-Monster-1.scad" "$OPENSCAD" -o "$FOLDER/Box/Box-Figure-Monsters.stl" "./HeroesKeepOut/Box-Figure-Monsters.scad"
SCAD_FILE="./HeroesKeepOut/Box-Figure.scad" SCAD_FILE="./HeroesKeepOut/Box-Figure.scad"
while IFS=',' read -r x y z name; do while IFS=',' read -r x y z name; do

View File

@@ -1,36 +1,38 @@
include <BOSL2/std.scad> include <BOSL2/std.scad>
// Parameter for console overwrite // Parameter for console overwrite
b = 30.0; x = 30.0;
t = 30.0; y = 30.0;
module lid(b, t) { boxLid(x, y);
bInner = b - 10;
tInner = t - 10;
if (bInner >= 6 && tInner >= 6) { module boxLid(x, y) {
xInner = x - 10;
yInner = y - 10;
if (xInner >= 6 && yInner >= 6) {
difference() { difference() {
cube([ b, t, 2 ], false); cube([ x, y, 2 ], false);
bSpace = 5 + (((bInner + 2) % 8) / 2); xSpace = 5 + (((xInner + 2) % 8) / 2);
bAmount = (((bInner + 2) - bSpace + 5) / 8); xAmount = (((xInner + 2) - xSpace + 5) / 8);
tSpace = 5 + (((tInner + 2) % 8) / 2); ySpace = 5 + (((yInner + 2) % 8) / 2);
tAmount = (((tInner + 2) - tSpace + 5) / 8); yAmount = (((yInner + 2) - ySpace + 5) / 8);
for (i = [0:bAmount - 1], j = [0:tAmount - 1]) translate([ bSpace + i * 8, tSpace + j * 8, -1 ]) cube([ 6, 6, 3.5 ], false); for (i = [0:xAmount - 1], j = [0:yAmount - 1]) translate([ xSpace + i * 8, ySpace + j * 8, -1 ]) cube([ 6, 6, 3.5 ], false);
} }
} else cube([ b, t, 2 ], false); } else cube([ x, y, 2 ], false);
sideCut(b,t); sideCut(y);
translate([b, 0, 0]) mirror([1, 0, 0]) sideCut(b,t); translate([ x, 0, 0 ]) mirror([ 1, 0, 0 ]) sideCut(y);
} }
module sideCut(b,t) { module sideCut(y) {
difference() { difference() {
translate([0,0,2]) cube([3, 0.75 * t - 2.5,6.6], false); translate([0,0,2]) cube([3, 0.75 * y - 2.5,6.6], false);
translate([2.3,t/4+2,0.5]) rotate([-90,-90,0]) linear_extrude(0.5 * t) polygon(points=[ translate([2.3,y/4+2,0.5]) rotate([-90,-90,0]) linear_extrude(0.5 * y) polygon(points=[
[-1,-1], [-1,-1],
[-1,1], [-1,1],
[7, 1], [7, 1],
@@ -38,7 +40,5 @@ module sideCut(b,t) {
]); ]);
} }
translate([0,0,2]) cube([1.4, t, 3.4], false); translate([0,0,2]) cube([1.4, y, 3.4], false);
} }
lid(b, t);

View File

@@ -1,15 +1,17 @@
include <BOSL2/std.scad> include <BOSL2/std.scad>
// Parameter for console overwrite // Parameter for console overwrite
b = 30.0; x = 30.0;
t = 30.0; y = 30.0;
h = 20.0; z = 20.0;
module box(b, t, h) { box(x, y, z);
module box(x, y, z) {
difference() { difference() {
// base // base
cuboid( cuboid(
[ b, t, h - 2], [ x, y, z - 2],
anchor = [ -1, -1, -1 ], anchor = [ -1, -1, -1 ],
rounding = 1, rounding = 1,
edges = [ edges = [
@@ -23,7 +25,7 @@ module box(b, t, h) {
// inner // inner
translate([ 5, 1.5, 1.5 ]) cuboid( translate([ 5, 1.5, 1.5 ]) cuboid(
[ b - 10, t - 3, h - 0.5 ], [ x - 10, y - 3, z - 0.5 ],
anchor = [ -1, -1, -1 ], anchor = [ -1, -1, -1 ],
rounding = 8, rounding = 8,
edges = [ edges = [
@@ -38,15 +40,15 @@ module box(b, t, h) {
] ]
); );
sideCut(t); // left lower sideCut(y); // left lower
translate([0, 0, h - 2]) mirror([0, 0, 1]) sideCut(t); // left upper translate([0, 0, z - 2]) mirror([0, 0, 1]) sideCut(y); // left upper
translate([b, 0, 0]) mirror([1, 0, 0]) sideCut(t); // right lower translate([x, 0, 0]) mirror([1, 0, 0]) sideCut(y); // right lower
translate([b, 0, h - 2]) mirror([1, 0, 0]) mirror([0, 0, 1]) sideCut(t); // right upper translate([x, 0, z - 2]) mirror([1, 0, 0]) mirror([0, 0, 1]) sideCut(y); // right upper
} }
} }
module sideCut(t) { module sideCut(y) {
translate([0,-1,0]) rotate([-90,-90,0]) linear_extrude(t/4+4) polygon(points=[ translate([0,-1,0]) rotate([-90,-90,0]) linear_extrude(y/4+4) polygon(points=[
[-1,-1], [-1,-1],
[-1,2.1], [-1,2.1],
[3.05, 2.1], [3.05, 2.1],
@@ -54,14 +56,14 @@ module sideCut(t) {
]); ]);
difference() { difference() {
translate([0,t/4+2,0]) rotate([-90,-90,0]) linear_extrude(0.75 * t) polygon(points=[ translate([0,y/4+2,0]) rotate([-90,-90,0]) linear_extrude(0.75 * y) polygon(points=[
[-1,-1], [-1,-1],
[-1,3.45], [-1,3.45],
[7.15, 3.45], [7.15, 3.45],
[11.45,-1] [11.45,-1]
]); ]);
translate([2.45,0.75 * t - 2.4, 0]) rotate([90,-90,0]) linear_extrude(0.4 * t + 5) polygon(points=[ translate([2.45,0.75 * y - 2.4, 0]) rotate([90,-90,0]) linear_extrude(0.4 * y + 5) polygon(points=[
[-1,-1], [-1,-1],
[-1,0.35], [-1,0.35],
[3.05, 0.35], [3.05, 0.35],
@@ -69,5 +71,3 @@ module sideCut(t) {
]); ]);
} }
} }
box(b, t, h);

View File

@@ -1,19 +1,19 @@
include <BOSL2/std.scad> include <BOSL2/std.scad>
boxHelper(45, 53, "Reaper", "Zyklop", "Megaslime"); boxHelper(45, 43.5, 53, "Reaper", "Zyklop", "Megaslime");
translate([ 88.5, 39, 0 ]) zrot(180, cp=[0, 0, 0]) boxHelper(45, 53, "Drache", "Medusa", "Träumer"); translate([ 88.5, 43.5, 0 ]) zrot(180, cp=[0, 0, 0]) boxHelper(45, 43.5, 53, "Drache", "Medusa", "Träumer");
module boxHelper(x, z, frontName, middleName, backName) { module boxHelper(x, y, z, frontName, middleName, backName) {
difference() { difference() {
cube([ x, 39, z ], false); cube([ x, y, z ], false);
translate([ 1.5, 1.5, 1.5 ]) cube([ x - 3, 36, z - 1 ], false); translate([ 1.5, 1.5, 1.5 ]) cube([ x - 3, y - 3, z - 1 ], false);
// windows // windows
window(x / 2, 39, z, "Schleim", "Reaper"); window(x / 2, y, z, "Schleim", "Reaper");
// floor // floor
xInner = x - 10; xInner = x - 10;
yInner = 39 - 10; yInner = y - 10;
if (xInner >= 6 && yInner >= 6) { if (xInner >= 6 && yInner >= 6) {
xSpace = 5 + (((xInner + 2) % 8) / 2); xSpace = 5 + (((xInner + 2) % 8) / 2);
@@ -34,12 +34,12 @@ module boxHelper(x, z, frontName, middleName, backName) {
difference() { difference() {
union() { union() {
translate([ 0, 12.5, 0 ]) cube([ x, 1.5, z ], false); translate([ 0, 14, 0 ]) cube([ x, 1.5, z ], false);
translate([ 0, 25, 0 ]) cube([ x, 1.5, z ], false); translate([ 0, 28, 0 ]) cube([ x, 1.5, z ], false);
} }
windowHelper(x / 2, 12.5, z, ""); windowHelper(x / 2, 14, z, "");
windowHelper(x / 2, 25, z, ""); windowHelper(x / 2, 28, z, "");
} }
} }

View File

@@ -1,13 +1,5 @@
32,83,28.5,Schleim
31,73,34.5,Unholde
28,63,29.5,Skelette
29,53,27.5,Echsenvolk
39,23,33.5,Hexen
38,33,31.5,Geister 38,33,31.5,Geister
31,43,34.5,Gnolle
29,83,26.5,Pilze 29,83,26.5,Pilze
38,53,27,Spinne 38,53,27,Spinne
30,93,25.5,Rattenvolk
27,43,26.5,Hellgrün
51,45,33.5,Werwolf 51,45,33.5,Werwolf
55,25,35.5,Vampir 55,25,35.5,Vampir

View File

@@ -3,7 +3,7 @@ use <../Box-Lid.scad>
difference() { difference() {
union() { union() {
lid(178, 38); boxLid(178, 38);
translate([ 92.95, 21.2, 0 ]) cube([ 85.1, 16.8, 2 ], false); // frame area around card pocket translate([ 92.95, 21.2, 0 ]) cube([ 85.1, 16.8, 2 ], false); // frame area around card pocket
} }

View File

@@ -37,7 +37,7 @@ difference() {
union() { union() {
translate([ 4, 19, 29.5 ]) rotate(90, [ 0, 1, 0 ]) cylinder(h = 92.75, r = 7.5, center = false); translate([ 4, 19, 29.5 ]) rotate(90, [ 0, 1, 0 ]) cylinder(h = 92.75, r = 7.5, center = false);
translate([95, 25, 29.5]) rotate(90, [ 0, 1, 0 ]) cylinder(h = 79, r = 7.5, center = false); translate([ 94.9, 25, 29.5 ]) rotate(90, [ 0, 1, 0 ]) cylinder(h = 79.1, r = 7.5, center = false);
} }
// clean area for card pocket // clean area for card pocket