more work on folded cases, added paper_full-top case
This commit is contained in:
@@ -20,184 +20,276 @@
|
|||||||
DESCRIPTION: creates folded case flat blank for supported designs
|
DESCRIPTION: creates folded case flat blank for supported designs
|
||||||
TODO: none
|
TODO: none
|
||||||
|
|
||||||
USAGE: case_folded(case_design)
|
USAGE: case_folded(case_design, case_style)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module case_folded(case_design) {
|
module case_folded(case_design, case_style) {
|
||||||
|
|
||||||
section_position = 2;
|
section_position = 2;
|
||||||
ba = 1;
|
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 = .25;
|
||||||
slit_offset = pcb_depth < pcb_width ? pcb_depth/10 : pcb_width/10;
|
slit_offset = pcb_depth < pcb_width ? pcb_depth/10 : pcb_width/10;
|
||||||
flap_y = 12;
|
fold_height = pcb_tmaxz+bottom_clearence+pcb_z+ba;
|
||||||
|
flap_y = 12;
|
||||||
|
tab_x = pcb_depth/4;
|
||||||
|
tab_y = fold_height/2;
|
||||||
|
tab_inset = 6;
|
||||||
|
|
||||||
if(case_design == "paper_split-top") {
|
if(case_style == "split-top") {
|
||||||
// projection(cut = true) {
|
projection(cut = true) {
|
||||||
// rear
|
// rear
|
||||||
difference() {
|
difference() {
|
||||||
union() {
|
union() {
|
||||||
translate([0, -pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba, 0])
|
folded_base(fold_height, ba, flap_y, tab_x, tab_y, tab_inset, slit_len, slit_width, slit_offset);
|
||||||
cube([pcb_width, pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba, .1]);
|
translate([0, -fold_height-(pcb_depth/2)-ba, 0])
|
||||||
translate([0, -pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba-(pcb_depth/2), 0])
|
cube([pcb_width, (pcb_depth/2)+ba, material_thickness]);
|
||||||
cube([pcb_width, pcb_depth/2, .1]);
|
translate([0, pcb_depth+fold_height, 0])
|
||||||
}
|
cube([pcb_width, (pcb_depth/2)+ba, material_thickness]);
|
||||||
// folding slits
|
|
||||||
translate([slit_offset, -pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba, -adj])
|
|
||||||
cube([slit_len, slit_width, .2]);
|
|
||||||
translate([pcb_width/2-slit_len/2, -pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba, -adj])
|
|
||||||
cube([slit_len, slit_width, .2]);
|
|
||||||
translate([pcb_width-slit_offset-slit_len, -pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba, -adj])
|
|
||||||
cube([slit_len, slit_width, .2]);
|
|
||||||
|
|
||||||
translate([0, -pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba, pcb_tmaxz+2]) rotate([180, 0, 0])
|
// flaps rear left
|
||||||
|
translate([-tab_y, -fold_height+tab_inset-(pcb_depth/2), 0])
|
||||||
|
slab_r([tab_y, tab_x, material_thickness], [tab_x/2,tab_x/2,.1,.1]);
|
||||||
|
|
||||||
|
// flaps rear right
|
||||||
|
translate([pcb_width, -fold_height-(pcb_depth/2)+tab_inset, 0])
|
||||||
|
slab_r([tab_y, tab_x, material_thickness], [.1,.1,tab_x/2,tab_x/2]);
|
||||||
|
|
||||||
|
// flaps front left
|
||||||
|
translate([-tab_y, pcb_depth+fold_height-tab_inset+tab_x, 0])
|
||||||
|
slab_r([tab_y, tab_x, material_thickness], [tab_x/2,tab_x/2,.1,.1]);
|
||||||
|
|
||||||
|
// flaps front right
|
||||||
|
translate([pcb_width, pcb_depth+fold_height-tab_inset+tab_x, 0])
|
||||||
|
slab_r([tab_y, tab_x, material_thickness], [.1,.1,tab_x/2,tab_x/2]);
|
||||||
|
|
||||||
|
// flaps left rear
|
||||||
|
difference() {
|
||||||
|
translate([-(fold_height), 0, 0])
|
||||||
|
linear_extrude(material_thickness) polygon([[0, 0],
|
||||||
|
[1, (-pcb_depth/4)],
|
||||||
|
[(fold_height)-2, (-pcb_depth/4)],
|
||||||
|
[(fold_height), 0],
|
||||||
|
[0, 0]]);
|
||||||
|
translate([-bottom_clearence, 0, section_position]) rotate([90, 0, 270])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
// flaps left front
|
||||||
|
difference() {
|
||||||
|
translate([-(fold_height), pcb_depth, 0])
|
||||||
|
linear_extrude(material_thickness) polygon([[0, 0],
|
||||||
|
[1, (pcb_depth/4)],
|
||||||
|
[(fold_height)-2, (pcb_depth/4)],
|
||||||
|
[(fold_height), 0],
|
||||||
|
[0, 0]]);
|
||||||
|
translate([-bottom_clearence, pcb_depth, pcb_depth+section_position]) rotate([-90, 0, 90])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
// flaps right rear
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width, 0, 0])
|
||||||
|
linear_extrude(material_thickness) polygon([[0, 0],
|
||||||
|
[2, (-pcb_depth/4)],
|
||||||
|
[(fold_height)-1, (-pcb_depth/4)],
|
||||||
|
[(fold_height), 0],
|
||||||
|
[0, 0]]);
|
||||||
|
translate([bottom_clearence+pcb_width, -pcb_width, section_position]) rotate([90, 0, 90])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// flaps right front
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width, pcb_depth, 0])
|
||||||
|
linear_extrude(material_thickness) polygon([[0, 0],
|
||||||
|
[2, (pcb_depth/4)],
|
||||||
|
[(fold_height)-1, (pcb_depth/4)],
|
||||||
|
[(fold_height), 0],
|
||||||
|
[0, 0]]);
|
||||||
|
translate([bottom_clearence+pcb_width, pcb_width+pcb_depth, section_position+pcb_depth])
|
||||||
|
rotate([270, 0, 270]) sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0, -fold_height, pcb_tmaxz+2]) rotate([180, 0, 0])
|
||||||
|
sbc(sbc_model, cooling, 0, "disable", "disable", true);
|
||||||
|
translate([0, 2*pcb_depth+fold_height, pcb_tmaxz+2]) rotate([180, 0, 0])
|
||||||
sbc(sbc_model, cooling, 0, "disable", "disable", true);
|
sbc(sbc_model, cooling, 0, "disable", "disable", true);
|
||||||
|
|
||||||
translate([0, -pcb_bmaxz-case_offset_bz, section_position]) rotate([90, 0, 0])
|
|
||||||
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
}
|
|
||||||
// left side
|
|
||||||
difference() {
|
|
||||||
union() {
|
|
||||||
translate([-pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba, 0, 0])
|
|
||||||
cube([pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba, pcb_depth, .1]);
|
|
||||||
translate([-pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba-flap_y, 0, 0])
|
|
||||||
cube([flap_y, pcb_depth, .1]);
|
|
||||||
}
|
|
||||||
// folding slits
|
|
||||||
translate([-pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba, (pcb_depth/2)+4, -adj])
|
|
||||||
cube([slit_width, flap_y, .2]);
|
|
||||||
|
|
||||||
translate([-pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba, (pcb_depth/2)-flap_y-4, -adj])
|
|
||||||
cube([slit_width, flap_y, .2]);
|
|
||||||
|
|
||||||
translate([-pcb_bmaxz-case_offset_bz, 0, section_position]) rotate([0, -90, 0])
|
|
||||||
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
|
|
||||||
}
|
|
||||||
// front
|
|
||||||
difference() {
|
|
||||||
union() {
|
|
||||||
translate([0, pcb_depth, 0]) cube([pcb_width, pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba, .1]);
|
|
||||||
translate([0, pcb_depth+pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba, 0]) cube([pcb_width, pcb_depth/2, .1]);
|
|
||||||
}
|
|
||||||
// folding slits
|
|
||||||
translate([slit_offset, pcb_depth+pcb_tmaxz+case_offset_bz+pcb_z+pcb_bmaxz+ba, -adj])
|
|
||||||
cube([slit_len, slit_width, .2]);
|
|
||||||
translate([pcb_width/2-slit_len/2, pcb_depth+pcb_tmaxz+case_offset_bz+pcb_z+pcb_bmaxz+ba, -adj])
|
|
||||||
cube([slit_len, slit_width, .2]);
|
|
||||||
translate([pcb_width-slit_offset-slit_len, pcb_depth+pcb_tmaxz+case_offset_bz+pcb_z+pcb_bmaxz+ba, -adj])
|
|
||||||
cube([slit_len, slit_width, .2]);
|
|
||||||
|
|
||||||
translate([0, 2*pcb_depth+pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba, pcb_tmaxz+2]) rotate([180, 0, 0])
|
|
||||||
sbc(sbc_model, cooling, 0, "disable", "disable", true);
|
|
||||||
|
|
||||||
translate([0, pcb_depth+case_offset_bz+pcb_bmaxz, pcb_depth+section_position]) rotate([-90, 0, 0])
|
|
||||||
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
}
|
|
||||||
// right side
|
|
||||||
difference() {
|
|
||||||
union() {
|
|
||||||
translate([pcb_width, 0, 0]) cube([pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba, pcb_depth, .1]);
|
|
||||||
translate([pcb_width+pcb_tmaxz+case_offset_bz+pcb_z+pcb_bmaxz+ba, 0, 0])
|
|
||||||
cube([flap_y, pcb_depth, .1]);
|
|
||||||
}
|
|
||||||
// folding slits
|
|
||||||
translate([pcb_width+pcb_tmaxz+case_offset_bz+pcb_z+pcb_bmaxz+ba, (pcb_depth/2)+4, -adj])
|
|
||||||
cube([slit_width, flap_y, .2]);
|
|
||||||
translate([pcb_width+pcb_tmaxz+case_offset_bz+pcb_z+pcb_bmaxz+ba, (pcb_depth/2)-flap_y-4, -adj])
|
|
||||||
cube([slit_width, flap_y, .2]);
|
|
||||||
|
|
||||||
translate([pcb_width+pcb_bmaxz+case_offset_bz, 0, pcb_width+section_position]) rotate([0, 90, 0])
|
|
||||||
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
}
|
|
||||||
// pcb section
|
|
||||||
difference() {
|
|
||||||
cube([pcb_width, pcb_depth, .1]);
|
|
||||||
translate([0, 0, 1]) sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
// pcb folding slits rear
|
|
||||||
translate([slit_offset, 0, -adj]) cube([slit_len, slit_width, .2]);
|
|
||||||
translate([pcb_width/2-slit_len/2, 0, -adj]) cube([slit_len, slit_width, .2]);
|
|
||||||
translate([pcb_width-slit_offset-slit_len, 0, -adj]) cube([slit_len, slit_width, .2]);
|
|
||||||
|
|
||||||
// pcb folding slits left
|
|
||||||
translate([0, slit_offset, -adj]) cube([slit_width, slit_len, .2]);
|
|
||||||
translate([0, pcb_depth/2-slit_len/2, -adj]) cube([slit_width, slit_len, .2]);
|
|
||||||
translate([0, pcb_depth-slit_offset-slit_len, -adj]) cube([slit_width, slit_len, .2]);
|
|
||||||
|
|
||||||
// pcb folding slits front
|
|
||||||
translate([slit_offset, pcb_depth-slit_width, -adj]) cube([slit_len, slit_width, .2]);
|
|
||||||
translate([pcb_width/2-slit_len/2, pcb_depth-slit_width, -adj]) cube([slit_len, slit_width, .2]);
|
|
||||||
translate([pcb_width-slit_offset-slit_len, pcb_depth-slit_width, -adj]) cube([slit_len, slit_width, .2]);
|
|
||||||
|
|
||||||
// pcb folding slits right
|
|
||||||
translate([pcb_width-slit_width, slit_offset, -adj]) cube([slit_width, slit_len, .2]);
|
|
||||||
translate([pcb_width-slit_width, pcb_depth/2-slit_len/2, -adj]) cube([slit_width, slit_len, .2]);
|
|
||||||
translate([pcb_width-slit_width, pcb_depth-slit_offset-slit_len, -adj]) cube([slit_width, slit_len, .2]);
|
|
||||||
}
|
|
||||||
// flaps rear left
|
|
||||||
translate([(-pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba)/2, -pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba+4-(pcb_depth/2), 0])
|
|
||||||
cube([(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba)/2, pcb_depth/4, .1]);
|
|
||||||
|
|
||||||
// flaps rear right
|
|
||||||
translate([pcb_width, -pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba-(pcb_depth/2)+4, 0])
|
|
||||||
cube([(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba)/2, pcb_depth/4, .1]);
|
|
||||||
|
|
||||||
// flaps front left
|
|
||||||
translate([(-pcb_tmaxz-case_offset_bz-pcb_z-pcb_bmaxz-ba)/2,
|
|
||||||
pcb_depth+pcb_tmaxz+case_offset_bz+pcb_z+pcb_bmaxz+ba-4+pcb_depth/4, 0])
|
|
||||||
cube([(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba)/2, pcb_depth/4, .1]);
|
|
||||||
|
|
||||||
// flaps front right
|
|
||||||
translate([pcb_width, pcb_depth+pcb_tmaxz+case_offset_bz+pcb_z+pcb_bmaxz+ba-4+pcb_depth/4, 0])
|
|
||||||
cube([(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba)/2, pcb_depth/4, .1]);
|
|
||||||
|
|
||||||
// flaps left rear
|
|
||||||
difference() {
|
|
||||||
translate([-(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba), 0, 0])
|
|
||||||
linear_extrude(.1) polygon([[0, 0],
|
|
||||||
[1, (-pcb_depth/4)],
|
|
||||||
[(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba)-2, (-pcb_depth/4)],
|
|
||||||
[(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba), 0],
|
|
||||||
[0, 0]]);
|
|
||||||
translate([-pcb_bmaxz-case_offset_bz, 0, section_position]) rotate([90, 0, 270])
|
|
||||||
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
}
|
|
||||||
// flaps left front
|
|
||||||
difference() {
|
|
||||||
translate([-(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba), pcb_depth, 0])
|
|
||||||
linear_extrude(.1) polygon([[0, 0],
|
|
||||||
[1, (pcb_depth/4)],
|
|
||||||
[(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba)-2, (pcb_depth/4)],
|
|
||||||
[(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba), 0],
|
|
||||||
[0, 0]]);
|
|
||||||
translate([-pcb_bmaxz-case_offset_bz, pcb_depth, pcb_depth+section_position]) rotate([-90, 0, 90])
|
|
||||||
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
}
|
|
||||||
// flaps right rear
|
|
||||||
difference() {
|
|
||||||
translate([pcb_width, 0, 0])
|
|
||||||
linear_extrude(.1) polygon([[0, 0],
|
|
||||||
[2, (-pcb_depth/4)],
|
|
||||||
[(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba)-1, (-pcb_depth/4)],
|
|
||||||
[(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba), 0],
|
|
||||||
[0, 0]]);
|
|
||||||
translate([pcb_bmaxz+case_offset_bz+pcb_width, -pcb_width, section_position]) rotate([90, 0, 90])
|
|
||||||
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// flaps right front
|
|
||||||
difference() {
|
|
||||||
translate([pcb_width, pcb_depth, 0])
|
|
||||||
linear_extrude(.1) polygon([[0, 0],
|
|
||||||
[2, (pcb_depth/4)],
|
|
||||||
[(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba)-1, (pcb_depth/4)],
|
|
||||||
[(pcb_tmaxz+pcb_bmaxz+case_offset_bz+pcb_z+ba), 0],
|
|
||||||
[0, 0]]);
|
|
||||||
translate([pcb_bmaxz+case_offset_bz+pcb_width, pcb_width+pcb_depth, section_position+pcb_depth])
|
|
||||||
rotate([270, 0, 270]) sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
if(case_style == "full-top") {
|
||||||
|
projection(cut = true) {
|
||||||
|
// rear
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
folded_base(fold_height, ba, flap_y, tab_x, tab_y, tab_inset, slit_len, slit_width, slit_offset);
|
||||||
|
translate([0, -fold_height-pcb_depth-ba, 0])
|
||||||
|
cube([pcb_width, pcb_depth+ba, material_thickness]);
|
||||||
|
translate([0, pcb_depth+fold_height, 0])
|
||||||
|
cube([pcb_width, (pcb_depth/4)+ba, material_thickness]);
|
||||||
|
|
||||||
|
// flaps rear left
|
||||||
|
translate([tab_inset, -fold_height-pcb_depth-tab_y, 0])
|
||||||
|
slab_r([tab_x, tab_y, material_thickness], [tab_x/2,.1,.1,tab_x/2]);
|
||||||
|
|
||||||
|
// flaps rear right
|
||||||
|
translate([pcb_width-tab_x-tab_inset, -fold_height-pcb_depth-tab_y, 0])
|
||||||
|
slab_r([tab_x, tab_y, material_thickness], [tab_x/2,.1,.1,tab_x/2]);
|
||||||
|
|
||||||
|
// flaps left rear
|
||||||
|
difference() {
|
||||||
|
translate([-(fold_height), 0, 0])
|
||||||
|
linear_extrude(material_thickness) polygon([[0, 0],
|
||||||
|
[1, (-pcb_depth/4)],
|
||||||
|
[(fold_height)-2, (-pcb_depth/4)],
|
||||||
|
[(fold_height), 0],
|
||||||
|
[0, 0]]);
|
||||||
|
translate([-bottom_clearence, 0, section_position]) rotate([90, 0, 270])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
// flaps left front
|
||||||
|
difference() {
|
||||||
|
translate([-(fold_height), pcb_depth, 0])
|
||||||
|
linear_extrude(material_thickness) polygon([[0, 0],
|
||||||
|
[1, (pcb_depth/4)],
|
||||||
|
[(fold_height)-2, (pcb_depth/4)],
|
||||||
|
[(fold_height), 0],
|
||||||
|
[0, 0]]);
|
||||||
|
translate([-bottom_clearence, pcb_depth, pcb_depth+section_position]) rotate([-90, 0, 90])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
// flaps right rear
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width, 0, 0])
|
||||||
|
linear_extrude(material_thickness) polygon([[0, 0],
|
||||||
|
[2, (-pcb_depth/4)],
|
||||||
|
[(fold_height)-1, (-pcb_depth/4)],
|
||||||
|
[(fold_height), 0],
|
||||||
|
[0, 0]]);
|
||||||
|
translate([bottom_clearence+pcb_width, -pcb_width, section_position]) rotate([90, 0, 90])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// flaps right front
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width, pcb_depth, 0])
|
||||||
|
linear_extrude(material_thickness) polygon([[0, 0],
|
||||||
|
[2, (pcb_depth/4)],
|
||||||
|
[(fold_height)-1, (pcb_depth/4)],
|
||||||
|
[(fold_height), 0],
|
||||||
|
[0, 0]]);
|
||||||
|
translate([bottom_clearence+pcb_width, pcb_width+pcb_depth, section_position+pcb_depth])
|
||||||
|
rotate([270, 0, 270]) sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// top closure tab slits
|
||||||
|
translate([tab_inset, pcb_depth+fold_height, 0]) cube([tab_x, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width-tab_x-tab_inset, pcb_depth+fold_height, 0])
|
||||||
|
cube([tab_x, slit_width, material_thickness+2*adj]);
|
||||||
|
|
||||||
|
translate([0, -fold_height, pcb_tmaxz+2]) rotate([180, 0, 0])
|
||||||
|
sbc(sbc_model, cooling, 0, "disable", "disable", true);
|
||||||
|
translate([0, 2*pcb_depth+fold_height, pcb_tmaxz+2]) rotate([180, 0, 0])
|
||||||
|
sbc(sbc_model, cooling, 0, "disable", "disable", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// base folding case
|
||||||
|
module folded_base(fold_height, ba, flap_y, tab_x, tab_y, tab_inset, slit_len, slit_width, slit_offset) {
|
||||||
|
|
||||||
|
section_position = 2;
|
||||||
|
|
||||||
|
// rear
|
||||||
|
difference() {
|
||||||
|
translate([0, -fold_height, 0]) cube([pcb_width, fold_height, material_thickness]);
|
||||||
|
// folding slits
|
||||||
|
translate([slit_offset, -fold_height, -adj])
|
||||||
|
cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width/2-slit_len/2, -fold_height, -adj])
|
||||||
|
cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width-slit_offset-slit_len, -fold_height, -adj])
|
||||||
|
cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
|
||||||
|
translate([0, -bottom_clearence, section_position]) rotate([90, 0, 0])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
// left side
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([-fold_height, 0, 0])
|
||||||
|
cube([fold_height, pcb_depth, material_thickness]);
|
||||||
|
translate([-fold_height-flap_y, 0, 0]) cube([flap_y, pcb_depth, material_thickness]);
|
||||||
|
}
|
||||||
|
// folding slits
|
||||||
|
translate([-fold_height, (pcb_depth/2)+tab_inset, -adj])
|
||||||
|
cube([slit_width, tab_x, material_thickness+(2*adj)]);
|
||||||
|
|
||||||
|
translate([-fold_height, (pcb_depth/2)-tab_x-tab_inset, -adj])
|
||||||
|
cube([slit_width, tab_x, material_thickness+(2*adj)]);
|
||||||
|
|
||||||
|
translate([-bottom_clearence, 0, section_position]) rotate([0, -90, 0])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
// front
|
||||||
|
difference() {
|
||||||
|
translate([0, pcb_depth, 0]) cube([pcb_width, fold_height, material_thickness]);
|
||||||
|
// folding slits
|
||||||
|
translate([slit_offset, pcb_depth+fold_height, -adj])
|
||||||
|
cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width/2-slit_len/2, pcb_depth+fold_height, -adj])
|
||||||
|
cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width-slit_offset-slit_len, pcb_depth+fold_height, -adj])
|
||||||
|
cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
|
||||||
|
translate([0, pcb_depth+bottom_clearence, pcb_depth+section_position]) rotate([-90, 0, 0])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
// right side
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([pcb_width, 0, 0]) cube([fold_height, pcb_depth, material_thickness]);
|
||||||
|
translate([pcb_width+fold_height, 0, 0])
|
||||||
|
cube([flap_y, pcb_depth, material_thickness]);
|
||||||
|
}
|
||||||
|
// folding slits
|
||||||
|
translate([pcb_width+fold_height, (pcb_depth/2)+tab_inset, -adj])
|
||||||
|
cube([slit_width, tab_x, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width+fold_height, (pcb_depth/2)-tab_x-tab_inset, -adj])
|
||||||
|
cube([slit_width, tab_x, material_thickness+(2*adj)]);
|
||||||
|
|
||||||
|
translate([pcb_width+bottom_clearence, 0, pcb_width+section_position]) rotate([0, 90, 0])
|
||||||
|
sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
}
|
||||||
|
// pcb section
|
||||||
|
difference() {
|
||||||
|
cube([pcb_width, pcb_depth, material_thickness]);
|
||||||
|
translate([0, 0, 1+material_thickness]) sbc(sbc_model, "disable", 0, gpio_opening, uart_opening, true);
|
||||||
|
// pcb folding slits rear
|
||||||
|
translate([slit_offset, 0, -adj]) cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width/2-slit_len/2, 0, -adj]) cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width-slit_offset-slit_len, 0, -adj]) cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
|
||||||
|
// pcb folding slits left
|
||||||
|
translate([0, slit_offset, -adj]) cube([slit_width, slit_len, material_thickness+(2*adj)]);
|
||||||
|
translate([0, pcb_depth/2-slit_len/2, -adj]) cube([slit_width, slit_len, material_thickness+(2*adj)]);
|
||||||
|
translate([0, pcb_depth-slit_offset-slit_len, -adj]) cube([slit_width, slit_len, material_thickness+(2*adj)]);
|
||||||
|
|
||||||
|
// pcb folding slits front
|
||||||
|
translate([slit_offset, pcb_depth-slit_width, -adj]) cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width/2-slit_len/2, pcb_depth-slit_width, -adj]) cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width-slit_offset-slit_len, pcb_depth-slit_width, -adj]) cube([slit_len, slit_width, material_thickness+(2*adj)]);
|
||||||
|
|
||||||
|
// pcb folding slits right
|
||||||
|
translate([pcb_width-slit_width, slit_offset, -adj]) cube([slit_width, slit_len, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width-slit_width, pcb_depth/2-slit_len/2, -adj]) cube([slit_width, slit_len, material_thickness+(2*adj)]);
|
||||||
|
translate([pcb_width-slit_width, pcb_depth-slit_offset-slit_len, -adj]) cube([slit_width, slit_len, material_thickness+(2*adj)]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -28,12 +28,20 @@ include <./sbc_case_builder_accessories.cfg>;
|
|||||||
// viewing mode "model", "platter", "part"
|
// viewing mode "model", "platter", "part"
|
||||||
view = "model"; // [model, platter, part, folded]
|
view = "model"; // [model, platter, part, folded]
|
||||||
individual_part = "bottom"; // [top, bottom, right, left, front, rear, accessories]
|
individual_part = "bottom"; // [top, bottom, right, left, front, rear, accessories]
|
||||||
|
// single board computer model
|
||||||
|
sbc_model = "c1+"; // ["c1+", "c2", "c4", "hc4", "xu4", "xu4q", "mc1", "hc1", "n1", "n2", "n2+", "n2l", "n2lq", "m1", "m1s", "h2", "h2+", "h3", "h3+", "show2", "rpipico", "rpipicow", "rpicm4+ioboard", "rpicm1", "rpicm3", "rpicm3l", "rpicm3+", "rpicm4s", "rpicm4", "rpicm4l", "rpizero", "rpizerow", "rpizero2w", "rpi1a+", "rpi1b+", "rpi2b", "rpi3a+", "rpi3b", "rpi3b+", "rpi4b", "rpi5", "rock64", "rockpro64", "quartz64a", "quartz64b", "h64b", "star64", "rock4a", "rock4b", "rock4a+", "rock4b+", "rock4c", "rock4c+", "rock5b-v1.3", "rock5b", "rock5bq", "vim1", "vim2", "vim3", "vim3l", "vim4", "tinkerboard", "tinkerboard-s", "tinkerboard-2", "tinkerboard-2s", "tinkerboard-r2", "tinkerboard-r2s", "opizero", "opizero2", "opir1plus_lts", "opir1", "opi5", "jetsonnano", "lepotato", "sweetpotato", "tritium-h2+", "tritium-h3", "tritium-h5", "solitude", "alta", "atomicpi", "visionfive2", "visionfive2q", "licheerv+dock", "rak19007"]
|
||||||
|
|
||||||
// sbc off in model view
|
// sbc off in model view
|
||||||
sbc_off = false;
|
sbc_off = false;
|
||||||
// enable highlight for sbc component subtarctive geometry
|
// enable highlight for sbc component subtarctive geometry
|
||||||
sbc_highlight = false;
|
sbc_highlight = false;
|
||||||
// enable highlight for accessory subtarctive geometry
|
// enable highlight for accessory subtarctive geometry
|
||||||
accessory_highlight = false;
|
accessory_highlight = false;
|
||||||
|
// base case design
|
||||||
|
case_design = "shell"; // [shell,panel,stacked,tray,round,hex,snap,fitted,paper]
|
||||||
|
// base case style
|
||||||
|
case_style = "none"; // ["none","vu5","vu7","sides","split-top","full-top"]
|
||||||
|
|
||||||
// raises top mm in model view or < 0 = off
|
// raises top mm in model view or < 0 = off
|
||||||
raise_top = 0; // [-1:100]
|
raise_top = 0; // [-1:100]
|
||||||
// lowers bottom mm in model view or < 0 = off
|
// lowers bottom mm in model view or < 0 = off
|
||||||
@@ -47,13 +55,7 @@ move_front = 0; // [-1:100]
|
|||||||
// move rear mm in model view or < 0 = off
|
// move rear mm in model view or < 0 = off
|
||||||
move_rear = 0; // [-1:100]
|
move_rear = 0; // [-1:100]
|
||||||
|
|
||||||
/* [Adjustments] */
|
/* [3D Case Adjustments] */
|
||||||
// base case design
|
|
||||||
case_design = "shell"; // [shell,panel,stacked,tray,round,hex,snap,fitted,paper_split-top]
|
|
||||||
// base case style
|
|
||||||
case_style = "none"; // ["none","vu5","vu7","sides"]
|
|
||||||
// single board computer model
|
|
||||||
sbc_model = "c1+"; // ["c1+", "c2", "c4", "hc4", "xu4", "xu4q", "mc1", "hc1", "n1", "n2", "n2+", "n2l", "n2lq", "m1", "m1s", "h2", "h2+", "h3", "h3+", "show2", "rpipico", "rpipicow", "rpicm4+ioboard", "rpicm1", "rpicm3", "rpicm3l", "rpicm3+", "rpicm4s", "rpicm4", "rpicm4l", "rpizero", "rpizerow", "rpizero2w", "rpi1a+", "rpi1b+", "rpi2b", "rpi3a+", "rpi3b", "rpi3b+", "rpi4b", "rpi5", "rock64", "rockpro64", "quartz64a", "quartz64b", "h64b", "star64", "rock4a", "rock4b", "rock4a+", "rock4b+", "rock4c", "rock4c+", "rock5b-v1.3", "rock5b", "rock5bq", "vim1", "vim2", "vim3", "vim3l", "vim4", "tinkerboard", "tinkerboard-s", "tinkerboard-2", "tinkerboard-2s", "tinkerboard-r2", "tinkerboard-r2s", "opizero", "opizero2", "opir1plus_lts", "opir1", "opi5", "jetsonnano", "lepotato", "sweetpotato", "tritium-h2+", "tritium-h3", "tritium-h5", "solitude", "alta", "atomicpi", "visionfive2", "visionfive2q", "licheerv+dock", "rak19007"]
|
|
||||||
// sbc location x axis
|
// sbc location x axis
|
||||||
pcb_loc_x = 0; //[0:.5:300]
|
pcb_loc_x = 0; //[0:.5:300]
|
||||||
// sbc location y axis
|
// sbc location y axis
|
||||||
@@ -121,6 +123,14 @@ top_ext_standoff = [5.75,18,2.5,10,4,4,0,1,0,4.5,5.1];
|
|||||||
// bottom case extended standoff - [diameter,height(not used),holesize,supportsize,supportheight,type(0=none, 1=countersink, 2=recessed, 3=nut holder, 4=blind),style(0=hex, 1=cylinder),reverse,insert,insert hole dia.,insert depth]
|
// bottom case extended standoff - [diameter,height(not used),holesize,supportsize,supportheight,type(0=none, 1=countersink, 2=recessed, 3=nut holder, 4=blind),style(0=hex, 1=cylinder),reverse,insert,insert hole dia.,insert depth]
|
||||||
bottom_ext_standoff = [5.75,5,3.6,10,4,1,0,0,0,4.5,5.1];
|
bottom_ext_standoff = [5.75,5,3.6,10,4,1,0,0,0,4.5,5.1];
|
||||||
|
|
||||||
|
/* [Folding Case Adjustments] */
|
||||||
|
//Material Thickness
|
||||||
|
material_thickness = .5; //[.1:.1:3]
|
||||||
|
// Bend Allowance
|
||||||
|
bend_allowance = 1; //[0:.01:5]
|
||||||
|
// Bottom clearence
|
||||||
|
bottom_clearence = 3.5; //[-10:.01:10]
|
||||||
|
|
||||||
/* [Features and Accessories] */
|
/* [Features and Accessories] */
|
||||||
// heatsink opening
|
// heatsink opening
|
||||||
cooling = "default"; // [default,none,open,fan_open,fan_1,fan_2,fan_hex,vent,vent_hex_5mm,vent_hex_8mm,custom]
|
cooling = "default"; // [default,none,open,fan_open,fan_1,fan_2,fan_hex,vent,vent_hex_5mm,vent_hex_8mm,custom]
|
||||||
@@ -138,6 +148,7 @@ sata_knockout = false;
|
|||||||
// case accessory group to load
|
// case accessory group to load
|
||||||
accessory_name = "none"; // ["none", "hk_uart", "c1+_shell_boombox", "c1+_panel_boombox", "c1+_panel_lcd3.5", "c1+_desktop_lcd3.5", "c1+_deskboom_lcd3.5", "c1+_tray_boombox", "c1+_round", "c1+_hex", "c2_shell_boombox", "c2_panel_boombox", "c2_panel_lcd3.5", "c2_desktop_lcd3.5", "c2_deskboom_lcd3.5", "c2_tray_boombox", "c2_round", "c2_hex", "c4_shell_boombox", "c4_panel_lcd3.5", "c4_desktop_lcd3.5", "c4_deskboom_lcd3.5", "c4_panel_boombox", "c4_tray_boombox", "c4_round", "c4_hex", "xu4_keyhole", "hc4_tray_drivebox2.5", "hc4_shell_drivebox2.5", "hc4_shell_drivebox2.5v", "hc4_shell_drivebox3.5", "n2l_tray", "n2l_gpio", "n2+_tray_vu7_fan", "m1s_shell", "m1s_shell_nvme", "m1s_shell_ups", "m1s_panel", "m1s_tray_nvme", "m1s_snap", "m1s_fitted", "m1_panel", "m1_tray", "m1_tray_ssd", "m1_tray_sides", "m1_tray_vu5", "m1_tray_vu7", "m1_fitted_drivebox2.5", "m1_fitted_drivebox3.5", "m1_fitted_pizzabox", "m1_fitted_drivebox3.5v", "h2_shell", "h2_shell_router", "h2_shell_router-ssd", "h2_lowboy", "h2_lowboy_router", "h2_tray", "h2_tray_sides", "h2_tray_router", "h2_router_station", "h2_round", "h2_hex", "h3_shell", "h3_lowboy", "h3_lowboy_router", "h3_tallboy", "h3_tallboy-ssd", "h3_ultimate", "h3_ultimate2", "h3_shell_drivebox2.5v", "show2_shell", "jetsonnano_shell", "jetsonnano_panel", "jetsonnano_stacked", "jetsonnano_tray", "jetsonnano_tray_sides", "jetsonnano_round", "jetsonnano_hex", "jetsonnano_snap", "jetsonnano_fitted", "rock64_round", "rock64_hex", "rockpro64_shell", "rockpro64_panel", "rockpro64_stacked", "rockpro64_tray", "rockpro64_tray_sides", "rockpro64_round", "rockpro64_hex", "rockpro64_snap", "rockpro64_fitted", "star64_shell", "rpi1b+_round", "rpi1b+_hex", "rpi3b_round", "rpi3b_hex", "rpi3b+_round", "rpi3b+_hex", "rpi4b_round", "rpi4b_hex", "rpi4b_shell_geeekpi_poe_hat", "rpi5_round", "rpi5_hex", "rock4b+_round", "rock4b+_hex", "rock4c_round", "rock4c_hex", "rock4c+_round", "rock4c+_hex", "rock5b", "rock5b_shell", "rock5bq", "rock5bq_shell", "rock5bq_tray", "rock5bq_tray_sides", "rock5bq_snap", "rock5bq_fitted", "rock5b-v1.3", "tinkerboard_round", "tinkerboard_hex", "tinkerboard-s_round", "tinkerboard-s_hex", "tinkerboard-2_round", "tinkerboard-2_hex", "tinkerboard-r2_round", "tinkerboard-r2_hex", "visonfive2_shell", "visonfive2_panel", "visonfive2_stacked", "visonfive2_tray", "visonfive2_snap", "visonfive2_fitted", "visonfive2q_shell", "visonfive2q_panel", "visonfive2q_stacked", "visonfive2q_tray", "visonfive2q_snap", "visonfive2q_fitted"]
|
accessory_name = "none"; // ["none", "hk_uart", "c1+_shell_boombox", "c1+_panel_boombox", "c1+_panel_lcd3.5", "c1+_desktop_lcd3.5", "c1+_deskboom_lcd3.5", "c1+_tray_boombox", "c1+_round", "c1+_hex", "c2_shell_boombox", "c2_panel_boombox", "c2_panel_lcd3.5", "c2_desktop_lcd3.5", "c2_deskboom_lcd3.5", "c2_tray_boombox", "c2_round", "c2_hex", "c4_shell_boombox", "c4_panel_lcd3.5", "c4_desktop_lcd3.5", "c4_deskboom_lcd3.5", "c4_panel_boombox", "c4_tray_boombox", "c4_round", "c4_hex", "xu4_keyhole", "hc4_tray_drivebox2.5", "hc4_shell_drivebox2.5", "hc4_shell_drivebox2.5v", "hc4_shell_drivebox3.5", "n2l_tray", "n2l_gpio", "n2+_tray_vu7_fan", "m1s_shell", "m1s_shell_nvme", "m1s_shell_ups", "m1s_panel", "m1s_tray_nvme", "m1s_snap", "m1s_fitted", "m1_panel", "m1_tray", "m1_tray_ssd", "m1_tray_sides", "m1_tray_vu5", "m1_tray_vu7", "m1_fitted_drivebox2.5", "m1_fitted_drivebox3.5", "m1_fitted_pizzabox", "m1_fitted_drivebox3.5v", "h2_shell", "h2_shell_router", "h2_shell_router-ssd", "h2_lowboy", "h2_lowboy_router", "h2_tray", "h2_tray_sides", "h2_tray_router", "h2_router_station", "h2_round", "h2_hex", "h3_shell", "h3_lowboy", "h3_lowboy_router", "h3_tallboy", "h3_tallboy-ssd", "h3_ultimate", "h3_ultimate2", "h3_shell_drivebox2.5v", "show2_shell", "jetsonnano_shell", "jetsonnano_panel", "jetsonnano_stacked", "jetsonnano_tray", "jetsonnano_tray_sides", "jetsonnano_round", "jetsonnano_hex", "jetsonnano_snap", "jetsonnano_fitted", "rock64_round", "rock64_hex", "rockpro64_shell", "rockpro64_panel", "rockpro64_stacked", "rockpro64_tray", "rockpro64_tray_sides", "rockpro64_round", "rockpro64_hex", "rockpro64_snap", "rockpro64_fitted", "star64_shell", "rpi1b+_round", "rpi1b+_hex", "rpi3b_round", "rpi3b_hex", "rpi3b+_round", "rpi3b+_hex", "rpi4b_round", "rpi4b_hex", "rpi4b_shell_geeekpi_poe_hat", "rpi5_round", "rpi5_hex", "rock4b+_round", "rock4b+_hex", "rock4c_round", "rock4c_hex", "rock4c+_round", "rock4c+_hex", "rock5b", "rock5b_shell", "rock5bq", "rock5bq_shell", "rock5bq_tray", "rock5bq_tray_sides", "rock5bq_snap", "rock5bq_fitted", "rock5b-v1.3", "tinkerboard_round", "tinkerboard_hex", "tinkerboard-s_round", "tinkerboard-s_hex", "tinkerboard-2_round", "tinkerboard-2_hex", "tinkerboard-r2_round", "tinkerboard-r2_hex", "visonfive2_shell", "visonfive2_panel", "visonfive2_stacked", "visonfive2_tray", "visonfive2_snap", "visonfive2_fitted", "visonfive2q_shell", "visonfive2q_panel", "visonfive2q_stacked", "visonfive2q_tray", "visonfive2q_snap", "visonfive2q_fitted"]
|
||||||
|
|
||||||
|
|
||||||
a = search([accessory_name],accessory_data);
|
a = search([accessory_name],accessory_data);
|
||||||
s = search([sbc_model],sbc_data);
|
s = search([sbc_model],sbc_data);
|
||||||
|
|
||||||
@@ -158,7 +169,6 @@ case_z = bottom_height+top_height;
|
|||||||
case_diameter = sqrt(pow(width-wallthick-gap,2)+pow(depth-wallthick-gap,2));
|
case_diameter = sqrt(pow(width-wallthick-gap,2)+pow(depth-wallthick-gap,2));
|
||||||
hex_diameter = sqrt(pow(width+2*(wallthick+gap),2)+pow(depth+2*(wallthick+gap),2));
|
hex_diameter = sqrt(pow(width+2*(wallthick+gap),2)+pow(depth+2*(wallthick+gap),2));
|
||||||
|
|
||||||
|
|
||||||
/* [Hidden] */
|
/* [Hidden] */
|
||||||
adj = .01;
|
adj = .01;
|
||||||
$fn=90;
|
$fn=90;
|
||||||
@@ -641,7 +651,7 @@ if (view == "part") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (view == "folded") {
|
if (view == "folded") {
|
||||||
if(case_design == "paper_split-top") {
|
if(case_design == "paper") {
|
||||||
case_folded(case_design);
|
case_folded(case_design, case_style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user