more rack bay work, fixes and code cleanup

This commit is contained in:
Edward Kisiel
2025-05-06 17:11:43 -04:00
parent 63ea4bae0b
commit 5b03cd94fc
3 changed files with 380 additions and 348 deletions

View File

@@ -17,7 +17,7 @@
NAME: case_rack NAME: case_rack
DESCRIPTION: creates a U1-U4 rack case DESCRIPTION: creates a 1u-2u rack case
TODO: none TODO: none
USAGE: case_rack(case_design,side) USAGE: case_rack(case_design,side)
@@ -177,106 +177,110 @@ if(side == "bottom") {
cylinder(d=4*2/sqrt(3), h=2); cylinder(d=4*2/sqrt(3), h=2);
for(r = [0:len(rack_bay_sbc)-1]) { for(r = [0:len(rack_bay_sbc)-1]) {
s = search([rack_bay_sbc[r]],sbc_data); if(rack_bay_sbc[r] != "empty") {
pcb_id = sbc_data[s[0]][4]; s = search([rack_bay_sbc[r]],sbc_data);
pcb_width = sbc_data[s[0]][10][0]; pcb_id = sbc_data[s[0]][4];
pcb_depth = sbc_data[s[0]][10][1]; pcb_width = sbc_data[s[0]][10][0];
pcb_z_orig = sbc_data[s[0]][10][2]; pcb_depth = sbc_data[s[0]][10][1];
pcb_tmaxz = sbc_data[s[0]][11][5]; pcb_z_orig = sbc_data[s[0]][10][2];
pcb_bmaxz = sbc_data[s[0]][11][6]; pcb_tmaxz = sbc_data[s[0]][11][5];
pcb_color = sbc_data[s[0]][11][1]; pcb_bmaxz = sbc_data[s[0]][11][6];
pcb_radius = sbc_data[s[0]][11][0]; pcb_color = sbc_data[s[0]][11][1];
pcb_radius = sbc_data[s[0]][11][0];
pcb_loc_x = rack_bay_rotation[r] == 90 ? rack_bay_xyz_loc[r][0] + pcb_width : rack_bay_rotation[r] == 180 ? rack_bay_xyz_loc[r][0] + pcb_width : rack_bay_xyz_loc[r][0]; pcb_loc_x = rack_bay_rotation[r] == 90 ? rack_bay_xyz_loc[r][0] + pcb_width : rack_bay_rotation[r] == 180 ? rack_bay_xyz_loc[r][0] + pcb_width : rack_bay_xyz_loc[r][0];
pcb_loc_y = rack_bay_rotation[r] == 270 ? rack_bay_xyz_loc[r][1]+pcb_width : rack_bay_rotation[r] == 180 ? rack_bay_xyz_loc[r][1]+pcb_depth : rack_bay_xyz_loc[r][1]; pcb_loc_y = rack_bay_rotation[r] == 270 ? rack_bay_xyz_loc[r][1]+pcb_width : rack_bay_rotation[r] == 180 ? rack_bay_xyz_loc[r][1]+pcb_depth : rack_bay_xyz_loc[r][1];
pcb_loc_z = rack_bay_xyz_loc[r][2]; pcb_loc_z = rack_bay_xyz_loc[r][2];
translate([pcb_loc_x,pcb_loc_y,pcb_loc_z]) rotate([0,0,rack_bay_rotation[r]]) union() {
// pcb standoff holes
if(sbc_bottom_standoffs == true && rack_bay_sbc[r] != "empty") {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4];
pcbhole_y = sbc_data[s[0]][i+5];
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if (class == "pcbhole" && id == 0 && pcbhole_pos == "left_rear" && translate([pcb_loc_x,pcb_loc_y,pcb_loc_z]) rotate([0,0,rack_bay_rotation[r]]) union() {
bottom_rear_left_enable == true && bottom_standoff[6] != "blind") { // pcb standoff holes
translate([pcbhole_x,pcbhole_y,-adj]) if(sbc_bottom_standoffs == true && rack_bay_sbc[r] != "empty") {
cylinder(d=bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
if (class == "pcbhole" && id == 0 && pcbhole_pos == "left_front" &&
bottom_front_left_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
if (class == "pcbhole" && id == 0 && pcbhole_pos == "right_rear" &&
bottom_rear_right_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
if (class == "pcbhole" && id == 0 && pcbhole_pos == "right_front" &&
bottom_front_right_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
}
}
// multi-pcb standoff holes
if(multipcb_bottom_standoffs == true && rack_bay_sbc[r] != "empty") {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
pcbid = sbc_data[s[0]][i+3];
pcbloc_x = sbc_data[s[0]][i+4];
pcbloc_y = sbc_data[s[0]][i+5];
pcbloc_z = sbc_data[s[0]][i+6];
if(class == "pcb") {
for (i=[1:11:len(sbc_data[s[0]])-2]) { for (i=[1:11:len(sbc_data[s[0]])-2]) {
pcbclass = sbc_data[s[0]][i+1]; class = sbc_data[s[0]][i+1];
pcbtype = sbc_data[s[0]][i+2]; type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3]; id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcbloc_x; pcbhole_x = sbc_data[s[0]][i+4];
pcbhole_y = sbc_data[s[0]][i+5]+pcbloc_y; pcbhole_y = sbc_data[s[0]][i+5];
pcbhole_z = sbc_data[s[0]][i+6]; pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0]; pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_state = sbc_data[s[0]][i+10][0];
pcbhole_pos = sbc_data[s[0]][i+10][4]; pcbhole_pos = sbc_data[s[0]][i+10][4];
if(id == pcbid && id != 0 && pcbclass == "pcbhole") {
if (pcbclass == "pcbhole" && pcbhole_pos == "left_rear" && if (class == "pcbhole" && id == 0 && pcbhole_pos == "left_rear" &&
multipcb_bottom_rear_left_enable == true && bottom_rear_left_enable == true && bottom_standoff[6] != "blind") {
(pcbhole_state == "bottom" || pcbhole_state == "both")) {
translate([pcbhole_x,pcbhole_y,-adj]) translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=multipcb_bottom_standoff[4]-.2, h=floorthick+(2*adj)); cylinder(d=bottom_standoff[4]-.2, h=floorthick+(2*adj));
} }
if (pcbclass == "pcbhole" && pcbhole_pos == "left_front" && if (class == "pcbhole" && id == 0 && pcbhole_pos == "left_front" &&
multipcb_bottom_front_left_enable == true && bottom_front_left_enable == true && bottom_standoff[6] != "blind") {
(pcbhole_state == "bottom" || pcbhole_state == "both")) {
translate([pcbhole_x,pcbhole_y,-adj]) translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=multipcb_bottom_standoff[4]-.2, h=floorthick+(2*adj)); cylinder(d=bottom_standoff[4]-.2, h=floorthick+(2*adj));
} }
if (pcbclass == "pcbhole" && pcbhole_pos == "right_rear" && if (class == "pcbhole" && id == 0 && pcbhole_pos == "right_rear" &&
multipcb_bottom_rear_right_enable == true && bottom_rear_right_enable == true && bottom_standoff[6] != "blind") {
(pcbhole_state == "bottom" || pcbhole_state == "both")) {
translate([pcbhole_x,pcbhole_y,-adj]) translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=multipcb_bottom_standoff[4]-.2, h=floorthick+(2*adj)); cylinder(d=bottom_standoff[4]-.2, h=floorthick+(2*adj));
} }
if (pcbclass == "pcbhole" && pcbhole_pos == "right_front" && if (class == "pcbhole" && id == 0 && pcbhole_pos == "right_front" &&
multipcb_bottom_front_right_enable == true && bottom_front_right_enable == true && bottom_standoff[6] != "blind") {
(pcbhole_state == "bottom" || pcbhole_state == "both")) {
translate([pcbhole_x,pcbhole_y,-adj]) translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=multipcb_bottom_standoff[4]-.2, h=floorthick+(2*adj)); cylinder(d=bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
}
}
// multi-pcb standoff holes
if(multipcb_bottom_standoffs == true && rack_bay_sbc[r] != "empty") {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
pcbid = sbc_data[s[0]][i+3];
pcbloc_x = sbc_data[s[0]][i+4];
pcbloc_y = sbc_data[s[0]][i+5];
pcbloc_z = sbc_data[s[0]][i+6];
if(class == "pcb") {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
pcbclass = sbc_data[s[0]][i+1];
pcbtype = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcbloc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcbloc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_state = sbc_data[s[0]][i+10][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if(id == pcbid && id != 0 && pcbclass == "pcbhole") {
if (pcbclass == "pcbhole" && pcbhole_pos == "left_rear" &&
multipcb_bottom_rear_left_enable == true &&
(pcbhole_state == "bottom" || pcbhole_state == "both")) {
translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=multipcb_bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
if (pcbclass == "pcbhole" && pcbhole_pos == "left_front" &&
multipcb_bottom_front_left_enable == true &&
(pcbhole_state == "bottom" || pcbhole_state == "both")) {
translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=multipcb_bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
if (pcbclass == "pcbhole" && pcbhole_pos == "right_rear" &&
multipcb_bottom_rear_right_enable == true &&
(pcbhole_state == "bottom" || pcbhole_state == "both")) {
translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=multipcb_bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
if (pcbclass == "pcbhole" && pcbhole_pos == "right_front" &&
multipcb_bottom_front_right_enable == true &&
(pcbhole_state == "bottom" || pcbhole_state == "both")) {
translate([pcbhole_x,pcbhole_y,-adj])
cylinder(d=multipcb_bottom_standoff[4]-.2, h=floorthick+(2*adj));
}
}
} }
} }
} }
} }
} }
} }
} } }
// extended standoff holes // extended standoff holes
if(ext_bottom_standoffs == true) { if(ext_bottom_standoffs == true) {
// right-rear standoff // right-rear standoff
@@ -345,212 +349,216 @@ if(side == "bottom") {
} }
} }
for(r = [0:len(rack_bay_sbc)-1]) { for(r = [0:len(rack_bay_sbc)-1]) {
s = search([rack_bay_sbc[r]],sbc_data); if(rack_bay_sbc[r] != "empty") {
pcb_id = sbc_data[s[0]][4]; s = search([rack_bay_sbc[r]],sbc_data);
pcb_width = sbc_data[s[0]][10][0]; pcb_id = sbc_data[s[0]][4];
pcb_depth = sbc_data[s[0]][10][1]; pcb_width = sbc_data[s[0]][10][0];
pcb_z_orig = sbc_data[s[0]][10][2]; pcb_depth = sbc_data[s[0]][10][1];
pcb_tmaxz = sbc_data[s[0]][11][5]; pcb_z_orig = sbc_data[s[0]][10][2];
pcb_bmaxz = sbc_data[s[0]][11][6]; pcb_tmaxz = sbc_data[s[0]][11][5];
pcb_color = sbc_data[s[0]][11][1]; pcb_bmaxz = sbc_data[s[0]][11][6];
pcb_radius = sbc_data[s[0]][11][0]; pcb_color = sbc_data[s[0]][11][1];
pcb_radius = sbc_data[s[0]][11][0];
pcb_loc_x = rack_bay_rotation[r] == 90 ? rack_bay_xyz_loc[r][0] + pcb_width : rack_bay_rotation[r] == 180 ? rack_bay_xyz_loc[r][0] + pcb_width : rack_bay_xyz_loc[r][0]; pcb_loc_x = rack_bay_rotation[r] == 90 ? rack_bay_xyz_loc[r][0] + pcb_width : rack_bay_rotation[r] == 180 ? rack_bay_xyz_loc[r][0] + pcb_width : rack_bay_xyz_loc[r][0];
pcb_loc_y = rack_bay_rotation[r] == 270 ? rack_bay_xyz_loc[r][1]+pcb_width : rack_bay_rotation[r] == 180 ? rack_bay_xyz_loc[r][1]+pcb_depth : rack_bay_xyz_loc[r][1]; pcb_loc_y = rack_bay_rotation[r] == 270 ? rack_bay_xyz_loc[r][1]+pcb_width : rack_bay_rotation[r] == 180 ? rack_bay_xyz_loc[r][1]+pcb_depth : rack_bay_xyz_loc[r][1];
pcb_loc_z = rack_bay_xyz_loc[r][2]; pcb_loc_z = rack_bay_xyz_loc[r][2];
translate([pcb_loc_x,pcb_loc_y,pcb_loc_z]) rotate([0,0,rack_bay_rotation[r]]) union() {
// primary pcb standoffs
if(sbc_bottom_standoffs == true && rack_bay_sbc[r] != "empty") {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4];
pcbhole_y = sbc_data[s[0]][i+5];
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if(class == "pcbhole" && id == pcb_id) { translate([pcb_loc_x,pcb_loc_y,pcb_loc_z]) rotate([0,0,rack_bay_rotation[r]]) union() {
if (pcbhole_pos == "left_rear" && bottom_rear_left_enable == true) { // primary pcb standoffs
bottom_support = bottom_sidewall_support == true ? bottom_rear_left_support : "none"; if(sbc_bottom_standoffs == true) {
pcb_standoff = [bottom_standoff[0], for (i=[1:11:len(sbc_data[s[0]])-2]) {
bottom_standoff[1], class = sbc_data[s[0]][i+1];
bottom_height-pcb_z+pcb_loc_z+bottom_rear_left_adjust, type = sbc_data[s[0]][i+2];
bottom_standoff[3], id = sbc_data[s[0]][i+3];
bottom_standoff[4], pcbhole_x = sbc_data[s[0]][i+4];
bottom_standoff[5], pcbhole_y = sbc_data[s[0]][i+5];
bottom_standoff[6], pcbhole_z = sbc_data[s[0]][i+6];
bottom_standoff[7], pcbhole_size = sbc_data[s[0]][i+9][0];
bottom_support, pcbhole_pos = sbc_data[s[0]][i+10][4];
bottom_standoff[9],
bottom_standoff[10], if(class == "pcbhole" && id == pcb_id) {
bottom_standoff[11], if (pcbhole_pos == "left_rear" && bottom_rear_left_enable == true) {
bottom_standoff[12]]; bottom_support = bottom_sidewall_support == true ? bottom_rear_left_support : "none";
translate([pcbhole_x,pcbhole_y,0]) pcb_standoff = [bottom_standoff[0],
standoff(pcb_standoff,[false,10,2,"default"]); bottom_standoff[1],
} bottom_height-pcb_z+pcb_loc_z+bottom_rear_left_adjust,
if (pcbhole_pos == "left_front" && bottom_front_left_enable == true) { bottom_standoff[3],
bottom_support = bottom_sidewall_support == true ? bottom_front_left_support : "none"; bottom_standoff[4],
pcb_standoff = [bottom_standoff[0], bottom_standoff[5],
bottom_standoff[1], bottom_standoff[6],
bottom_height-pcb_z+pcb_loc_z+bottom_front_left_adjust, bottom_standoff[7],
bottom_standoff[3], bottom_support,
bottom_standoff[4], bottom_standoff[9],
bottom_standoff[5], bottom_standoff[10],
bottom_standoff[6], bottom_standoff[11],
bottom_standoff[7], bottom_standoff[12]];
bottom_support, translate([pcbhole_x,pcbhole_y,0])
bottom_standoff[9], standoff(pcb_standoff,[false,10,2,"default"]);
bottom_standoff[10], }
bottom_standoff[11], if (pcbhole_pos == "left_front" && bottom_front_left_enable == true) {
bottom_standoff[12]]; bottom_support = bottom_sidewall_support == true ? bottom_front_left_support : "none";
translate([pcbhole_x,pcbhole_y,0]) pcb_standoff = [bottom_standoff[0],
standoff(pcb_standoff,[false,10,2,"default"]); bottom_standoff[1],
} bottom_height-pcb_z+pcb_loc_z+bottom_front_left_adjust,
if (pcbhole_pos == "right_rear" && bottom_rear_right_enable == true) { bottom_standoff[3],
bottom_support = bottom_sidewall_support == true ? bottom_rear_right_support : "none"; bottom_standoff[4],
pcb_standoff = [bottom_standoff[0], bottom_standoff[5],
bottom_standoff[1], bottom_standoff[6],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_right_adjust, bottom_standoff[7],
bottom_standoff[3], bottom_support,
bottom_standoff[4], bottom_standoff[9],
bottom_standoff[5], bottom_standoff[10],
bottom_standoff[6], bottom_standoff[11],
bottom_standoff[7], bottom_standoff[12]];
bottom_support, translate([pcbhole_x,pcbhole_y,0])
bottom_standoff[9], standoff(pcb_standoff,[false,10,2,"default"]);
bottom_standoff[10], }
bottom_standoff[11], if (pcbhole_pos == "right_rear" && bottom_rear_right_enable == true) {
bottom_standoff[12]]; bottom_support = bottom_sidewall_support == true ? bottom_rear_right_support : "none";
translate([pcbhole_x,pcbhole_y,0]) pcb_standoff = [bottom_standoff[0],
standoff(pcb_standoff,[false,10,2,"default"]); bottom_standoff[1],
} bottom_height-pcb_z+pcb_loc_z+bottom_rear_right_adjust,
if (pcbhole_pos == "right_front" && bottom_front_right_enable == true) { bottom_standoff[3],
bottom_support = bottom_sidewall_support == true ? bottom_front_right_support : "none"; bottom_standoff[4],
pcb_standoff = [bottom_standoff[0], bottom_standoff[5],
bottom_standoff[1], bottom_standoff[6],
bottom_height-pcb_z+pcb_loc_z+bottom_front_right_adjust, bottom_standoff[7],
bottom_standoff[3], bottom_support,
bottom_standoff[4], bottom_standoff[9],
bottom_standoff[5], bottom_standoff[10],
bottom_standoff[6], bottom_standoff[11],
bottom_standoff[7], bottom_standoff[12]];
bottom_support, translate([pcbhole_x,pcbhole_y,0])
bottom_standoff[9], standoff(pcb_standoff,[false,10,2,"default"]);
bottom_standoff[10], }
bottom_standoff[11], if (pcbhole_pos == "right_front" && bottom_front_right_enable == true) {
bottom_standoff[12]]; bottom_support = bottom_sidewall_support == true ? bottom_front_right_support : "none";
translate([pcbhole_x,pcbhole_y,0]) pcb_standoff = [bottom_standoff[0],
standoff(pcb_standoff,[false,10,2,"default"]); bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+bottom_front_right_adjust,
bottom_standoff[3],
bottom_standoff[4],
bottom_standoff[5],
bottom_standoff[6],
bottom_standoff[7],
bottom_support,
bottom_standoff[9],
bottom_standoff[10],
bottom_standoff[11],
bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0])
standoff(pcb_standoff,[false,10,2,"default"]);
}
}
} }
} }
} // multi-pcb standoffs
} if(multipcb_bottom_standoffs == true && rack_bay_sbc[r] != "empty") {
// multi-pcb standoffs
if(multipcb_bottom_standoffs == true && rack_bay_sbc[r] != "empty") {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2];
pcbid = sbc_data[s[0]][i+3];
pcbloc_x = sbc_data[s[0]][i+4];
pcbloc_y = sbc_data[s[0]][i+5];
pcbloc_z = sbc_data[s[0]][i+6];
if(class == "pcb") {
for (i=[1:11:len(sbc_data[s[0]])-2]) { for (i=[1:11:len(sbc_data[s[0]])-2]) {
pcbclass = sbc_data[s[0]][i+1]; class = sbc_data[s[0]][i+1];
pcbtype = sbc_data[s[0]][i+2]; type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3]; pcbid = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcbloc_x; pcbloc_x = sbc_data[s[0]][i+4];
pcbhole_y = sbc_data[s[0]][i+5]+pcbloc_y; pcbloc_y = sbc_data[s[0]][i+5];
pcbhole_z = sbc_data[s[0]][i+6]; pcbloc_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0]; if(class == "pcb") {
pcbhole_state = sbc_data[s[0]][i+10][0]; for (i=[1:11:len(sbc_data[s[0]])-2]) {
pcbhole_pos = sbc_data[s[0]][i+10][4]; pcbclass = sbc_data[s[0]][i+1];
pcbtype = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcbloc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcbloc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcbhole_state = sbc_data[s[0]][i+10][0];
pcbhole_pos = sbc_data[s[0]][i+10][4];
if(pcbclass == "pcbhole" && pcbid == id && id != 0) { if(pcbclass == "pcbhole" && pcbid == id && id != 0) {
if (pcbhole_pos == "left_rear" && multipcb_bottom_rear_left_enable == true && if (pcbhole_pos == "left_rear" && multipcb_bottom_rear_left_enable == true &&
(pcbhole_state == "bottom" || pcbhole_state == "both")) { (pcbhole_state == "bottom" || pcbhole_state == "both")) {
bottom_support = multipcb_bottom_sidewall_support == true ? multipcb_bottom_rear_left_support : "none"; bottom_support = multipcb_bottom_sidewall_support == true ? multipcb_bottom_rear_left_support : "none";
pcb_standoff = [multipcb_bottom_standoff[0], pcb_standoff = [multipcb_bottom_standoff[0],
multipcb_bottom_standoff[1], multipcb_bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+multipcb_bottom_rear_left_adjust, bottom_height-pcb_z+pcb_loc_z+multipcb_bottom_rear_left_adjust,
multipcb_bottom_standoff[3], multipcb_bottom_standoff[3],
multipcb_bottom_standoff[4], multipcb_bottom_standoff[4],
multipcb_bottom_standoff[5], multipcb_bottom_standoff[5],
multipcb_bottom_standoff[6], multipcb_bottom_standoff[6],
multipcb_bottom_standoff[7], multipcb_bottom_standoff[7],
bottom_support, bottom_support,
multipcb_bottom_standoff[9], multipcb_bottom_standoff[9],
multipcb_bottom_standoff[10], multipcb_bottom_standoff[10],
multipcb_bottom_standoff[11], multipcb_bottom_standoff[11],
multipcb_bottom_standoff[12]]; multipcb_bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0]) translate([pcbhole_x,pcbhole_y,0])
standoff(pcb_standoff,[false,10,2,"default"]); standoff(pcb_standoff,[false,10,2,"default"]);
} }
if (pcbhole_pos == "left_front" && multipcb_bottom_front_left_enable == true && if (pcbhole_pos == "left_front" && multipcb_bottom_front_left_enable == true &&
(pcbhole_state == "bottom" || pcbhole_state == "both")) { (pcbhole_state == "bottom" || pcbhole_state == "both")) {
bottom_support = multipcb_bottom_sidewall_support == true ? multipcb_bottom_front_left_support : "none"; bottom_support = multipcb_bottom_sidewall_support == true ? multipcb_bottom_front_left_support : "none";
pcb_standoff = [multipcb_bottom_standoff[0], pcb_standoff = [multipcb_bottom_standoff[0],
multipcb_bottom_standoff[1], multipcb_bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+multipcb_bottom_front_left_adjust, bottom_height-pcb_z+pcb_loc_z+multipcb_bottom_front_left_adjust,
multipcb_bottom_standoff[3], multipcb_bottom_standoff[3],
multipcb_bottom_standoff[4], multipcb_bottom_standoff[4],
multipcb_bottom_standoff[5], multipcb_bottom_standoff[5],
multipcb_bottom_standoff[6], multipcb_bottom_standoff[6],
multipcb_bottom_standoff[7], multipcb_bottom_standoff[7],
bottom_support, bottom_support,
multipcb_bottom_standoff[9], multipcb_bottom_standoff[9],
multipcb_bottom_standoff[10], multipcb_bottom_standoff[10],
multipcb_bottom_standoff[11], multipcb_bottom_standoff[11],
multipcb_bottom_standoff[12]]; multipcb_bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0]) translate([pcbhole_x,pcbhole_y,0])
standoff(pcb_standoff,[false,10,2,"default"]); standoff(pcb_standoff,[false,10,2,"default"]);
} }
if (pcbhole_pos == "right_rear" && multipcb_bottom_rear_right_enable == true && if (pcbhole_pos == "right_rear" && multipcb_bottom_rear_right_enable == true &&
(pcbhole_state == "bottom" || pcbhole_state == "both")) { (pcbhole_state == "bottom" || pcbhole_state == "both")) {
bottom_support = multipcb_bottom_sidewall_support == true ? multipcb_bottom_rear_right_support : "none"; bottom_support = multipcb_bottom_sidewall_support == true ? multipcb_bottom_rear_right_support : "none";
pcb_standoff = [multipcb_bottom_standoff[0], pcb_standoff = [multipcb_bottom_standoff[0],
multipcb_bottom_standoff[1], multipcb_bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+multipcb_bottom_rear_right_adjust, bottom_height-pcb_z+pcb_loc_z+multipcb_bottom_rear_right_adjust,
multipcb_bottom_standoff[3], multipcb_bottom_standoff[3],
multipcb_bottom_standoff[4], multipcb_bottom_standoff[4],
multipcb_bottom_standoff[5], multipcb_bottom_standoff[5],
multipcb_bottom_standoff[6], multipcb_bottom_standoff[6],
multipcb_bottom_standoff[7], multipcb_bottom_standoff[7],
bottom_support, bottom_support,
multipcb_bottom_standoff[9], multipcb_bottom_standoff[9],
multipcb_bottom_standoff[10], multipcb_bottom_standoff[10],
multipcb_bottom_standoff[11], multipcb_bottom_standoff[11],
multipcb_bottom_standoff[12]]; multipcb_bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0]) translate([pcbhole_x,pcbhole_y,0])
standoff(pcb_standoff,[false,10,2,"default"]); standoff(pcb_standoff,[false,10,2,"default"]);
} }
if (pcbhole_pos == "right_front" && multipcb_bottom_front_right_enable == true && if (pcbhole_pos == "right_front" && multipcb_bottom_front_right_enable == true &&
(pcbhole_state == "bottom" || pcbhole_state == "both")) { (pcbhole_state == "bottom" || pcbhole_state == "both")) {
bottom_support = multipcb_bottom_sidewall_support == true ? multipcb_bottom_front_right_support : "none"; bottom_support = multipcb_bottom_sidewall_support == true ? multipcb_bottom_front_right_support : "none";
pcb_standoff = [multipcb_bottom_standoff[0], pcb_standoff = [multipcb_bottom_standoff[0],
multipcb_bottom_standoff[1], multipcb_bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+multipcb_bottom_front_right_adjust, bottom_height-pcb_z+pcb_loc_z+multipcb_bottom_front_right_adjust,
multipcb_bottom_standoff[3], multipcb_bottom_standoff[3],
multipcb_bottom_standoff[4], multipcb_bottom_standoff[4],
multipcb_bottom_standoff[5], multipcb_bottom_standoff[5],
multipcb_bottom_standoff[6], multipcb_bottom_standoff[6],
multipcb_bottom_standoff[7], multipcb_bottom_standoff[7],
bottom_support, bottom_support,
multipcb_bottom_standoff[9], multipcb_bottom_standoff[9],
multipcb_bottom_standoff[10], multipcb_bottom_standoff[10],
multipcb_bottom_standoff[11], multipcb_bottom_standoff[11],
multipcb_bottom_standoff[12]]; multipcb_bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0]) translate([pcbhole_x,pcbhole_y,0])
standoff(pcb_standoff,[false,10,2,"default"]); standoff(pcb_standoff,[false,10,2,"default"]);
}
}
} }
} }
} }
} }
} }
} }
} } }
// extended standoffs // extended standoffs
if(ext_bottom_standoffs == true) { if(ext_bottom_standoffs == true) {
// extended right-rear standoff // extended right-rear standoff
@@ -722,60 +730,63 @@ if(side == "bottom") {
} }
} }
for(i = [0:len(rack_bay_sbc)-1]) { for(i = [0:len(rack_bay_sbc)-1]) {
s = search([rack_bay_sbc[i]],sbc_data); if(rack_bay_sbc[i] != "empty") {
pcb_id = sbc_data[s[0]][4]; s = search([rack_bay_sbc[i]],sbc_data);
pcb_width = sbc_data[s[0]][10][0]; pcb_id = sbc_data[s[0]][4];
pcb_depth = sbc_data[s[0]][10][1]; pcb_width = sbc_data[s[0]][10][0];
pcb_z_orig = sbc_data[s[0]][10][2]; pcb_depth = sbc_data[s[0]][10][1];
pcb_tmaxz = sbc_data[s[0]][11][5]; pcb_z_orig = sbc_data[s[0]][10][2];
pcb_bmaxz = sbc_data[s[0]][11][6]; pcb_tmaxz = sbc_data[s[0]][11][5];
pcb_color = sbc_data[s[0]][11][1]; pcb_bmaxz = sbc_data[s[0]][11][6];
pcb_radius = sbc_data[s[0]][11][0]; pcb_color = sbc_data[s[0]][11][1];
pcb_radius = sbc_data[s[0]][11][0];
pcb_loc_x = rack_bay_rotation[i] == 90 ? rack_bay_xyz_loc[i][0] + pcb_width : rack_bay_rotation[i] == 180 ? pcb_loc_x = rack_bay_rotation[i] == 90 ? rack_bay_xyz_loc[i][0] + pcb_width : rack_bay_rotation[i] == 180 ?
rack_bay_xyz_loc[i][0] + pcb_width : rack_bay_xyz_loc[i][0]; rack_bay_xyz_loc[i][0] + pcb_width : rack_bay_xyz_loc[i][0];
pcb_loc_y = rack_bay_rotation[i] == 270 ? rack_bay_xyz_loc[i][1]+pcb_width : rack_bay_rotation[i] == 180 ? pcb_loc_y = rack_bay_rotation[i] == 270 ? rack_bay_xyz_loc[i][1]+pcb_width : rack_bay_rotation[i] == 180 ?
rack_bay_xyz_loc[i][1]+pcb_depth : rack_bay_xyz_loc[i][1]; rack_bay_xyz_loc[i][1]+pcb_depth : rack_bay_xyz_loc[i][1];
pcb_loc_z = rack_bay_xyz_loc[i][2]; pcb_loc_z = rack_bay_xyz_loc[i][2];
// sbc openings // sbc openings
if(sbc_highlight == true && rack_bay_sbc[i] != "empty") { if(sbc_highlight == true && rack_bay_sbc[i] != "empty") {
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) rotate([0,0,rack_bay_rotation[i]]) #translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) rotate([0,0,rack_bay_rotation[i]])
sbc(rack_bay_sbc[i], cooling, fan_size, gpio_opening, uart_opening, true); sbc(rack_bay_sbc[i], cooling, fan_size, gpio_opening, uart_opening, true);
} }
if(sbc_highlight != true && rack_bay_sbc[i] != "empty") { if(sbc_highlight != true && rack_bay_sbc[i] != "empty") {
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) rotate([0,0,rack_bay_rotation[i]]) translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) rotate([0,0,rack_bay_rotation[i]])
sbc(rack_bay_sbc[i], cooling, fan_size, gpio_opening, uart_opening, true); sbc(rack_bay_sbc[i], cooling, fan_size, gpio_opening, uart_opening, true);
} }
// indents /* // indents
if(indents == true) { if(indents == true) {
for (i=[1:11:len(sbc_data[s[0]])-2]) { for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1]; class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2]; type = sbc_data[s[0]][i+2];
pcbid = sbc_data[s[0]][i+3]; pcbid = sbc_data[s[0]][i+3];
pcbloc_x = sbc_data[s[0]][i+4]; pcbloc_x = sbc_data[s[0]][i+4];
pcbloc_y = sbc_data[s[0]][i+5]; pcbloc_y = sbc_data[s[0]][i+5];
pcbloc_z = sbc_data[s[0]][i+6]; pcbloc_z = sbc_data[s[0]][i+6];
if(class == "pcb") { if(class == "pcb") {
for (i=[1:11:len(sbc_data[s[0]])-2]) { for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1]; class = sbc_data[s[0]][i+1];
type = sbc_data[s[0]][i+2]; type = sbc_data[s[0]][i+2];
id = sbc_data[s[0]][i+3]; id = sbc_data[s[0]][i+3];
loc_x = sbc_data[s[0]][i+4]+pcb_loc_x+pcbloc_x; loc_x = sbc_data[s[0]][i+4]+pcb_loc_x+pcbloc_x;
loc_y = sbc_data[s[0]][i+5]+pcb_loc_y+pcbloc_y; loc_y = sbc_data[s[0]][i+5]+pcb_loc_y+pcbloc_y;
loc_z = sbc_data[s[0]][i+6]+pcb_loc_z+pcbloc_z; loc_z = sbc_data[s[0]][i+6]+pcb_loc_z+pcbloc_z;
side = sbc_data[s[0]][i+7]; side = sbc_data[s[0]][i+7];
rotation = sbc_data[s[0]][i+8]; rotation = sbc_data[s[0]][i+8];
if(id == pcbid) { if(id == pcbid) {
indent(loc_x, loc_y, bottom_height+loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z); indent(loc_x, loc_y, bottom_height+loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z);
}
} }
} }
} }
} }
} */
// case divide // case divide
translate([150-gap-wallthick,-gap-wallthick,-adj]) cube([rack_asm_gap,depth,case_z+2*adj]); translate([150-gap-wallthick,-gap-wallthick-1,-adj]) cube([rack_asm_gap,depth+2,case_z+2*adj]);
translate([300-gap-wallthick,-gap-wallthick,-adj]) cube([rack_asm_gap,depth,case_z+2*adj]); translate([300-gap-wallthick,-gap-wallthick-1,-adj]) cube([rack_asm_gap,depth+2,case_z+2*adj]);
}
} }
// clean fillets // clean fillets
if(case_design == "shell") { if(case_design == "shell") {

View File

@@ -11081,7 +11081,7 @@
"rack_bay6_rear_conduit": "true", "rack_bay6_rear_conduit": "true",
"rack_bay6_rear_fan": "true", "rack_bay6_rear_fan": "true",
"rack_bay6_rotation": "270", "rack_bay6_rotation": "270",
"rack_bay6_xyz_loc": "[385, 0, 0]", "rack_bay6_xyz_loc": "[383, 0, 0]",
"rack_size": "1u", "rack_size": "1u",
"rack_width": "19", "rack_width": "19",
"raise_top": "0", "raise_top": "0",
@@ -11097,7 +11097,7 @@
"sbc_information": "false", "sbc_information": "false",
"sbc_model": "c4", "sbc_model": "c4",
"sbc_off": "false", "sbc_off": "false",
"sbc_top_standoffs": "true", "sbc_top_standoffs": "false",
"section_part": "false", "section_part": "false",
"sidethick": "5", "sidethick": "5",
"standard_motherboard_thickness": "0", "standard_motherboard_thickness": "0",
@@ -11129,7 +11129,7 @@
"top_standoff_support_height": "4", "top_standoff_support_height": "4",
"top_standoff_support_size": "10", "top_standoff_support_size": "10",
"top_standoff_type": "blind", "top_standoff_type": "blind",
"uart_opening": "default", "uart_opening": "none",
"view": "model", "view": "model",
"wallthick": "3" "wallthick": "3"
} }

View File

@@ -123,7 +123,6 @@ Rack_Bay6 = "empty"; // ["empty", "c1+", "c2", "c4", "hc4", "xu4", "xu4q", "mc1
rack_bay6_xyz_loc = [0,0,0]; // [0:.5:450] rack_bay6_xyz_loc = [0,0,0]; // [0:.5:450]
rack_bay6_rotation = 0; // [0:90:270] rack_bay6_rotation = 0; // [0:90:270]
rack_bay6_face = "io_shield"; //["solid","blank","io_shield","vent_hex"] rack_bay6_face = "io_shield"; //["solid","blank","io_shield","vent_hex"]
//rack_bay6_wall = false; // [true,false]
rack_bay6_rear_fan = false; //[true,false] rack_bay6_rear_fan = false; //[true,false]
rack_bay6_rear_conduit = false; //[true,false] rack_bay6_rear_conduit = false; //[true,false]
@@ -601,6 +600,26 @@ if (view == "platter") {
case_bottom(case_design); case_bottom(case_design);
translate([0,(2*depth)+20,case_z+floorthick]) rotate([180,0,0]) case_top(case_design); translate([0,(2*depth)+20,case_z+floorthick]) rotate([180,0,0]) case_top(case_design);
} }
if(case_design == "rack") {
case_rack(case_design,"bottom");
// rear fan covers
for(r = [0:len(rack_bay_sbc)-1]) {
fan_offset = -75+(75-rear_fan_size)/2;
if(rack_bay_rear_fan[r] == true) {
translate([-gap-wallthick-1+.125+75*(r+1)+fan_offset+8,
depth+10,(case_z-rear_fan_size)/2])
fan_cover(rear_fan_size, wallthick, rear_cooling);
}
}
// rear grommets
for(r = [0:len(rack_bay_sbc)-1]) {
grommet_offset = -75+11;
if(rack_bay_rear_conduit[r] == true) {
translate([-gap-wallthick-1+.125+75*(r+1)+grommet_offset,depth+30,0])
color("lightgrey") grommet("bottom", "sleeve", 10, r+2, wallthick, true, [false,10,0,"default"]);
}
}
}
if(case_design == "adapter_mini-stx_thin" || case_design == "adapter_mini-stx" || case_design == "adapter_mini-itx_thin" || case_design == "adapter_mini-itx" || case_design == "adapter_flex-atx" || case_design == "adapter_mini-dtx" || case_design == "adapter_dtx" || case_design == "adapter_micro-atx" || case_design == "adapter_atx" || case_design == "adapter_ssi-ceb" || case_design == "adapter_ssi-eeb") { if(case_design == "adapter_mini-stx_thin" || case_design == "adapter_mini-stx" || case_design == "adapter_mini-itx_thin" || case_design == "adapter_mini-itx" || case_design == "adapter_flex-atx" || case_design == "adapter_mini-dtx" || case_design == "adapter_dtx" || case_design == "adapter_micro-atx" || case_design == "adapter_atx" || case_design == "adapter_ssi-ceb" || case_design == "adapter_ssi-eeb") {
color("dimgrey",1) case_adapter(case_design); color("dimgrey",1) case_adapter(case_design);
color("dimgrey",1) translate([-180, 0, 4]) rotate([270,0,0]) io_shield(); color("dimgrey",1) translate([-180, 0, 4]) rotate([270,0,0]) io_shield();
@@ -1133,23 +1152,25 @@ if (view == "model") {
} }
if(sbc_off == false) { if(sbc_off == false) {
for(i = [0:len(rack_bay_sbc)-1]) { for(i = [0:len(rack_bay_sbc)-1]) {
s = search([rack_bay_sbc[i]],sbc_data);
pcb_loc_z = rack_bay_xyz_loc[i][2];
pcb_id = sbc_data[s[0]][4];
pcb_width = sbc_data[s[0]][10][0];
pcb_depth = sbc_data[s[0]][10][1];
pcb_z_orig = sbc_data[s[0]][10][2];
pcb_tmaxz = sbc_data[s[0]][11][5];
pcb_bmaxz = sbc_data[s[0]][11][6];
pcb_color = sbc_data[s[0]][11][1];
pcb_radius = sbc_data[s[0]][11][0];
pcb_loc_x = rack_bay_rotation[i] == 90 ? rack_bay_xyz_loc[i][0] + pcb_width : rack_bay_rotation[i] == 180 ? rack_bay_xyz_loc[i][0] + pcb_width : rack_bay_xyz_loc[i][0];
pcb_loc_y = rack_bay_rotation[i] == 270 ? rack_bay_xyz_loc[i][1]+pcb_width : rack_bay_rotation[i] == 180 ? rack_bay_xyz_loc[i][1]+pcb_depth : rack_bay_xyz_loc[i][1];
if(rack_bay_sbc[i] != "empty") { if(rack_bay_sbc[i] != "empty") {
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) s = search([rack_bay_sbc[i]],sbc_data);
rotate([0,0,rack_bay_rotation[i]]) pcb_loc_z = rack_bay_xyz_loc[i][2];
sbc(rack_bay_sbc[i], cooling, fan_size, gpio_opening, uart_opening, false); pcb_id = sbc_data[s[0]][4];
pcb_width = sbc_data[s[0]][10][0];
pcb_depth = sbc_data[s[0]][10][1];
pcb_z_orig = sbc_data[s[0]][10][2];
pcb_tmaxz = sbc_data[s[0]][11][5];
pcb_bmaxz = sbc_data[s[0]][11][6];
pcb_color = sbc_data[s[0]][11][1];
pcb_radius = sbc_data[s[0]][11][0];
pcb_loc_x = rack_bay_rotation[i] == 90 ? rack_bay_xyz_loc[i][0] + pcb_width : rack_bay_rotation[i] == 180 ? rack_bay_xyz_loc[i][0] + pcb_width : rack_bay_xyz_loc[i][0];
pcb_loc_y = rack_bay_rotation[i] == 270 ? rack_bay_xyz_loc[i][1]+pcb_width : rack_bay_rotation[i] == 180 ? rack_bay_xyz_loc[i][1]+pcb_depth : rack_bay_xyz_loc[i][1];
if(rack_bay_sbc[i] != "empty") {
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj])
rotate([0,0,rack_bay_rotation[i]])
sbc(rack_bay_sbc[i], cooling, fan_size, gpio_opening, uart_opening, false);
}
} }
} }
} }