created ui enable for individual top, bottom and extended standoffs with associated plumbing

This commit is contained in:
Edward Kisiel
2024-02-26 13:22:57 -05:00
parent d5d23fba18
commit e46ac774e4
3 changed files with 121 additions and 77 deletions

View File

@@ -332,7 +332,7 @@ module case_bottom(case_design) {
}
}
// pcb standoff holes
if(sbc_bottom_standoffs == true && bottom_standoff[5] != 4) {
if(sbc_bottom_standoffs == true) {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
@@ -343,10 +343,23 @@ module case_bottom(case_design) {
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if(class == "pcbhole" && id == pcb_id && (pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" ||
pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=6.5, h=bottom_height);
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_rear" &&
bottom_rear_left_enable == true && bottom_standoff[5] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=6.5, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_front" &&
bottom_front_left_enable == true && bottom_standoff[5] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=6.5, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_rear" &&
bottom_rear_right_enable == true && bottom_standoff[5] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=6.5, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_front" &&
bottom_front_right_enable == true && bottom_standoff[5] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=6.5, h=bottom_height);
}
}
}
@@ -354,27 +367,30 @@ module case_bottom(case_design) {
// extended standoff holes
if(ext_bottom_standoffs == true) {
// right-rear standoff
if(width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) {
if(((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10)) &&
ext_bottom_rear_right_enable == true && ext_bottom_standoff[5] != "blind") {
translate([width-ext_bottom_standoff_support_size/4-(2*(wallthick+gap))-(corner_fillet/2),
(corner_fillet/2)+ext_bottom_standoff_support_size/4,-1]) cylinder(d=6.5, h=bottom_height);
}
// right-front standoff
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth >= 10) ||
if(((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth >= 10) ||
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth <= 10) ||
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) <= 10 && depth-pcb_loc_y-pcb_depth >= 10)) {
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) <= 10 && depth-pcb_loc_y-pcb_depth >= 10)) &&
ext_bottom_front_right_enable == true && ext_bottom_standoff[5] != "blind") {
translate([width-ext_bottom_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)),
depth-ext_bottom_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)),-1])
cylinder(d=6.5, h=bottom_height);
}
// left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
if((pcb_loc_x >= 10 || pcb_loc_y >= 10) && ext_bottom_rear_left_enable == true && ext_bottom_standoff[5] != "blind") {
translate([(corner_fillet/2)+ext_bottom_standoff_support_size/4,
(corner_fillet/2)+ext_bottom_standoff_support_size/4,-1]) cylinder(d=6.5, h=bottom_height);
}
// left-front standoff
if((pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
if(((pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
(pcb_loc_x <= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) <= 10) {
(pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) <= 10)) &&
ext_bottom_front_left_enable == true && ext_bottom_standoff[5] != "blind") {
translate([(corner_fillet/2)+ext_bottom_standoff_support_size/4,
depth-ext_bottom_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)),-1])
cylinder(d=6.5, h=bottom_height);
@@ -393,8 +409,9 @@ module case_bottom(case_design) {
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if(class == "pcbhole" && id == pcb_id && (pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" || pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
if (pcbhole_pos == "left_rear") {
if(class == "pcbhole" && id == pcb_id &&
(pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" || pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
if (pcbhole_pos == "left_rear" && bottom_rear_left_enable == true) {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_left_adjust,
bottom_standoff[2],
@@ -409,7 +426,7 @@ module case_bottom(case_design) {
bottom_standoff[11]];
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
}
if (pcbhole_pos == "left_front") {
if (pcbhole_pos == "left_front" && bottom_front_left_enable == true) {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_front_left_adjust,
bottom_standoff[2],
@@ -424,7 +441,7 @@ module case_bottom(case_design) {
bottom_standoff[11]];
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
}
if (pcbhole_pos == "right_rear") {
if (pcbhole_pos == "right_rear" && bottom_rear_right_enable == true) {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_right_adjust,
bottom_standoff[2],
@@ -439,7 +456,7 @@ module case_bottom(case_design) {
bottom_standoff[11]];
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
}
if (pcbhole_pos == "right_front") {
if (pcbhole_pos == "right_front" && bottom_front_right_enable == true) {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_front_right_adjust,
bottom_standoff[2],
@@ -461,7 +478,7 @@ module case_bottom(case_design) {
// extended standoffs
if(ext_bottom_standoffs == true) {
// extended right-rear standoff
if(width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) {
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) && ext_bottom_rear_right_enable == true) {
normal_standoff = [ext_bottom_standoff[0],
bottom_height+pcb_loc_z+ext_bottom_rear_right_adjust,
ext_bottom_standoff[2],
@@ -478,9 +495,10 @@ module case_bottom(case_design) {
(corner_fillet/2)+ext_top_standoff_support_size/4,0]) standoff(normal_standoff);
}
// extended right-front standoff
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth >= 10) ||
if(((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth >= 10) ||
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth <= 10) ||
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) <= 10 && depth-pcb_loc_y-pcb_depth >= 10)) {
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) <= 10 && depth-pcb_loc_y-pcb_depth >= 10)) &&
ext_bottom_front_right_enable == true) {
normal_standoff = [ext_bottom_standoff[0],
bottom_height+pcb_loc_z+ext_bottom_front_right_adjust,
ext_bottom_standoff[2],
@@ -497,7 +515,7 @@ module case_bottom(case_design) {
depth-ext_top_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)),0]) standoff(normal_standoff);
}
// extended left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
if((pcb_loc_x >= 10 || pcb_loc_y >= 10) && ext_bottom_rear_left_enable == true) {
normal_standoff = [ext_bottom_standoff[0],
bottom_height+pcb_loc_z+ext_bottom_rear_left_adjust,
ext_bottom_standoff[2],
@@ -514,9 +532,11 @@ module case_bottom(case_design) {
(corner_fillet/2)+ext_top_standoff_support_size/4,0]) standoff(normal_standoff);
}
// extended left-front standoff
if((pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
(pcb_loc_x <= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) <= 10) {
if(((pcb_loc_x >= 10 && depth-(pcb_loc_y+pcb_depth) >= 10) ||
(pcb_loc_x <= 10 && depth-(pcb_loc_y+pcb_depth) >= 10) ||
(pcb_loc_x >= 10 && depth-(pcb_loc_y+pcb_depth) <= 10)) &&
ext_bottom_front_left_enable == true) {
echo(ext_bottom_front_left_enable);
normal_standoff = [ext_bottom_standoff[0],
bottom_height+pcb_loc_z+ext_bottom_front_left_adjust,
ext_bottom_standoff[2],

View File

@@ -272,7 +272,7 @@ module case_top(case_design) {
}
}
// pcb standoff holes
if(sbc_top_standoffs == true && top_standoff[5] != 4) {
if(sbc_top_standoffs == true) {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
@@ -283,9 +283,16 @@ module case_top(case_design) {
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if (class == "pcbhole" && id == pcb_id &&
(pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" ||
pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_rear" && top_rear_left_enable == true && top_standoff[5] != "blind") {
translate([pcbhole_x,pcbhole_y,top_height+1]) cylinder(d=6.5, h=top_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_front" && top_front_left_enable == true && top_standoff[5] != "blind") {
translate([pcbhole_x,pcbhole_y,top_height+1]) cylinder(d=6.5, h=top_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_rear" && top_rear_right_enable == true && top_standoff[5] != "blind") {
translate([pcbhole_x,pcbhole_y,top_height+1]) cylinder(d=6.5, h=top_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_front" && top_front_right_enable == true && top_standoff[5] != "blind") {
translate([pcbhole_x,pcbhole_y,top_height+1]) cylinder(d=6.5, h=top_height);
}
}
@@ -293,27 +300,30 @@ module case_top(case_design) {
// extended standoff holes
if(ext_top_standoffs == true) {
// right-rear standoff
if(width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) {
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) &&
ext_top_rear_right_enable == true && ext_top_standoff[5] != "blind") {
translate([width-ext_top_standoff_support_size/4-(2*(wallthick+gap))-(corner_fillet/2),
(corner_fillet/2)+ext_top_standoff_support_size/4,top_height+1]) cylinder(d=6.5, h=top_height);
}
// right-front standoff
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth >= 10) ||
if(((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth >= 10) ||
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth <= 10) ||
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) <= 10 && depth-pcb_loc_y-pcb_depth >= 10)) {
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) <= 10 && depth-pcb_loc_y-pcb_depth >= 10)) &&
ext_top_front_right_enable == true && ext_top_standoff[5] != "blind") {
translate([width-ext_top_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)),
depth-ext_top_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)),top_height+1])
cylinder(d=6.5, h=top_height);
}
// left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
if((pcb_loc_x >= 10 || pcb_loc_y >= 10) && ext_top_rear_left_enable == true && ext_top_standoff[5] != "blind") {
translate([(corner_fillet/2)+ext_top_standoff_support_size/4,
(corner_fillet/2)+ext_top_standoff_support_size/4,top_height+1]) cylinder(d=6.5, h=top_height);
}
// left-front standoff
if((pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
if(((pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
(pcb_loc_x <= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) <= 10) {
(pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) <= 10)) &&
ext_top_front_left_enable == true && ext_top_standoff[5] != "blind") {
translate([+(corner_fillet/2)+ext_top_standoff_support_size/4,
depth-ext_top_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)),top_height+1])
cylinder(d=6.5, h=top_height+1);
@@ -335,7 +345,7 @@ module case_top(case_design) {
if(class == "pcbhole" && id == pcb_id &&
(pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" || pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
if (pcbhole_pos == "left_rear") {
if (pcbhole_pos == "left_rear" && top_rear_left_enable == true) {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_rear_left_adjust,
top_standoff[2],
@@ -350,7 +360,7 @@ module case_top(case_design) {
top_standoff[11]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
}
if (pcbhole_pos == "left_front") {
if (pcbhole_pos == "left_front" && top_front_left_enable == true) {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_front_left_adjust,
top_standoff[2],
@@ -365,7 +375,7 @@ module case_top(case_design) {
top_standoff[11]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
}
if (pcbhole_pos == "right_rear") {
if (pcbhole_pos == "right_rear" && top_rear_right_enable == true) {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_rear_right_adjust,
top_standoff[2],
@@ -380,7 +390,7 @@ module case_top(case_design) {
top_standoff[11]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
}
if (pcbhole_pos == "right_front") {
if (pcbhole_pos == "right_front" && top_front_right_enable == true) {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_front_right_adjust,
top_standoff[2],
@@ -401,7 +411,7 @@ module case_top(case_design) {
// extended standoffs
if(ext_top_standoffs == true) {
// extended right-rear standoff
if(width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) {
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) && ext_top_rear_right_enable == true) {
normal_standoff = [ext_top_standoff[0],
top_height+pcb_loc_z+ext_top_rear_right_adjust,
ext_top_standoff[2],
@@ -418,9 +428,10 @@ module case_top(case_design) {
(corner_fillet/2)+ext_top_standoff_support_size/4,case_z]) standoff(normal_standoff);
}
// extended right-front standoff
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth >= 10) ||
if(((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth >= 10) ||
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 && depth-pcb_loc_y-pcb_depth <= 10) ||
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) <= 10 && depth-pcb_loc_y-pcb_depth >= 10)) {
(width-pcb_loc_x-pcb_width-(gap+2*wallthick) <= 10 && depth-pcb_loc_y-pcb_depth >= 10)) &&
ext_top_front_right_enable == true) {
normal_standoff = [ext_top_standoff[0],
top_height+pcb_loc_z+ext_top_front_right_adjust,
ext_top_standoff[2],
@@ -438,7 +449,7 @@ module case_top(case_design) {
standoff(normal_standoff);
}
// extended left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
if((pcb_loc_x >= 10 || pcb_loc_y >= 10) && ext_top_rear_left_enable == true) {
normal_standoff = [ext_top_standoff[0],
top_height+pcb_loc_z+ext_top_rear_left_adjust,
ext_top_standoff[2],
@@ -455,9 +466,10 @@ module case_top(case_design) {
(corner_fillet/2)+ext_top_standoff_support_size/4,case_z]) standoff(normal_standoff);
}
// extended left-front standoff
if((pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
if(((pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
(pcb_loc_x <= 10 && (depth-(pcb_loc_y+pcb_depth)) >= 10) ||
pcb_loc_x >= 10 && (depth-(pcb_loc_y+pcb_depth)) <= 10) {
(pcb_loc_x >= 10 && depth-(pcb_loc_y+pcb_depth) <= 10)) &&
ext_top_front_left_enable == true) {
normal_standoff = [ext_top_standoff[0],
top_height+pcb_loc_z+ext_top_front_left_adjust,
ext_top_standoff[2],