positional standoff sidewall support added and ongoing code cleanup and reorg.

This commit is contained in:
Edward Kisiel
2024-01-30 16:04:37 -05:00
parent d084cab29f
commit e968bbe384
6 changed files with 201 additions and 205 deletions

View File

@@ -1,103 +1,139 @@
/* /*
access_port(size[],orientation) This file is part of SBC Case Builder https://github.com/hominoids/SBC_Case_Builder
access_cover(size[],orientation) Copyright 2022,2023,2024 Edward A. Kisiel hominoid@cablemi.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
NAME: access_port
DESCRIPTION: creates opening and structure for access openings
TODO: none
USAGE: access_port(size[], orientation)
size[0] = size_x
size[1] = size_y
size[2] = floor thickness
orientation = "landscape", "portrait"
*/ */
/* access port and support */ module access_port(size, orientation) {
module access_port(size,orientation) {
floorthick = size[2]; floorthick = size[2];
adjust = .01; adj = .01;
$fn = 90; $fn = 90;
if(orientation == "portrait") { if(orientation == "portrait") {
difference() { difference() {
union() { union() {
translate([0,0,0]) cube([size[0],size[1],size[2]]); cube([size[0], size[1], size[2]]);
// access panel support // access panel support
translate([(size[0]/2)+.25,size[1]-6.5,0]) cylinder(d=9,h=floorthick+(adjust*2)+5); translate([(size[0]/2)+.25, size[1]-6.5, 0]) cylinder(d=9, h=floorthick+(adj*2)+5);
translate([(size[0]/2)-10,size[1]-11,floorthick-adjust]) cube([20,9.5,floorthick]); translate([(size[0]/2)-10, size[1]-11, floorthick-adj]) cube([20, 9.5, floorthick]);
translate([1,0,floorthick-adjust]) cube([size[0]-2,5,4.5]); translate([1, 0, floorthick-adj]) cube([size[0]-2, 5, 4.5]);
} }
// access opening // access opening
translate([.5,6,-adjust]) cube([size[0]-1.15,size[1]-17,floorthick+(adjust*2)]); translate([.5, 6, -adj]) cube([size[0]-1.15, size[1]-17, floorthick+(adj*2)]);
translate([(size[0]/2)-5,size[1]-12,-adjust]) slab([10.5,5.5,floorthick],5.5); translate([(size[0]/2)-5, size[1]-12, -adj]) slab([10.5, 5.5, floorthick], 5.5);
translate([(size[0]/2)+.25,size[1]-6.5,floorthick+2]) translate([(size[0]/2)+.25, size[1]-6.5, floorthick+2])
cylinder(r=3.2,h=floorthick+(adjust*2)+5,$fn=6); cylinder(r=3.2, h=floorthick+(adj*2)+5, $fn=6);
translate([(size[0]/2)+.25,size[1]-6.5,-adjust]) translate([(size[0]/2)+.25, size[1]-6.5, -adj])
cylinder(d=3.2,h=floorthick+(adjust*2)+5); cylinder(d=3.2, h=floorthick+(adj*2)+5);
translate([4,2+adjust,floorthick]) cube([7.75,3,2.75]); translate([4, 2+adj, floorthick]) cube([7.75, 3, 2.75]);
translate([size[0]-13,2+adjust,floorthick]) cube([7.75,3,2.75]); translate([size[0]-13, 2+adj, floorthick]) cube([7.75, 3, 2.75]);
if(size[0] > 100) { if(size[0] > 100) {
translate([(size[0]/2),2+adjust,floorthick]) cube([7.75,3,2.75]); translate([(size[0]/2), 2+adj, floorthick]) cube([7.75, 3, 2.75]);
} }
} }
} }
if(orientation == "landscape") { if(orientation == "landscape") {
difference() { difference() {
union() { union() {
translate([0,-1,0]) cube([size[0],size[1],size[2]]); translate([0, -1, 0]) cube([size[0], size[1], size[2]]);
// access panel support // access panel support
translate([size[0]-6.5,(size[1]/2)-.5,0]) cylinder(d=9,h=floorthick+(adjust*2)+5); translate([size[0]-6.5, (size[1]/2)-.5, 0]) cylinder(d=9, h=floorthick+(adj*2)+5);
translate([size[0]-11,(size[1]/2)-10.5,floorthick-adjust]) cube([9.5,20,floorthick]); translate([size[0]-11, (size[1]/2)-10.5, floorthick-adj]) cube([9.5, 20, floorthick]);
translate([0,0,floorthick-adjust]) cube([5,size[1]-2,4.5]); translate([0, 0, floorthick-adj]) cube([5, size[1]-2, 4.5]);
} }
// access opening // access opening
translate([6,-.5,-adjust]) cube([size[0]-17,size[1]-1.15,floorthick+(adjust*3)]); translate([6, -.5, -adj]) cube([size[0]-17, size[1]-1.15, floorthick+(adj*3)]);
translate([size[0]-12,(size[1]/2)-6,-adjust]) slab([5.5,10.5,floorthick],5.5); translate([size[0]-12, (size[1]/2)-6, -adj]) slab([5.5, 10.5, floorthick], 5.5);
translate([size[0]-6.5,(size[1]/2)-.5,floorthick+2]) rotate([0,0,30]) translate([size[0]-6.5, (size[1]/2)-.5, floorthick+2]) rotate([0, 0, 30])
cylinder(r=3.2,h=floorthick+(adjust*2)+5,$fn=6); cylinder(r=3.2, h=floorthick+(adj*2)+5, $fn=6);
translate([size[0]-6.5,(size[1]/2)-.5,-adjust]) translate([size[0]-6.5, (size[1]/2)-.5, -adj])
cylinder(d=3.2,h=floorthick+(adjust*2)+5); cylinder(d=3.2, h=floorthick+(adj*2)+5);
translate([2+adjust,3,floorthick]) cube([3,8.25,2.75]); translate([2+adj, 3, floorthick]) cube([3, 8.25, 2.75]);
translate([2+adjust,size[1]-13,floorthick]) cube([3,8.25,2.75]); translate([2+adj, size[1]-13, floorthick]) cube([3, 8.25, 2.75]);
if(size[1] > 100) { if(size[1] > 100) {
translate([2+adjust,(size[1]/2)-(7.75/2)-1.25,floorthick]) cube([3,7.75,2.5]); translate([2+adj, (size[1]/2)-(7.75/2)-1.25, floorthick]) cube([3, 7.75, 2.5]);
} }
} }
} }
} }
/* access cover and support */ /*
module access_cover(size,orientation) { NAME: access_cover
DESCRIPTION: creates covers for access port openings
TODO: none
USAGE: access_port(size[], orientation)
size[0] = size_x
size[1] = size_y
size[2] = floor thickness
orientation = "landscape", "portrait"
*/
module access_cover(size, orientation) {
floorthick = size[2]; floorthick = size[2];
adjust = .01; adj = .01;
$fn = 90; $fn = 90;
if(orientation == "portrait") { if(orientation == "portrait") {
difference() { difference() {
union() { union() {
translate([1,6.25,0]) cube([size[0]-2.15,size[1]-17.5,floorthick]); translate([1, 6.25, 0]) cube([size[0]-2.15, size[1]-17.5, floorthick]);
translate([(size[0]/2)-4.75,size[1]-12.25,0]) slab([10,5,floorthick], 5); translate([(size[0]/2)-4.75, size[1]-12.25, 0]) slab([10, 5, floorthick], 5);
translate([1,6.25,floorthick-adjust]) cube([size[0]-2.15,6,floorthick]); translate([1, 6.25, floorthick-adj]) cube([size[0]-2.15, 6, floorthick]);
translate([4.25,3,floorthick]) cube([7.25,4,2]); translate([4.25, 3, floorthick]) cube([7.25, 4, 2]);
translate([size[0]-12.75,3,floorthick]) cube([7.25,4,2]); translate([size[0]-12.75, 3, floorthick]) cube([7.25, 4, 2]);
if(size[0] > 100) { if(size[0] > 100) {
translate([(size[0]/2)+.25,3,floorthick]) cube([7.25,4,2]); translate([(size[0]/2)+.25, 3, floorthick]) cube([7.25, 4, 2]);
} }
} }
translate([(size[0]/2)+.25,size[1]-6.5,-floorthick-adjust]) translate([(size[0]/2)+.25, size[1]-6.5, -floorthick-adj])
cylinder(d=3.2,h=(floorthick*2)+(adjust*2)); cylinder(d=3.2, h=(floorthick*2)+(adj*2));
translate([(size[0]/2)+.25,size[1]-6.5,-floorthick-adjust+floorthick]) translate([(size[0]/2)+.25, size[1]-6.5, -adj])
cylinder(d1=6, d2=3.2, h=floorthick); cylinder(d1=6, d2=3.2, h=floorthick);
} }
} }
if(orientation == "landscape") { if(orientation == "landscape") {
difference() { difference() {
union() { union() {
translate([6.25,0,0]) cube([size[0]-17.75,size[1]-2,floorthick]); translate([6.25, 0, 0]) cube([size[0]-17.75, size[1]-2, floorthick]);
translate([size[0]-12.25,(size[1]/2)-5.75,0]) slab([5,10,floorthick], 5); translate([size[0]-12.25, (size[1]/2)-5.75, 0]) slab([5, 10, floorthick], 5);
translate([6.25,0,floorthick-adjust]) cube([6,size[1]-2.15,floorthick]); translate([6.25, 0, floorthick-adj]) cube([6,size[1]-2.15, floorthick]);
translate([3.5+adjust,3.25,floorthick]) cube([4,7.25,2]); translate([3.5+adj, 3.25, floorthick]) cube([4, 7.25, 2]);
translate([3.5+adjust,size[1]-12.75,floorthick]) cube([4,7.25,2]); translate([3.5+adj, size[1]-12.75, floorthick]) cube([4, 7.25, 2]);
if(size[1] > 100) { if(size[1] > 100) {
translate([3.5+adjust,(size[1]/2)-(7.75/2)-1,floorthick]) cube([4,7.25,2]); translate([3.5+adj, (size[1]/2)-(7.75/2)-1, floorthick]) cube([4, 7.25, 2]);
} }
} }
translate([size[0]-6.5,(size[1]/2)-.75,-floorthick-adjust]) translate([size[0]-6.5, (size[1]/2)-.75, -floorthick-adj])
cylinder(d=3.2,h=(floorthick*2)+(adjust*2)); cylinder(d=3.2, h=(floorthick*2)+(adj*2));
translate([size[0]-6.5,(size[1]/2)-.75,-floorthick-adjust+floorthick]) translate([size[0]-6.5, (size[1]/2)-.75, -adj])
cylinder(d1=6, d2=3.2, h=floorthick); cylinder(d1=6, d2=3.2, h=floorthick);
} }
} }

View File

@@ -1,11 +1,33 @@
/* /*
This file is part of SBC Case Builder https://github.com/hominoids/SBC_Case_Builder
Copyright 2022,2023,2024 Edward A. Kisiel hominoid@cablemi.com
art(scale_d1,type,size_z) This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
NAME: art
DESCRIPTION: create artwork using dxf or svf
TODO: none
USAGE: art(scale_d1, size_z, type)
scale_d1 = amount to scale file
size_z = floor thickness
type = file name
*/ */
/* art work module */ module art(scale_d1, size_z, type) {
module art(scale_d1,size_z,type) {
linear_extrude(height = size_z) import(file = type, scale=scale_d1); linear_extrude(height = size_z) import(file = type, scale=scale_d1);

View File

@@ -314,11 +314,12 @@ module case_bottom(case_design) {
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];
pcb_hole_x = sbc_data[s[0]][i+4]; pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+5]; pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_z = sbc_data[s[0]][i+6]; pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0]; pcb_hole_size = sbc_data[s[0]][i+9][0];
pcb_hole_pos = sbc_data[s[0]][i+10][4]; 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" || 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")) { pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
translate([pcb_hole_x,pcb_hole_y,-1]) cylinder(d=6.5, h=bottom_height); translate([pcb_hole_x,pcb_hole_y,-1]) cylinder(d=6.5, h=bottom_height);
@@ -355,13 +356,14 @@ module case_bottom(case_design) {
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];
pcb_hole_x = sbc_data[s[0]][i+4]; pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_y = sbc_data[s[0]][i+5]; pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_z = sbc_data[s[0]][i+6]; pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0]; pcb_hole_size = sbc_data[s[0]][i+9][0];
pcb_hole_pos = sbc_data[s[0]][i+10][4]; pcb_hole_pos = sbc_data[s[0]][i+10][4];
if(pcb_hole_x!=0 && pcb_hole_y!=0) { if(class == "pcbhole" && (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") { if (pcb_hole_pos == "left_rear") {
normal_standoff = [bottom_standoff[0], normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_left, bottom_height-pcb_z+pcb_loc_z+bottom_rear_left,
@@ -444,68 +446,41 @@ module case_bottom(case_design) {
} }
} }
// standoff sidewall support // standoff sidewall support
if(sidewall_support == true && sbc_bottom_standoffs == true) { 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]) {
for (i=[1:11:len(sbc_data[s[0]])-2]) { class = sbc_data[s[0]][i+1];
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x; type = sbc_data[s[0]][i+2];
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y; id = sbc_data[s[0]][i+3];
pcb_hole_z = sbc_data[s[0]][i+6]; pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcb_hole_size = sbc_data[s[0]][i+9][0]; pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcb_hole_pos = sbc_data[s[0]][i+10][4]; 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 (class == "pcbhole" && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" ||
if(pcb_hole_pos == "left_rear") { pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
translate([pcb_hole_x-1, pcb_hole_y-(bottom_standoff[0]/2)-(gap+adj)-1,0]) ex_stand = pcb_hole_pos == "left_rear" ? bottom_rear_left :
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_rear_left]); pcb_hole_pos == "left_front" ? bottom_front_left :
} pcb_hole_pos == "right_rear" ? bottom_rear_right :
if(pcb_hole_pos == "left_front") { pcb_hole_pos == "right_front" ? bottom_front_right : 0;
translate([pcb_hole_x-1, pcb_hole_y+(bottom_standoff[0]/2)-.6+adj,0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_front_left]); if(pcb_side_pos == "rear") {
} translate([pcb_hole_x-1, pcb_hole_y-(bottom_standoff[0]/2)-(gap-adj)-1.4, 0])
if(pcb_hole_pos == "right_rear") { cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
translate([pcb_hole_x-1, pcb_hole_y-(bottom_standoff[0]/2)-(gap+adj)-1,0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_rear_right]);
}
if(pcb_hole_pos == "right_front") {
translate([pcb_hole_x-1, pcb_hole_y+(bottom_standoff[0]/2)-.6+adj,0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_front_right]);
}
} }
} if(pcb_side_pos == "front") {
} translate([pcb_hole_x-1, pcb_hole_y+(bottom_standoff[0]/2)-.6+adj,0])
else { cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
for (i=[1:11:len(sbc_data[s[0]])-2]) { }
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x; if(pcb_side_pos == "left") {
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y; translate([pcb_hole_x-(bottom_standoff[0]/2)-2.4+adj,pcb_hole_y-1,0])
pcb_hole_z = sbc_data[s[0]][i+6]; cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
pcb_hole_size = sbc_data[s[0]][i+9][0]; }
pcb_hole_pos = sbc_data[s[0]][i+10][4]; if(pcb_side_pos == "right") {
translate([pcb_hole_x+(bottom_standoff[0]/2)-.6+adj,pcb_hole_y-1,0])
if(pcb_hole_x!=0 && pcb_hole_y!=0) { cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
if(pcb_hole_pos == "left_rear" && sbc_model != "n2l") {
translate([pcb_hole_x-(bottom_standoff[0]/2)-2.6+adj, pcb_hole_y-gap,0])
cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+bottom_rear_left]);
}
if (pcb_hole_pos == "left_rear" && sbc_model == "n2l") {
translate([pcb_hole_x-1, pcb_hole_y-(bottom_standoff[0]/2)-(gap+adj)-1,0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_rear_left]);
}
if(pcb_hole_pos == "left_front" && sbc_model != "n2l") {
translate([pcb_hole_x-(bottom_standoff[0]/2)-2.6+adj, pcb_hole_y-gap,0])
cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+bottom_front_left]);
}
if(pcb_hole_pos == "left_front" && sbc_model == "n2l") {
translate([pcb_hole_x-1, pcb_hole_y+(bottom_standoff[0]/2)-.6+adj,0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_front_left]);
}
if (pcb_hole_pos == "right_rear") {
translate([pcb_hole_x+(bottom_standoff[0]/2)-.5+adj, pcb_hole_y-gap,0])
cube([gap+1.5,2,bottom_height-pcb_z+pcb_loc_z+bottom_rear_right]);
}
if (pcb_hole_pos == "right_front") {
translate([pcb_hole_x+(bottom_standoff[0]/2)-.5+adj, pcb_hole_y-gap,0])
cube([gap+1.5,2,bottom_height-pcb_z+pcb_loc_z+bottom_front_right]);
}
} }
} }
} }

View File

@@ -262,7 +262,7 @@ module case_top(case_design) {
if (class == "pcbhole" && id == pcb_id && 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")) { (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_z = sbc_data[s[0]][i+6];
pcb_hole_size = sbc_data[s[0]][i+9][0]; pcb_hole_size = sbc_data[s[0]][i+9][0];
pcb_hole_pos = sbc_data[s[0]][i+10][4]; pcb_hole_pos = sbc_data[s[0]][i+10][4];
if(class == "pcbhole" && id == pcb_id && 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")) { (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") { if (pcb_hole_pos == "left_rear") {
@@ -387,75 +388,39 @@ module case_top(case_design) {
} }
// standoff sidewall support // standoff sidewall support
if(sidewall_support == true && sbc_top_standoffs == true) { 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]) {
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]; pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
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_y = sbc_data[s[0]][i+5]+pcb_loc_y; pcb_hole_z = sbc_data[s[0]][i+6];
pcb_hole_z = sbc_data[s[0]][i+6]; pcb_hole_size = sbc_data[s[0]][i+9][0];
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]; pcb_hole_pos = sbc_data[s[0]][i+10][4];
ex_stand = 0;
if(pcb_hole_x!=0 && pcb_hole_y!=0) { if (class == "pcbhole" && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" ||
if (pcb_hole_pos == "left_rear") { pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4, ex_stand = pcb_hole_pos == "left_rear" ? top_rear_left :
case_z-top_height-top_rear_left]) cube([2,gap+1.6,top_height+top_rear_left]); pcb_hole_pos == "left_front" ? top_front_left :
} pcb_hole_pos == "right_rear" ? top_rear_right :
if (pcb_hole_pos == "left_front") { pcb_hole_pos == "right_front" ? top_front_right : 0;
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-top_front_left]) if(pcb_side_pos == "rear") {
cube([2,gap+1.6,top_height+top_front_left]); 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]);
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(pcb_side_pos == "front") {
} translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-ex_stand])
else { cube([2,gap+1.6,top_height+ex_stand]);
for (i=[1:11:len(sbc_data[s[0]])-2]) { }
class = sbc_data[s[0]][i+1]; if(pcb_side_pos == "left") {
type = sbc_data[s[0]][i+2]; translate([pcb_hole_x-(top_standoff[0]/2)-2.4+adj,pcb_hole_y-1,case_z-top_height-ex_stand])
id = sbc_data[s[0]][i+3]; cube([gap+1.6,2,top_height+ex_stand]);
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x; }
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y; if(pcb_side_pos == "right") {
pcb_hole_z = sbc_data[s[0]][i+6]; translate([pcb_hole_x+(top_standoff[0]/2)-.6+adj,pcb_hole_y-1,case_z-top_height-ex_stand])
pcb_hole_size = sbc_data[s[0]][i+9][0]; cube([gap+1.6,2,top_height+ex_stand]);
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]);
}
} }
} }
} }

View File

@@ -151,8 +151,6 @@ pcb_bmaxz = sbc_data[s[0]][11][6];
pcb_color = sbc_data[s[0]][11][1]; pcb_color = sbc_data[s[0]][11][1];
pcb_radius = sbc_data[s[0]][11][0]; pcb_radius = sbc_data[s[0]][11][0];
echo(pcb_id, pcb_width, pcb_depth, pcb_z, pcb_tmaxz, pcb_bmaxz, pcb_color, pcb_radius);
width = pcb_width+2*(wallthick+gap)+case_offset_x; width = pcb_width+2*(wallthick+gap)+case_offset_x;
depth = pcb_depth+2*(wallthick+gap)+case_offset_y; depth = pcb_depth+2*(wallthick+gap)+case_offset_y;
top_height = pcb_tmaxz+floorthick+case_offset_tz; top_height = pcb_tmaxz+floorthick+case_offset_tz;

View File

@@ -485,10 +485,10 @@ accessory_data = [
// Odroid-M1S // Odroid-M1S
["m1s_shell", ["m1s_shell",
"sub","vent_hex",10,29,-1,"bottom",[0,0,0],["sbc",true,true,false],21,5,8,5,1.5,"horizontal",1, // vent opening "sub","vent_hex",10,29,-1,"bottom",[0,0,0],["sbc",true,true,false],21,5,8,5,1.5,"horizontal",1, // vent opening
"sub","rectangle",73.5,5.5,3.5,"top",[0,0,45],["sbc",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",73.5,5.5,2.5,"top",[0,0,45],["sbc-case_z",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",5.5,56,3.5,"top",[0,0,0],["sbc-case_z",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",5.5,56,2.5,"top",[0,0,0],["sbc-case_z",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",81.5,56,3.5,"top",[0,0,0],["sbc-case_z",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",81.5,56,2.5,"top",[0,0,0],["sbc-case_z",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",17.5,12,3.5,"top",[0,0,0],["sbc-case_z",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1]], // standoff trim "sub","rectangle",17.5,12,2.5,"top",[0,0,0],["sbc-case_z",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1]], // standoff trim
["m1s_shell_nvme", ["m1s_shell_nvme",
"add1","access_port",-7.5,28,-0.01,"bottom",[0,0,0],["sbc",true,true,false],105,30,1.5,0,0,"landscape",0, // access port "add1","access_port",-7.5,28,-0.01,"bottom",[0,0,0],["sbc",true,true,false],105,30,1.5,0,0,"landscape",0, // access port
@@ -498,10 +498,10 @@ accessory_data = [
"sub","vent_hex",0,5,-1,"bottom",[0,0,0],["sbc",false,false,false],7,3,5,5,1.5,"horizontal",1, // vent opening "sub","vent_hex",0,5,-1,"bottom",[0,0,0],["sbc",false,false,false],7,3,5,5,1.5,"horizontal",1, // vent opening
"sub","vent_hex",87,5,-1,"bottom",[0,0,0],["sbc",false,false,false],3,3,5,5,1.5,"horizontal",1, // vent opening "sub","vent_hex",87,5,-1,"bottom",[0,0,0],["sbc",false,false,false],3,3,5,5,1.5,"horizontal",1, // vent opening
"sub","vent_hex",21,60,-1,"bottom",[0,0,0],["sbc",false,false,false],20,1,5,5,1.5,"horizontal",1, // vent opening "sub","vent_hex",21,60,-1,"bottom",[0,0,0],["sbc",false,false,false],20,1,5,5,1.5,"horizontal",1, // vent opening
"sub","rectangle",73.5,5.5,3.5,"top",[0,0,45],["sbc-case_z",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",73.5,5.5,2.5,"top",[0,0,45],["sbc-case_z",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",5.5,56,3.5,"top",[0,0,0],["sbc-case_z",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",5.5,56,2.5,"top",[0,0,0],["sbc-case_z",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",81.5,56,3.5,"top",[0,0,0],["sbc-case_z",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",81.5,56,2.5,"top",[0,0,0],["sbc-case_z",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",17.5,12,3.5,"top",[0,0,0],["sbc-case_z",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1]], // standoff trim "sub","rectangle",17.5,12,2.5,"top",[0,0,0],["sbc-case_z",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1]], // standoff trim
["m1s_shell_ups", ["m1s_shell_ups",
"sub","vent_hex",0,5,17,"top",[0,0,0],["case",false,false,true],9,21,8,5,1.5,"horizontal",1, // vent opening "sub","vent_hex",0,5,17,"top",[0,0,0],["case",false,false,true],9,21,8,5,1.5,"horizontal",1, // vent opening
@@ -514,13 +514,13 @@ accessory_data = [
"add1","access_port",-4,28,-0.01,"bottom",[0,0,0],["sbc",true,true,false],105,30,2,0,0,"landscape",0, // access port "add1","access_port",-4,28,-0.01,"bottom",[0,0,0],["sbc",true,true,false],105,30,2,0,0,"landscape",0, // access port
"model","access_cover",-4,28,-0.01,"bottom",[0,0,0],["sbc",true,true,false],105,30,2,0,0,"landscape",0, // access port cover "model","access_cover",-4,28,-0.01,"bottom",[0,0,0],["sbc",true,true,false],105,30,2,0,0,"landscape",0, // access port cover
"platter","access_cover",-10,16.25,0,"bottom",[0,0,90],["case",false,false,false],105,30,2,0,0,"landscape",0, // access port cover "platter","access_cover",-10,16.25,0,"bottom",[0,0,90],["case",false,false,false],105,30,2,0,0,"landscape",0, // access port cover
"add2","button",2,33.5,21,"top",[0,0,0],["sbc-case_z",false,false,true],10,0,23.5,0,0,"recess",0, // button "add2","button",2,33.5,20,"top",[0,0,0],["sbc-case_z",false,false,true],10,0,23.5,0,0,"recess",0, // button
"model","button_top",2,33.5,21,"top",[0,0,0],["sbc-case_z",false,false,true],10,0,23.5,0,0,"recess",0, // button top "model","button_top",2,33.5,20,"top",[0,0,0],["sbc-case_z",false,false,true],10,0,23.5,0,0,"recess",0, // button top
"platter","button_top",-20,0,0,"top",[0,0,0],["case",false,false,false],10,0,23.5,0,0,"recess",0, // button top "platter","button_top",-20,0,0,"top",[0,0,0],["case",false,false,false],10,0,23.5,0,0,"recess",0, // button top
"sub","rectangle",73.5,5.5,3.5,"top",[0,0,45],["sbc",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",73.5,5.5,2.5,"top",[0,0,45],["sbc",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",5.5,56,3.5,"top",[0,0,0],["sbc",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",5.5,56,2.5,"top",[0,0,0],["sbc",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",81.5,56,3.5,"top",[0,0,0],["sbc",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim "sub","rectangle",81.5,56,2.5,"top",[0,0,0],["sbc",true,true,true],3,11,15,0,0,"vertical",[1,1,1,1], // standoff trim
"sub","rectangle",17.5,12,3.5,"top",[0,0,0],["sbc",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1]], // standoff trim "sub","rectangle",17.5,12,2.5,"top",[0,0,0],["sbc",true,true,true],11,3,15,0,0,"vertical",[1,1,1,1]], // standoff trim
["m1s_panel", ["m1s_panel",
"sub","vent_hex",10,29,-1,"bottom",[0,0,0],["sbc",true,true,false],21,5,8,5,1.5,"horizontal",1], // vent opening "sub","vent_hex",10,29,-1,"bottom",[0,0,0],["sbc",true,true,false],21,5,8,5,1.5,"horizontal",1], // vent opening