adapt design to have text in second color
This commit is contained in:
2026-05-20 10:41:04 +02:00
parent 7ee5c48e98
commit 17f110f2bd
14 changed files with 261 additions and 140 deletions

97
Card-Holder.scad Normal file
View File

@@ -0,0 +1,97 @@
include <BOSL2/std.scad>
use <Color.scad>
// Parameter for console overwrite
x = 58;
y = 5;
z = 88;
name = "Cards";
makeColor("yellow") cardHolder(x + 5, y + 3, z + 4, name);
makeColor("white") {
translate([ 8.5, 1, 3.5 ]) rotate([ 0, -90, 90 ]) linear_extrude(height = 0.2) text(name, size = 5, font = "Arial:style=Bold");
}
module cardHolder(x, y, z, name) {
// floor
xInner = x - 10;
yInner = y - 10;
if (xInner >= 6 && yInner >= 6) {
difference() {
cube([ x, y, 1.5 ], false);
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);
}
} else cube([ x, y, 1.5 ], false);
// left
translate([ 0, 0, 1.5 ]) cuboid(
[ 1.5, y, z - 1.5 ],
anchor = [ -1, -1, -1 ],
rounding = min(10, y - 1.5),
edges = FRONT + TOP
);
// right
translate([ x - 1.5, 0, 1.5 ]) cuboid(
[ 1.5, y, z - 1.5 ],
anchor = [ -1, -1, -1 ],
rounding = min(10, y - 1.5),
edges = FRONT + TOP
);
// back
translate([ 1.5, y - 1.5, 1.5 ]) {
cuboid(
[ 10, 1.5, z -1.5],
anchor = [ -1, -1, -1 ],
rounding = 5,
edges = RIGHT + TOP
);
translate([ x - 13, 0, 0 ]) cuboid(
[ 10, 1.5, z - 1.5 ],
anchor = [ -1, -1, -1 ],
rounding = 5,
edges = LEFT + TOP
);
translate([ 10, 0, 0 ]) difference() {
cube([ x - 23, 1.5, z - 1 ], false);
translate([ 0, -1, 15 ]) cuboid(
[ x - 23, 3, z - 12 ],
anchor = [ -1, -1, -1 ],
rounding = 10,
edges = [ LEFT + BOTTOM, RIGHT + BOTTOM ]
);
translate([ -1, -1, 35 ]) cube([ x - 21, 3, z - 20 ], false);
}
}
// front
translate([ 1, 0, 1 ]) {
difference() {
cuboid(
[ 10, 1.5, z - 21 ],
anchor = [ -1, -1, -1 ],
rounding = 5,
edges = RIGHT + TOP
);
translate([ 7.5, 1, 2.5 ]) rotate([ 0, -90, 90 ]) linear_extrude(height = 1.2) text(name, size = 5, font = "Arial:style=Bold");
}
translate([ x - 12, 0, 0 ]) cuboid(
[ 10, 1.5, z - 21 ],
anchor = [ -1, -1, -1 ],
rounding = 5,
edges = LEFT + TOP
);
}
}