wiedzmin karty

This commit is contained in:
Sasza Stanczew 2026-01-25 13:40:18 +01:00
parent c69a6a43ab
commit 65aad0d225
2 changed files with 1360426 additions and 31 deletions

View file

@ -2,14 +2,18 @@ include <BOSL2/std.scad>
// EDITABLE VARIABLES
$fn = 36;
$slop = 1;
t = 2;
$fn = 36; // dokładność renderu, wyżej niż 360 nie ma sensu
$slop = 1; // luz wokół karty, polecam co najmniej 0.5
t = 1.5; // ogólna grubość ścianek
layer_h = 0.25; // layer height, for text to be 1 layer
wing_h = 0.8;
wing_h = 0.8; // procent wysokości boków pokrywek do wysokości podstawek
tab_w = 10; // szerokość nachodzących na siebie krawedzi
// rozmiar karty
karta = [65,100];
// karta = [65,100];
karta = [67,102]; // karta + koszulka
dziura = [30,65];
// Tablica o wartościach:
// [wysokość pliku kart, "tekst", rozmiar tekstu],
@ -27,28 +31,55 @@ tab = [
];
// END OF EDITABLE VARIABLES
// (raczej) NIE EDYTOWAĆ
card = [karta[0]+2*$slop, karta[1]+2*$slop];
out = [card[0]+2*t, card[1]+2*t];
module wing_with_tabs(dim, rot) {
zrot(rot) union() {
// side wing
cuboid(dim, anchor=BOTTOM, rounding=t/2);
// tab
left(dim[0]) fwd(dim[1]/2)
cuboid([dim[0], tab_w, dim[2]], anchor=BOTTOM, rounding=t/2);
left(dim[0]) back(dim[1]/2)
cuboid([dim[0], tab_w, dim[2]], anchor=BOTTOM, rounding=t/2);
// connection with main side wing
left(dim[0]/2) back(dim[1]/2 - tab_w/4)
cuboid([dim[0]*2, tab_w/2, dim[2]], anchor=BOTTOM, rounding=t/2);
left(dim[0]/2) fwd(dim[1]/2 - tab_w/4)
cuboid([dim[0]*2, tab_w/2, dim[2]], anchor=BOTTOM, rounding=t/2);
// connection to the bottom
left(dim[0]/2) back(dim[1]/2)
cuboid([dim[0]*2, tab_w, t], anchor=BOTTOM, rounding=t/2);
left(dim[0]/2) fwd(dim[1]/2)
cuboid([dim[0]*2, tab_w, t], anchor=BOTTOM, rounding=t/2);
}
}
module box(h_in,txt, txt_size) {
h = h_in + 2*t;
h = h_in + t;
// bottom box
difference() {
// main body
cuboid([each out, h],anchor=BOTTOM, rounding=t/2);
// text
right(card[0]/2 - txt_size) text3d(txt, h=t/4, orient=DOWN, anchor=TOP, center=true, spin=90, size=txt_size);
up(t) right(card[0]/2 - txt_size) text3d(txt, h=t/4, orient=UP, anchor=TOP, center=true, spin=90, size=txt_size);
// hole in the bottom
left(txt_size/2) cuboid([out[0]/2 - txt_size,out[1]/2,t], chamfer=-t/4, anchor=BOTTOM);
// hole for cards
up(t) cuboid([each card, h-t], anchor=BOTTOM, rounding=-t/2, edges=TOP);
// cutouts
// text
color("blue") right(card[0]/2 - txt_size) zrot(180)
text3d(txt, h=layer_h, orient=DOWN, anchor=TOP, center=true, spin=90, size=txt_size);
color("red") up(t) right(card[0]/2 - txt_size)
text3d(txt, h=layer_h, orient=UP, anchor=TOP, center=true, spin=90, size=txt_size);
// hole in the bottom
left(txt_size/2) cuboid([each dziura,t], chamfer=-t/4, anchor=BOTTOM);
// sides cutouts
difference() {
union() {
cuboid([card[0]/2 + t, card[1]*2, h], anchor=BOTTOM, rounding=-t, edges=TOP);
cuboid([card[0]*2, card[1]/2 + t, h], anchor=BOTTOM, rounding=-t, edges=TOP);
cuboid([card[0]/2, card[1]*2, h], anchor=BOTTOM, rounding=-t, edges=TOP);
cuboid([card[0]*2, card[1]/2, h], anchor=BOTTOM, rounding=-t, edges=TOP);
}
cuboid([card[0]-$slop*2, card[1]-$slop*2, t], anchor=BOTTOM);
}
@ -56,35 +87,31 @@ module box(h_in,txt, txt_size) {
}
// top cover
fwd(out[1] + 2)
fwd(out[1] + 2*t)
// up(h+2*t) xrot(180) // test fit
union() {
// cover
difference() {
cuboid([each out, t], anchor=BOTTOM, rounding=t/2);
// text
right(card[0]/2 - txt_size) down(0.1) text3d(txt, h=t/4, orient=DOWN, anchor=TOP, center=true, spin=90, size=txt_size);
right(card[0]/2 - txt_size) up(t+0.1) text3d(txt, h=t/4, orient=UP, anchor=TOP, center=true, spin=90, size=txt_size);
color("blue") right(card[0]/2 - txt_size) down(0.01) zrot(180)
text3d(txt, h=layer_h, orient=DOWN, anchor=TOP, center=true, spin=90, size=txt_size);
color("red") right(card[0]/2 - txt_size) up(t+0.01)
text3d(txt, h=layer_h, orient=UP, anchor=TOP, center=true, spin=90, size=txt_size);
// hole in the top
down(0.01) left(txt_size/2) cuboid([out[0]/2 - txt_size,out[1]/2,t + 0.02], chamfer=-t/4, anchor=BOTTOM);
down(0.01) left(txt_size/2) cuboid([each dziura,t + 0.02], chamfer=-t/4, anchor=BOTTOM);
}
// corners
up(t) difference() {
cuboid([card[0]+t, card[1]+t, t],anchor=BOTTOM, chamfer=t, edges=TOP);
cuboid([card[0], card[1], 4*t]);
cuboid([out[0]*3/4, out[1], 4*t]);
cuboid([out[0], out[1]*3/4, 4*t]);
}
// side wings
left(out[0]/2 - t/2) cuboid([t,card[1]/2,h*wing_h], anchor=BOTTOM, rounding=t/2);
right(out[0]/2 - t/2) cuboid([t,card[1]/2,h*wing_h], anchor=BOTTOM, rounding=t/2);
fwd(out[1]/2 - t/2) cuboid([card[0]/2,t,h*wing_h], anchor=BOTTOM, rounding=t/2);
back(out[1]/2 - t/2) cuboid([card[0]/2,t,h*wing_h], anchor=BOTTOM, rounding=t/2);
left(out[0]/2 - t/2) wing_with_tabs([t,card[1]/2-$slop,h*wing_h], 0);
right(out[0]/2 - t/2) wing_with_tabs([t,card[1]/2-$slop,h*wing_h], 180);
fwd(out[1]/2 - t/2) wing_with_tabs([t,card[0]/2-$slop,h*wing_h], 90);
back(out[1]/2 - t/2) wing_with_tabs([t,card[0]/2-$slop,h*wing_h], 270);
}
}
// create all models
for(i=[0:len(tab)-1]) {
left((out[0] + t)*i) box(tab[i][0], tab[i][1], tab[i][2]);
left((out[0] + 4*t)*i) box(tab[i][0], tab[i][1], tab[i][2]);
}

File diff suppressed because it is too large Load diff