cable_holder improvement, more front, top and bottom vent cover adjustments, other code cleanup and example cases

This commit is contained in:
Edward Kisiel
2025-04-23 15:07:23 -04:00
parent 86eb912784
commit 2f318b1cce
7 changed files with 509 additions and 281 deletions

View File

@@ -157,11 +157,11 @@ module case_bottom(case_design) {
// front panel
if(case_design == "tray_vu5" || case_design == "tray_vu7" || case_design == "tray_sides") {
translate([-wallthick-gap,depth-(2*wallthick)-gap,bottom_height-adj])
rotate([0,0,0]) cube([width,wallthick,top_height]);
cube([width,wallthick,top_height]);
}
else {
translate([-wallthick-gap,depth-(2*wallthick)-gap,bottom_height-adj])
rotate([0,0,0]) cube([width,wallthick,top_height-floorthick]);
cube([width,wallthick,top_height-floorthick]);
}
// rear panel
@@ -236,21 +236,21 @@ module case_bottom(case_design) {
}
else {
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,0])
translate([pcb_width/2,pcb_depth/2,bottom_height/2])
cylinder_fillet_inside(h=bottom_height, r=hex_diameter/2,
top=0, bottom=edge_fillet, $fn=6, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+floorthick]) rotate([0,0,0])
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+floorthick])
cylinder_fillet_inside(h=bottom_height+adj,r=(hex_diameter/2)-lip/2,top=0,
bottom=edge_fillet-1,$fn=6,fillet_fn=case_ffn, center=true);
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,0])
translate([pcb_width/2,pcb_depth/2,bottom_height-lip])
cylinder(h=lip+adj,r=(hex_diameter/2)+1, $fn=6);
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,0])
translate([pcb_width/2,pcb_depth/2,bottom_height-lip])
cylinder(h=lip+2*adj,r=(hex_diameter/2)-lip/4, $fn=6);
}
}
difference() {
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+2*floorthick]) rotate([0,0,0])
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+2*floorthick])
cylinder_fillet_inside(h=bottom_height+adj+floorthick+lip,
r=(hex_diameter/2)-lip/2,top=0, bottom=edge_fillet-1, $fn=6,
fillet_fn=case_ffn, center=true);
@@ -515,9 +515,11 @@ echo(pcb_depth+case_offset_y-10);
}
// bottom cover pattern
if(bottom_cover_pattern != "solid") {
xvent8_adj = pcb_width > 100 ? width/5.5 : width/6;
if(bottom_cover_pattern == "hex_5mm") {
if(case_design == "panel_nas") {
translate([5,5,-floorthick]) vent_hex((width-10)/3.75,(depth-10)/7,floorthick+4,5,1.5,"horizontal");
translate([6,5,-floorthick+adj])
vent_hex((width-10)/3.75,(depth-10)/7,floorthick+4,5,1.5,"horizontal");
}
else {
translate([1,0,-floorthick]) vent_hex(width/3.75,depth/6,floorthick+4,5,1.5,"horizontal");
@@ -525,7 +527,7 @@ echo(pcb_depth+case_offset_y-10);
}
if(bottom_cover_pattern == "hex_8mm") {
if(case_design == "panel_nas") {
translate([5,6,-floorthick]) vent_hex(width/5.5,depth/9.5,floorthick+4,8,1.5,"horizontal");
translate([-gap+5,6,-floorthick+adj]) vent_hex(xvent8_adj,depth/9.5,floorthick+4,8,1.5,"horizontal");
}
else {
translate([1,2,-floorthick]) vent_hex(width/5.5,depth/9.5,floorthick+4,8,1.5,"horizontal");
@@ -533,8 +535,8 @@ echo(pcb_depth+case_offset_y-10);
}
if(bottom_cover_pattern == "linear_vertical") {
if(case_design == "panel_nas") {
translate([6,5,-floorthick])
vent(wallthick,depth-8*wallthick-gap,floorthick+4,1,1,(width-2*wallthick-gap)/4.5,"horizontal");
translate([wallthick+gap,wallthick,-floorthick+adj])
vent(wallthick,depth-6*wallthick-gap,floorthick+4,1,1,(width-2*(sidethick+gap))/5.35,"horizontal");
}
else {
translate([0,-gap,-floorthick])
@@ -543,8 +545,9 @@ echo(pcb_depth+case_offset_y-10);
}
if(bottom_cover_pattern == "linear_horizontal") {
if(case_design == "panel_nas") {
translate([6,5,-floorthick])
vent(width-6*(sidethick+gap),wallthick,floorthick+4,1,(depth-2*wallthick-gap)/3.25,1,"horizontal");
translate([wallthick+gap,wallthick,-floorthick+adj])
vent(width-4*(sidethick+gap),wallthick,floorthick+4,1,
(depth-2*(wallthick-gap))/4.35,1,"horizontal");
}
else {
translate([-gap,-gap,-floorthick])
@@ -553,9 +556,10 @@ echo(pcb_depth+case_offset_y-10);
}
if(bottom_cover_pattern == "astroid") {
if(case_design == "panel_nas") {
for(c=[12:12:depth-16]) {
xast_adj = pcb_width <= 100 ? 8 : 6;
for(c=[xast_adj:12:depth-16]) {
for(r=[12:12:width-16]) {
translate([r,c,-(2*floorthick)]) linear_extrude(floorthick+5) import("./dxf/astroid_8mm.dxf");
translate([r,c,-floorthick]) linear_extrude(floorthick+5) import("./dxf/astroid_8mm.dxf");
}
}
}