Dodane przegrótki do wkładek oraz wypustki

This commit is contained in:
2026-03-23 19:20:45 +01:00
parent 4326217993
commit 29b5328134
2 changed files with 205 additions and 29 deletions

View File

@@ -288,7 +288,6 @@ barrel_rotary_tolerance=0.2;
//[degrees] allows for more rotation, does not affect pip hinge
extra_clearance = 15;//[0:60]
/* [⚑ Co drukowac / What to print] */
// Pokaz OBIE wkladki (ukrywa reszte)
show_trays = false;
@@ -297,6 +296,14 @@ show_only_tray_1 = false;
// Pokaz TYLKO DRUGA wkladke (docinana)
show_only_tray_2 = false;
// --- Przegrodki PIERWSZA wkladka (Gorna) ---
tray_1_div_x = 0;
tray_1_div_y = 0;
// --- Przegrodki DRUGA wkladka (Dolna) ---
tray_2_div_x = 0;
tray_2_div_y = 0;
// Pokaz TYLKO dol pudelka (bez klipsa)
show_only_box = false;
// Pokaz TYLKO pokrywke
@@ -308,7 +315,7 @@ show_only_latch = false;
tray_depth = 15.0;
// Grubosc scianki wkladki w mm
tray_wall_thickness = 1.6;
// Luz pomiedzy pudelkiem a wkladka (na kazda strone)
// Luz pomiedzy pudelkiem a wkladka
tray_tolerance = 0.3;
//ͼϾ
@@ -2867,59 +2874,89 @@ module complex_shell(){
};
module insert_tray(t_outerZ) {
module insert_tray(t_outerZ, div_x=0, div_y=0) {
t_outerX = innerX - tray_tolerance * 2;
t_outerY = innerY - tray_tolerance * 2;
t_outer_fillet = max(inner_fillet - tray_tolerance, 0.1);
t_inner_fillet = max(t_outer_fillet - tray_wall_thickness, 0.1);
difference() {
offset_sweep(
rect([t_outerX, t_outerY], rounding=t_outer_fillet),
height=t_outerZ,
bot=os_chamfer(width=1),
top=os_chamfer(width=0),
anchor="base"
);
int_x = t_outerX - tray_wall_thickness * 2;
int_y = t_outerY - tray_wall_thickness * 2;
up(tray_wall_thickness)
offset_sweep(
rect([t_outerX - tray_wall_thickness*2, t_outerY - tray_wall_thickness*2], rounding=t_inner_fillet),
height=t_outerZ + epsilon,
bot=os_chamfer(width=0),
top=os_chamfer(width=-tray_wall_thickness/3),
anchor="base"
);
union() {
// Główna skorupa tacki
difference() {
offset_sweep(
rect([t_outerX, t_outerY], rounding=t_outer_fillet),
height=t_outerZ,
bot=os_chamfer(width=1),
top=os_chamfer(width=0),
anchor="base"
);
up(tray_wall_thickness)
offset_sweep(
rect([t_outerX - tray_wall_thickness*2, t_outerY - tray_wall_thickness*2], rounding=t_inner_fillet),
height=t_outerZ + epsilon,
bot=os_chamfer(width=0),
top=os_chamfer(width=-tray_wall_thickness/3),
anchor="base"
);
}
// --- Nowość: Wypustki do wyciągania ---
// Pojawią się tylko, jeśli nie ma żadnych przegródek
if (div_x == 0 && div_y == 0) {
tab_size = 6; // szerokość wypustki
tab_depth = 2; // jak bardzo wystaje do środka
up(t_outerZ - 2) // umieść na górnej krawędzi
xflip_copy(offset = int_x/2)
cuboid([tab_depth, tab_size, 2], anchor=RIGHT+TOP, chamfer=0.5, edges=BOT+FRONT+BACK);
}
// Przegródki X
if (div_x > 0) {
up(tray_wall_thickness)
xcopies(spacing=int_x/(div_x+1), n=div_x)
cuboid([tray_wall_thickness, int_y, t_outerZ - tray_wall_thickness], anchor=BOT);
}
// Przegródki Y
if (div_y > 0) {
up(tray_wall_thickness)
ycopies(spacing=int_y/(div_y+1), n=div_y)
cuboid([int_x, tray_wall_thickness, t_outerZ - tray_wall_thickness], anchor=BOT);
}
}
}
// ==============================================
// GLOWNE WYWOLANIE (Pudelko albo wkladki)
// GLOWNE WYWOLANIE (Finalna wersja)
// ==============================================
if (show_trays || show_only_tray_1 || show_only_tray_2) {
// Oblicza pozostale miejsce na druga wkladke (pod sam zawias)
bottom_internal_height = (outerZ - lip_outer_downset) - wallthickness;
auto_depth = max(bottom_internal_height - tray_depth - 0.5, 2);
if (show_trays) {
// Rysuje obie wkladki obok siebie
insert_tray(tray_depth);
insert_tray(tray_depth, tray_1_div_x, tray_1_div_y);
right(outerX + 15)
insert_tray(auto_depth);
insert_tray(auto_depth, tray_2_div_x, tray_2_div_y);
} else if (show_only_tray_1) {
// Rysuje tylko pierwsza wkladke (na srodku)
insert_tray(tray_depth);
insert_tray(tray_depth, tray_1_div_x, tray_1_div_y);
} else if (show_only_tray_2) {
// Rysuje tylko druga wkladke (na srodku)
insert_tray(auto_depth);
insert_tray(auto_depth, tray_2_div_x, tray_2_div_y);
}
} else {
// Rysuje standardowe pudelko
hsv(h=170,s=.05,v=.8)
render()
printable_box();