positional standoff sidewall support added and ongoing code cleanup and reorg.
This commit is contained in:
@@ -262,7 +262,7 @@ module case_top(case_design) {
|
||||
|
||||
if (class == "pcbhole" && id == pcb_id &&
|
||||
(pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" || pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
|
||||
#translate([pcb_hole_x,pcb_hole_y,top_height+1]) cylinder(d=6.5, h=top_height);
|
||||
translate([pcb_hole_x,pcb_hole_y,top_height+1]) cylinder(d=6.5, h=top_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,6 +301,7 @@ module case_top(case_design) {
|
||||
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||
|
||||
if(class == "pcbhole" && id == pcb_id &&
|
||||
(pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" || pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
|
||||
if (pcb_hole_pos == "left_rear") {
|
||||
@@ -387,75 +388,39 @@ module case_top(case_design) {
|
||||
}
|
||||
// standoff sidewall support
|
||||
if(sidewall_support == true && sbc_top_standoffs == true) {
|
||||
if(pcb_width/pcb_depth >= 1.4) {
|
||||
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];
|
||||
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||
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];
|
||||
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||
pcb_side_pos = sbc_data[s[0]][i+10][2];
|
||||
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||
ex_stand = 0;
|
||||
|
||||
if(pcb_hole_x!=0 && pcb_hole_y!=0) {
|
||||
if (pcb_hole_pos == "left_rear") {
|
||||
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4,
|
||||
case_z-top_height-top_rear_left]) cube([2,gap+1.6,top_height+top_rear_left]);
|
||||
}
|
||||
if (pcb_hole_pos == "left_front") {
|
||||
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-top_front_left])
|
||||
cube([2,gap+1.6,top_height+top_front_left]);
|
||||
}
|
||||
if (pcb_hole_pos == "right_rear") {
|
||||
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4,
|
||||
case_z-top_height-top_rear_right]) cube([2,gap+1.6,top_height+top_rear_right]);
|
||||
}
|
||||
if (pcb_hole_pos == "right_front") {
|
||||
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-top_front_right])
|
||||
cube([2,gap+1.6,top_height+top_front_right]);
|
||||
}
|
||||
if (class == "pcbhole" && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" ||
|
||||
pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
|
||||
ex_stand = pcb_hole_pos == "left_rear" ? top_rear_left :
|
||||
pcb_hole_pos == "left_front" ? top_front_left :
|
||||
pcb_hole_pos == "right_rear" ? top_rear_right :
|
||||
pcb_hole_pos == "right_front" ? top_front_right : 0;
|
||||
if(pcb_side_pos == "rear") {
|
||||
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4, case_z-top_height-ex_stand])
|
||||
cube([2,gap+1.6,top_height+ex_stand]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
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];
|
||||
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||
|
||||
if(pcb_hole_x!=0 && pcb_hole_y!=0) {
|
||||
if (i == 7 && sbc_model != "n2l") {
|
||||
translate([pcb_hole_x-(top_standoff[0]/2)-gap-adj-1,pcb_hole_y-1,
|
||||
bottom_height-top_rear_left]) cube([gap+adj+1.6,2,top_height+top_rear_left]);
|
||||
}
|
||||
if (pcb_hole_pos == "left_rear" && sbc_model == "n2l") {
|
||||
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4,
|
||||
case_z-top_height-top_rear_left]) cube([2,gap+1.6,top_height+top_rear_left]);
|
||||
|
||||
}
|
||||
if (pcb_hole_pos == "left_front" && sbc_model != "n2l") {
|
||||
translate([pcb_hole_x-(top_standoff[0]/2)-gap-adj-1,pcb_hole_y-1,
|
||||
bottom_height-top_front_left]) cube([gap+adj+1.6,2,top_height+top_front_left]);
|
||||
}
|
||||
if (pcb_hole_pos == "left_front" && sbc_model == "n2l") {
|
||||
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-top_front_left])
|
||||
cube([2,gap+1.6,top_height+top_front_left]);
|
||||
|
||||
}
|
||||
if (pcb_hole_pos == "right_rear") {
|
||||
translate([pcb_hole_x+(top_standoff[0]/2)-adj-.45,pcb_hole_y-1,
|
||||
bottom_height-top_rear_right]) cube([gap+adj+1.6,2,top_height+top_rear_right]);
|
||||
}
|
||||
if (pcb_hole_pos == "right_front") {
|
||||
translate([pcb_hole_x+(top_standoff[0]/2)-adj-.45,pcb_hole_y-1,
|
||||
bottom_height-top_front_right]) cube([gap+adj+1.6,2,top_height+top_front_right]);
|
||||
}
|
||||
if(pcb_side_pos == "front") {
|
||||
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-ex_stand])
|
||||
cube([2,gap+1.6,top_height+ex_stand]);
|
||||
}
|
||||
if(pcb_side_pos == "left") {
|
||||
translate([pcb_hole_x-(top_standoff[0]/2)-2.4+adj,pcb_hole_y-1,case_z-top_height-ex_stand])
|
||||
cube([gap+1.6,2,top_height+ex_stand]);
|
||||
}
|
||||
if(pcb_side_pos == "right") {
|
||||
translate([pcb_hole_x+(top_standoff[0]/2)-.6+adj,pcb_hole_y-1,case_z-top_height-ex_stand])
|
||||
cube([gap+1.6,2,top_height+ex_stand]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user