refinement and fixes for folded cases with ui improvements

This commit is contained in:
Edward Kisiel
2024-02-17 17:26:09 -05:00
parent 0d5f8ef357
commit 5c43d0961d
2 changed files with 147 additions and 143 deletions

View File

@@ -17,11 +17,13 @@
NAME: case_folded NAME: case_folded
DESCRIPTION: creates folded case flat blank for supported designs DESCRIPTION: creates folded case flat blanks for supported designs
TODO: none TODO: none
USAGE: case_folded(case_design, case_style) USAGE: case_folded(case_design, case_style)
case_design = paper
case_style = split-top, full-top
*/ */
module case_folded(case_design, case_style) { module case_folded(case_design, case_style) {
@@ -29,7 +31,7 @@ module case_folded(case_design, case_style) {
section_position = 2; section_position = 2;
ba = bend_allowance; ba = bend_allowance;
slit_len = pcb_depth < pcb_width ? pcb_depth/10 : pcb_width/10; slit_len = pcb_depth < pcb_width ? pcb_depth/10 : pcb_width/10;
slit_width = .25; slit_width = material_thickness;
slit_offset = pcb_depth < pcb_width ? pcb_depth/10 : pcb_width/10; slit_offset = pcb_depth < pcb_width ? pcb_depth/10 : pcb_width/10;
fold_height = pcb_tmaxz+bottom_clearence+pcb_z+ba; fold_height = pcb_tmaxz+bottom_clearence+pcb_z+ba;
flap_y = 12; flap_y = 12;
@@ -38,7 +40,6 @@ tab_y = fold_height/2;
tab_inset = 6; tab_inset = 6;
if(case_style == "split-top") { if(case_style == "split-top") {
projection(cut = true) {
// rear // rear
difference() { difference() {
union() { union() {
@@ -111,18 +112,16 @@ tab_inset = 6;
} }
} }
translate([0, -fold_height, pcb_tmaxz+2]) rotate([180, 0, 0]) translate([0, -fold_height, pcb_tmaxz+2+material_thickness]) rotate([180, 0, 0])
sbc(sbc_model, cooling, 0, "disable", "disable", true); sbc(sbc_model, cooling, 0, "disable", "disable", true);
translate([0, 2*pcb_depth+fold_height, pcb_tmaxz+2]) rotate([180, 0, 0]) translate([0, 2*pcb_depth+fold_height, pcb_tmaxz+2+material_thickness]) rotate([180, 0, 0])
sbc(sbc_model, cooling, 0, "disable", "disable", true); sbc(sbc_model, cooling, 0, "disable", "disable", true);
}
} }
translate([0, -fold_height-(pcb_depth/2)-ba, 0]) cube([pcb_width, 2, material_thickness]);
translate([0, pcb_depth+fold_height+(pcb_depth/2)-ba, 0]) cube([pcb_width, 2, material_thickness]);
} }
if(case_style == "full-top") { if(case_style == "full-top" || case_style == "none") {
projection(cut = true) {
// rear // rear
difference() { difference() {
union() { union() {
@@ -191,13 +190,12 @@ tab_inset = 6;
translate([pcb_width-tab_x-tab_inset, pcb_depth+fold_height, 0]) translate([pcb_width-tab_x-tab_inset, pcb_depth+fold_height, 0])
cube([tab_x, slit_width, material_thickness+2*adj]); cube([tab_x, slit_width, material_thickness+2*adj]);
translate([0, -fold_height, pcb_tmaxz+2]) rotate([180, 0, 0]) translate([0, -fold_height, pcb_tmaxz+2+material_thickness]) rotate([180, 0, 0])
sbc(sbc_model, cooling, 0, "disable", "disable", true); sbc(sbc_model, cooling, 0, "disable", "disable", true);
translate([0, 2*pcb_depth+fold_height, pcb_tmaxz+2]) rotate([180, 0, 0]) translate([0, 2*pcb_depth+fold_height, pcb_tmaxz+2+material_thickness]) rotate([180, 0, 0])
sbc(sbc_model, cooling, 0, "disable", "disable", true); sbc(sbc_model, cooling, 0, "disable", "disable", true);
} }
} }
}
} }
@@ -242,11 +240,11 @@ section_position = 2;
difference() { difference() {
translate([0, pcb_depth, 0]) cube([pcb_width, fold_height, material_thickness]); translate([0, pcb_depth, 0]) cube([pcb_width, fold_height, material_thickness]);
// folding slits // folding slits
translate([slit_offset, pcb_depth+fold_height, -adj]) translate([slit_offset, pcb_depth+fold_height-slit_width, -adj])
cube([slit_len, slit_width, material_thickness+(2*adj)]); cube([slit_len, slit_width, material_thickness+(2*adj)]);
translate([pcb_width/2-slit_len/2, pcb_depth+fold_height, -adj]) translate([pcb_width/2-slit_len/2, pcb_depth+fold_height-slit_width, -adj])
cube([slit_len, slit_width, material_thickness+(2*adj)]); cube([slit_len, slit_width, material_thickness+(2*adj)]);
translate([pcb_width-slit_offset-slit_len, pcb_depth+fold_height, -adj]) translate([pcb_width-slit_offset-slit_len, pcb_depth+fold_height-slit_width, -adj])
cube([slit_len, slit_width, material_thickness+(2*adj)]); cube([slit_len, slit_width, material_thickness+(2*adj)]);
translate([0, pcb_depth+bottom_clearence, pcb_depth+section_position]) rotate([-90, 0, 0]) translate([0, pcb_depth+bottom_clearence, pcb_depth+section_position]) rotate([-90, 0, 0])

View File

@@ -125,7 +125,7 @@ bottom_ext_standoff = [5.75,5,3.6,10,4,1,0,0,0,4.5,5.1];
/* [Folding Case Adjustments] */ /* [Folding Case Adjustments] */
//Material Thickness //Material Thickness
material_thickness = .5; //[.1:.1:3] material_thickness = .5; //[.1:.01:3]
// Bend Allowance // Bend Allowance
bend_allowance = 1; //[0:.01:5] bend_allowance = 1; //[0:.01:5]
// Bottom clearence // Bottom clearence
@@ -257,6 +257,9 @@ if (view == "platter") {
} }
} }
} }
if(case_design == "paper") {
case_folded(case_design, case_style);
}
if(case_design == "tray") { if(case_design == "tray") {
echo(width=width+2*sidethick,depth=depth,top=top_height,bottom=bottom_height); echo(width=width+2*sidethick,depth=depth,top=top_height,bottom=bottom_height);
} }
@@ -535,6 +538,9 @@ if (view == "model") {
} }
} }
} }
if(case_design == "paper") {
case_folded(case_design, case_style);
}
if(case_design == "tray") { if(case_design == "tray") {
echo(width=width+2*sidethick,depth=depth,top=top_height,bottom=bottom_height); echo(width=width+2*sidethick,depth=depth,top=top_height,bottom=bottom_height);
} }
@@ -652,6 +658,6 @@ if (view == "part") {
} }
if (view == "folded") { if (view == "folded") {
if(case_design == "paper") { if(case_design == "paper") {
case_folded(case_design, case_style); projection() case_folded(case_design, case_style);
} }
} }