50 Commits

Author SHA1 Message Date
Edward Kisiel
1f2bb6613a added h4, h4+ and h4_ultra with updated sbc model framework 2024-04-29 18:29:39 -04:00
Edward Kisiel
a3f576edb9 changed adapter hole size to 4mm 2024-04-29 10:54:00 -04:00
Edward Kisiel
ddd7c0b4bd removed unneeded h3_port_extender.stl model and updated readme.md 2024-04-28 13:43:58 -04:00
Edward Kisiel
8e73d4550f updated readme.md and sbc library 2024-04-27 17:11:13 -04:00
Edward Kisiel
821deb2445 updated sbc_model_framework 2024-04-26 10:15:55 -04:00
Edward Kisiel
e6cb0b3b8c adjusted io shield opening, moved access panel in platter view and cleaned up accessory entries. 2024-04-26 10:07:21 -04:00
Edward Kisiel
045aa2874a finished named standoff size for extended standoffs, added mini-stx-thin adapter and io shield, updated readme.md and other fixes. 2024-04-24 16:09:44 -04:00
Edward Kisiel
74084eebde implemented named fastener size m2, m2.5, m3, m4 and custom for top and bottom standoffs 2024-04-22 20:49:03 -04:00
Edward Kisiel
0807d49dbb fixed model view sections, fixed tray cases nut holder placement, changed fan mask direction and finalized standard form adapters and cases. 2024-04-22 16:09:31 -04:00
Edward Kisiel
42593fa92f fixed z axis parametric problem related to calculated bottom standoff height, more case cleanup and other fixes and changes 2024-04-20 17:27:54 -04:00
Edward Kisiel
2eef11f03f finished library documentation update, added fan and hd masks and other fixes 2024-04-18 19:47:42 -04:00
Edward Kisiel
125ec3a477 documentation work and other cleanup and fixes 2024-04-17 17:31:50 -04:00
Edward Kisiel
50f71b69e3 fixed tray side fastener placement when using extend standoffs, more standard mb case and adapter changes 2024-04-14 16:48:36 -04:00
Edward Kisiel
f56302f7a8 initial fan models 40mm, 50mm, 60mm, 80mm, 92mm, 120mm, 140mm without vanes 2024-04-13 16:36:59 -04:00
Edward Kisiel
5c7f917b9f plumbed accessory support for standard mb form adapters, added mini-stx adapter and initial work for standard mb form cases 2024-04-13 14:36:52 -04:00
Edward Kisiel
3277cc8d07 adjustments for case adapters and io plate, remove unneed stl models 2024-04-10 21:02:45 -04:00
Edward Kisiel
4f7aa53050 legacy case adapters added 2024-04-09 22:05:00 -04:00
Edward Kisiel
dc12d7f6a1 added linear top and bottom vents and removed unused exhaust vent variable 2024-04-07 16:31:30 -04:00
Edward Kisiel
8e89257759 rewrote tray side attachment routine based on SBC standoff location 2024-04-07 15:20:37 -04:00
Edward Kisiel
40e8e6bfff removed case_style and added new case_design names as replacement 2024-04-07 12:33:56 -04:00
Edward Kisiel
f5130023f0 added bottom access panel in gui and changed all related uses for accessories 2024-04-06 21:16:28 -04:00
Edward Kisiel
6a855e1ef6 finished initial accessory case conversion to new format 2024-04-06 15:59:45 -04:00
Edward Kisiel
de063b31f8 converted h3_port_extender and components from stl and implemented automask, more case conversions 2024-03-31 14:53:06 -04:00
Edward Kisiel
88691a6b61 added db9 to dsub.scad in library 2024-03-28 14:31:27 -04:00
Edward Kisiel
8a0e9f17a0 more custom case conversion to use auto-mask 2024-03-21 17:16:07 -04:00
Edward Kisiel
f71bc2e2d0 fixed regression in standoff supports and more model cahnges to support auto mask generation 2024-03-21 12:30:35 -04:00
Edward Kisiel
0fb0f4daef various plumbing to implement auto-masks for library, config changes and other modifications 2024-03-16 17:39:23 -04:00
Edward Kisiel
8bf424b99b changed oem_hk to shared component lib, added new standoff end type none 2024-03-15 15:26:23 -04:00
Edward Kisiel
2dc8e16f1e library conversion and masks for boom_speaker, hk_boom_speaker, hk_boom, hk_pwr_button, hk_m1s_ups 2024-03-05 17:52:00 -05:00
Edward Kisiel
e7b85fa217 library masks for hk_vu7c, hk_vu8m, hk_vu8s 2024-03-04 16:25:16 -05:00
Edward Kisiel
9e8fe8006f more library cleanup and mask creation for buttons and hk35_lcd 2024-03-04 11:11:24 -05:00
Edward Kisiel
c1aa6bb353 completed library masks for access_port, standoff, hc4_olded, hc4_oled_holder, hk_netcard 2024-02-28 19:38:49 -05:00
Edward Kisiel
e46ac774e4 created ui enable for individual top, bottom and extended standoffs with associated plumbing 2024-02-26 13:22:57 -05:00
Edward Kisiel
d5d23fba18 started cleaning json and cfg file, updated ui and added new features 2024-02-25 21:39:41 -05:00
Edward Kisiel
2c61849665 top and bottom extended standoff ui added and plumbed for control 2024-02-25 16:14:30 -05:00
Edward Kisiel
0b99ea5805 added sbc information in ui and plumbed 2024-02-24 21:31:38 -05:00
Edward Kisiel
2b430275cb standoff sidewall support moved to standoff module, top and bottom standoffui changes 2024-02-24 20:48:41 -05:00
Edward Kisiel
b6eb06f97c more work on mask integration and cleanup 2024-02-24 16:13:15 -05:00
Edward Kisiel
7b03aa1922 plumed in mask for add and sub parametric moves 2024-02-24 12:30:56 -05:00
Edward Kisiel
fd688d53c3 added mask variable in sbc_case_builder_accessories.cfg for all entries 2024-02-23 21:27:22 -05:00
Edward Kisiel
543162c61c sbc_case_builder_accessories.cfg corrections 2024-02-23 17:29:59 -05:00
Edward Kisiel
506d29f34e convert accessory format to arrays for size and data 2024-02-23 16:08:35 -05:00
Edward Kisiel
8c0e333450 support for stl models with stl_model, start of library work, woek on adafruit model. 2024-02-22 15:14:08 -05:00
Edward Kisiel
7b9a18279d added sidewall support selection per standoff in gui and more work on top and bottom control 2024-02-19 09:57:55 -05:00
Edward Kisiel
a288a924d5 standoff variable seperation for gui, initial work for top and bottom standoffs 2024-02-19 09:57:55 -05:00
Edward Kisiel
6262684252 updated readme and sbcmf 2024-02-18 15:09:04 -05:00
Edward Kisiel
7559d48140 changed ui for improved folded case use 2024-02-18 12:32:32 -05:00
Edward Kisiel
5c43d0961d refinement and fixes for folded cases with ui improvements 2024-02-17 17:26:09 -05:00
Edward Kisiel
0d5f8ef357 more work on folded cases, added paper_full-top case 2024-02-16 22:54:10 -05:00
Edward Kisiel
1b549ac761 initial work for folded cases added case paper_split-top 2024-02-14 21:59:44 -05:00
42 changed files with 37433 additions and 32133 deletions

2527
README.md

File diff suppressed because it is too large Load Diff

24632
dxf/astroid_8mm.dxf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
// Gets a list of SBCs from the SBC Model Framework and Accessory sets
// for use with SBC Case Builder.
// After running this script, copy the output from the first Echo command into the
// list of SBC boards in `sbc_case_builder.scad:83`
// list of SBC boards in `sbc_case_builder.scad:32`
// Also copy the output from the second Echo command into the list of case acceessory
// sets in `sbc_case_builder.scad:164`
// sets in `sbc_case_builder.scad:196`
include <./SBC_Model_Framework/sbc_models.cfg>;
include <./sbc_case_builder_accessories.cfg>;

View File

@@ -15,85 +15,18 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
access_port(size, orientation)
access_cover(size, orientation)
access_panel(size, orientation, mask)
*/
/*
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"
*/
module access_port(size, orientation) {
floorthick = size[2];
adj = .01;
$fn = 90;
if(orientation == "portrait") {
difference() {
union() {
cube([size[0], size[1], size[2]]);
// access panel support
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-adj]) cube([20, 9.5, floorthick]);
translate([1, 0, floorthick-adj]) cube([size[0]-2, 5, 4.5]);
}
// access opening
translate([.5, 6, -adj]) cube([size[0]-1.15, size[1]-17, floorthick+(adj*2)]);
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])
cylinder(r=3.2, h=floorthick+(adj*2)+5, $fn=6);
translate([(size[0]/2)+.25, size[1]-6.5, -adj])
cylinder(d=3.2, h=floorthick+(adj*2)+5);
translate([4, 2+adj, floorthick]) cube([7.75, 3, 2.75]);
translate([size[0]-13, 2+adj, floorthick]) cube([7.75, 3, 2.75]);
if(size[0] > 100) {
translate([(size[0]/2), 2+adj, floorthick]) cube([7.75, 3, 2.75]);
}
}
}
if(orientation == "landscape") {
difference() {
union() {
translate([0, -1, 0]) cube([size[0], size[1], size[2]]);
// access panel support
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-adj]) cube([9.5, 20, floorthick]);
translate([0, 0, floorthick-adj]) cube([5, size[1]-2, 4.5]);
}
// access opening
translate([6, -.5, -adj]) cube([size[0]-17, size[1]-1.15, floorthick+(adj*3)]);
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])
cylinder(r=3.2, h=floorthick+(adj*2)+5, $fn=6);
translate([size[0]-6.5, (size[1]/2)-.5, -adj])
cylinder(d=3.2, h=floorthick+(adj*2)+5);
translate([2+adj, 3, floorthick]) cube([3, 8.25, 2.75]);
translate([2+adj, size[1]-13, floorthick]) cube([3, 8.25, 2.75]);
if(size[1] > 100) {
translate([2+adj, (size[1]/2)-(7.75/2)-1.25, floorthick]) cube([3, 7.75, 2.5]);
}
}
}
}
/*
NAME: access_cover
DESCRIPTION: creates covers for access port openings
TODO: none
USAGE: access_port(size[], orientation)
USAGE: access_panel(size[], orientation)
size[0] = size_x
size[1] = size_y
@@ -103,43 +36,135 @@ module access_port(size, orientation) {
module access_cover(size, orientation) {
size_x = size[0];
size_y = size[1];
floorthick = size[2];
adj = .01;
$fn = 90;
if(orientation == "portrait") {
difference() {
union() {
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([1, 6.25, floorthick-adj]) cube([size[0]-2.15, 6, floorthick]);
translate([1, 6.25, 0]) cube([size_x-2.15, size_y-17.5, floorthick]);
translate([(size_x/2)-4.75, size_y-12.25, 0]) slab([10, 5, floorthick], 5);
translate([1, 6.25, floorthick-adj]) cube([size_x-2.15, 6, floorthick]);
translate([4.25, 3, floorthick]) cube([7.25, 4, 2]);
translate([size[0]-12.75, 3, floorthick]) cube([7.25, 4, 2]);
if(size[0] > 100) {
translate([(size[0]/2)+.25, 3, floorthick]) cube([7.25, 4, 2]);
translate([size_x-12.75, 3, floorthick]) cube([7.25, 4, 2]);
if(size_x > 100) {
translate([(size_x/2)+.25, 3, floorthick]) cube([7.25, 4, 2]);
}
}
translate([(size[0]/2)+.25, size[1]-6.5, -floorthick-adj])
translate([(size_x/2)+.25, size_y-6.5, -floorthick-adj])
cylinder(d=3.2, h=(floorthick*2)+(adj*2));
translate([(size[0]/2)+.25, size[1]-6.5, -adj])
translate([(size_x/2)+.25, size_y-6.5, -adj])
cylinder(d1=6, d2=3.2, h=floorthick);
}
}
if(orientation == "landscape") {
difference() {
union() {
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([6.25, 0, floorthick-adj]) cube([6,size[1]-2.15, floorthick]);
translate([6.25, 0, 0]) cube([size_x-17.75, size_y-2, floorthick]);
translate([size_x-12.25, (size_y/2)-5.75, 0]) slab([5, 10, floorthick], 5);
translate([6.25, 0, floorthick-adj]) cube([6,size_y-2.15, floorthick]);
translate([3.5+adj, 3.25, floorthick]) cube([4, 7.25, 2]);
translate([3.5+adj, size[1]-12.75, floorthick]) cube([4, 7.25, 2]);
if(size[1] > 100) {
translate([3.5+adj, (size[1]/2)-(7.75/2)-1, floorthick]) cube([4, 7.25, 2]);
translate([3.5+adj, size_y-12.75, floorthick]) cube([4, 7.25, 2]);
if(size_y > 100) {
translate([3.5+adj, (size_y/2)-(7.75/2)-1, floorthick]) cube([4, 7.25, 2]);
}
}
translate([size[0]-6.5, (size[1]/2)-.75, -floorthick-adj])
translate([size_x-6.5, (size_y/2)-.75, -floorthick-adj])
cylinder(d=3.2, h=(floorthick*2)+(adj*2));
translate([size[0]-6.5, (size[1]/2)-.75, -adj])
translate([size_x-6.5, (size_y/2)-.75, -adj])
cylinder(d1=6, d2=3.2, h=floorthick);
}
}
}
/*
NAME: access_panel
DESCRIPTION: creates opening and structure for access openings
TODO: none
USAGE: access_panel(size[], orientation, mask)
size[0] = size_x
size[1] = size_y
size[2] = floor thickness
orientation = "landscape", "portrait"
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module access_panel(size, orientation, mask) {
size_x = size[0];
size_y = size[1];
floorthick = size[2];
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(enablemask == true && mstyle == "default") {
if(orientation == "portrait") {
translate([0,0,floorthick+adj-mlength+msetback]) cube([size_x, size_y, mlength]);
}
if(orientation == "landscape") {
translate([0, -1, floorthick+adj-mlength+msetback]) cube([size_x-1, size_y, mlength]);
}
}
if(enablemask == false) {
if(orientation == "portrait") {
difference() {
union() {
cube([size_x, size_y, floorthick]);
// access panel support
translate([(size_x/2)+.25, size_y-6.5, 0]) cylinder(d=9, h=floorthick+(adj*2)+5);
translate([(size_x/2)-10, size_y-11, floorthick-adj]) cube([20, 9.5, floorthick]);
translate([1, 0, floorthick-adj]) cube([size_x-2, 5, 4.5]);
}
// access opening
translate([.5, 6, -adj]) cube([size_x-1.15, size_y-17, floorthick+(adj*2)]);
translate([(size_x/2)-5, size_y-12, -adj]) slab([10.5, 5.5, floorthick], 5.5);
translate([(size_x/2)+.25, size_y-6.5, floorthick+2])
cylinder(r=3.2, h=floorthick+(adj*2)+5, $fn=6);
translate([(size_x/2)+.25, size_y-6.5, -adj])
cylinder(d=3.2, h=floorthick+(adj*2)+5);
translate([4, 2+adj, floorthick]) cube([7.75, 3, 2.75]);
translate([size_x-13, 2+adj, floorthick]) cube([7.75, 3, 2.75]);
if(size_x > 100) {
translate([(size_x/2), 2+adj, floorthick]) cube([7.75, 3, 2.75]);
}
}
}
if(orientation == "landscape") {
difference() {
union() {
translate([0, -1, 0]) cube([size_x, size_y, floorthick]);
// access panel support
translate([size_x-6.5, (size_y/2)-.5, 0]) cylinder(d=9, h=floorthick+(adj*2)+5);
translate([size_x-11, (size_y/2)-10.5, floorthick-adj]) cube([9.5, 20, floorthick]);
translate([0, 0, floorthick-adj]) cube([5, size_y-2, 4.5]);
}
// access opening
translate([6, -.5, -adj]) cube([size_x-17, size_y-1.15, floorthick+(adj*3)]);
translate([size_x-12, (size_y/2)-6, -adj]) slab([5.5, 10.5, floorthick], 5.5);
translate([size_x-6.5, (size_y/2)-.5, floorthick+2]) rotate([0, 0, 30])
cylinder(r=3.2, h=floorthick+(adj*2)+5, $fn=6);
translate([size_x-6.5, (size_y/2)-.5, -adj])
cylinder(d=3.2, h=floorthick+(adj*2)+5);
translate([2+adj, 3, floorthick]) cube([3, 8.25, 2.75]);
translate([2+adj, size_y-13, floorthick]) cube([3, 8.25, 2.75]);
if(size_y > 100) {
translate([2+adj, (size_y/2)-(7.75/2)-1.25, floorthick]) cube([3, 7.75, 2.5]);
}
}
}
}
}

View File

@@ -15,20 +15,45 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
art(scale_d1, size_z, filename)
stl_model(scale_d1, filename)
*/
/*
NAME: art
DESCRIPTION: create artwork using dxf or svf
DESCRIPTION: create 2d artwork using dxf or svf
TODO: none
USAGE: art(scale_d1, size_z, type)
USAGE: art(scale_d1, size_z, filename)
scale_d1 = amount to scale file
size_z = floor thickness
type = file name
filename = file name
*/
module art(scale_d1, size_z, type) {
module art(scale_d1, size_z, filename) {
linear_extrude(height = size_z) import(file = type, scale=scale_d1);
linear_extrude(height = size_z) import(file = filename, scale=scale_d1);
}
/*
NAME: stl_model
DESCRIPTION: import 3d artwork using stl
TODO: none
USAGE: stl_model(scale_d1, filename)
scale_d1 = amount to scale file
filename = file name
*/
module stl_model(scale_d1, filename) {
import(file = filename, scale=scale_d1);
}

View File

@@ -17,10 +17,11 @@
battery(type)
battery_clip(bat_dia = 18.4)
module batt_holder(tolerance)
batt_holder(tolerance)
*/
/*
NAME: battery
DESCRIPTION: creates 18650 and 21700 batteries
@@ -37,7 +38,7 @@ module battery(type) {
if(type == "18650") {
difference() {
cylinder(d=18.4, h=65);
color("#73bc73") cylinder(d=18.4, h=65);
translate([0,0,65-4]) difference() {
cylinder(d=18.5, h=2);
cylinder(d=17.5, h=3);
@@ -46,20 +47,21 @@ module battery(type) {
}
if(type == "18650_convex") {
difference() {
cylinder(d=18.4, h=68);
color("#73bc73") cylinder(d=18.4, h=68);
translate([0,0,65-4]) difference() {
cylinder(d=18.5, h=2);
cylinder(d=17.5, h=3);
color("#73bc73") cylinder(d=18.5, h=2);
color("#73bc73") cylinder(d=17.5, h=3);
}
translate([0,0,65-adj]) difference() {
cylinder(d=18.5, h=3+2*adj);
cylinder(d=14.4, h=3+2*adj);
color("silver") cylinder(d=18.5, h=3+2*adj);
color("silver") cylinder(d=14.4, h=3+2*adj);
}
color("silver") translate([0,0,68-adj]) cylinder(d=14.4, h=.1);
}
}
if(type == "21700") {
difference() {
cylinder(d=21, h=70);
color("#73bc73") cylinder(d=21, h=70);
translate([0,0,70-4]) difference() {
cylinder(d=21.1, h=2);
cylinder(d=20.1, h=3);

View File

@@ -15,63 +15,88 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
button(style, diameter, height)
buttons(style, diameter, height, mask)
button_assembly(style, diameter, height)
button_clip(style)
button_plunger(style, diameter, height)
button_top(style, diameter, height)
button_clip(style)
*/
/*
NAME: button
NAME: buttons
DESCRIPTION: creates different button bodys and styles
TODO: none
USAGE: button(style, diameter, height)
USAGE: buttons(style, size, radius, post, mask)
style = "recess", "cutout"
diameter = diameter of button body
height = height above button
size[0] = diameter of button body
size[2] = height above button
radius = radius for cutout style
post = button post size for cutout style
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module button(style, size, radius, pad) {
module buttons(style, size, radius, post, mask) {
size_x = size[0];
size_y = size[1];
size_z = size[2];
diameter = size[0];
height = size[2];
gap = 1.5;
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(style == "recess") {
difference() {
union() {
sphere(d=diameter);
translate([0,0,-height+3]) cylinder(d=6, h=height-6);
}
translate([-(diameter/2)-1,-(diameter/2)-1,0]) cube([diameter+2,diameter+2,(diameter/2)+2]);
difference() {
union() {
sphere(d=diameter-2);
}
}
translate([-1.75,-1.25,-height-1]) cube([3.5,2.5,height+2]);
translate([0,0,-(diameter/2)]) cylinder(d=5, h=2);
if(enablemask == true && mstyle == "default") {
if(style == "recess") {
translate([0, 0, -adj-msetback]) cylinder(d = diameter-2*adj, h = mlength);
}
if(style == "cutout") {
translate([-size[0]+2.5, -2.5-size[1]/2, -adj-msetback]) cube([size[0]+1, size[1]+5, mlength]);
}
}
if(style == "cutout") {
difference() {
translate([-size[0]+2,-3-size[1]/2,0]) slab_r([size[0]+2,size[1]+6,size[2]-2*adj], [.1,.1,.1,.1]);
if(enablemask == false) {
if(style == "recess") {
difference() {
translate([-size[0]+3,-size[1]/2,-adj])
slab_r([size[0],size[1],size[2]], [radius[0],radius[1],radius[2],radius[3]]);
translate([-size[0]+3+(gap/2),-size[1]/2+(gap/2),-1]) slab_r([size[0]-gap,size[1]-gap,1+size[2]+2*adj],
[radius[0],radius[1],radius[2]-gap/2,radius[3]-gap/2]);
translate([-size[0]+3-gap,-1,-1]) cube([gap*2,2,1+height+2*adj]);
union() {
sphere(d=diameter);
translate([0,0,-height+3]) cylinder(d=6, h=height-6);
}
translate([-(diameter/2)-1,-(diameter/2)-1,0]) cube([diameter+2,diameter+2,(diameter/2)+2]);
difference() {
union() {
sphere(d=diameter-2);
}
}
translate([-1.75, -1.25, -height-1]) cube([3.5, 2.5, height+2]);
translate([0,0,-(diameter/2)]) cylinder(d=5, h=2);
}
translate([0,0,2]) sphere(d=3);
}
translate([0,0,-pad+adj]) cylinder(d=3, h=pad);
if(style == "cutout") {
difference() {
translate([-size[0]+2, -3-size[1]/2, 0]) slab_r([size[0]+2,size[1]+6,size[2]-2*adj], [.1,.1,.1,.1]);
difference() {
translate([-size[0]+3, -size[1]/2, -adj])
slab_r([size[0],size[1],size[2]], [radius[0],radius[1],radius[2],radius[3]]);
translate([-size[0]+3+(gap/2), -size[1]/2+(gap/2), -1]) slab_r([size[0]-gap,size[1]-gap,1+size[2]+2*adj],
[radius[0],radius[1],radius[2]-gap/2,radius[3]-gap/2]);
translate([3-size[0]-gap, -1, -1]) cube([gap*2, 2, 1+height+2*adj]);
}
translate([0, 0, 2]) sphere(d=3);
}
translate([0, 0, adj-post]) cylinder(d=3, h=post);
}
}
}
@@ -101,6 +126,31 @@ $fn = 90;
}
/*
NAME: button_clip
DESCRIPTION: creates button c-clip
TODO: none
USAGE: button_clip(style)
style = "recess", "cutout"
*/
module button_clip(style) {
adj = .01;
$fn = 90;
if(style == "recess") {
difference() {
cylinder(d=8.5, h=.8);
translate([-1.5,-1.75,-adj]) cube([2.75,3.5,1]);
translate([-.75,-.75,-adj]) cube([5,1.25,1.25]);
}
}
}
/*
NAME: button_plunger
DESCRIPTION: creates button plunger
@@ -153,29 +203,4 @@ $fn = 90;
translate([-1.25,-1.25,-3-adj]) cube([2.5,2.5,2]);
}
}
}
/*
NAME: button_top
DESCRIPTION: creates button c-clip
TODO: none
USAGE: button_clip(style)
style = "recess", "cutout"
*/
module button_clip(style) {
adj = .01;
$fn = 90;
if(style == "recess") {
difference() {
cylinder(d=8.5, h=.8);
translate([-1.5,-1.75,-adj]) cube([2.75,3.5,1]);
translate([-.75,-.75,-adj]) cube([5,1.25,1.25]);
}
}
}
}

View File

@@ -15,8 +15,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
cableholder_spacer()
*/
/*
NAME: cableholder_spacer
DESCRIPTION: creates 18650 and 21700 batteries
DESCRIPTION: creates spacer and cable holder for drive mounts
TODO: none
USAGE: cableholder_spacer()

View File

@@ -1,335 +0,0 @@
/*
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
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
dsub(dsubsize, mask = false)
hdmi_a()
header_f(pins, height)
usb_micro()
uart_micro()
rj45()
header(pins)
encl_header_12()
micro2pin()
audio_jack35()
capacitor(diameter, height)
ic(size)
led(ledcolor = "red")
usbc()
*/
/*
NAME: hdmi_a
DESCRIPTION: hdmi-a female model
TODO: none
USAGE: hdmi_a()
*/
module hdmi_a() {
size_x = 14.5;
size_y = 11.5;
translate([0,0,.75])
union() {
difference() {
color("silver") translate([0,0,0]) cube([size_x, size_y, 5.5]);
color("dimgray") translate([.5,-.1,.5]) cube([13.5, 11, 4.5]);
color("silver") translate([0,-.1,0]) rotate ([-90,0,0])
cylinder(d=4, h=13.5,$fn=30);
color("silver") translate([14.5,-.1,0]) rotate ([-90,0,0])
cylinder(d=4, h=13.5,$fn=30);
}
difference() {
union() {
color("silver") translate([0,-.1,0]) rotate ([-90,0,0])
cylinder(d=4, h=11.5,$fn=30);
color("silver") translate([14.5,-.1,0]) rotate ([-90,0,0])
cylinder(d=4, h=11.5,$fn=30);
}
color("silver") translate([0,-.2,0]) rotate ([-90,0,0])
cylinder(d=3, h=13.5,$fn=30);
color("silver") translate([14.5,-.2,0]) rotate ([-90,0,0])
cylinder(d=3, h=13.5,$fn=30);
color("silver") translate([-3,-1,-3]) cube([3,13.5,7.5]);
color("silver") translate([14.5,-1,-3]) cube([3,13.5,7.5]);
color("silver") translate([-1,-1,-3]) cube([16.5,13.5,3]);
}
color("black") translate([2.5,.5,2.25]) cube([9.25,10.5,1.5]);
}
}
// single row female headers
module header_f(pins, height) {
adj = .01;
$fn = 90;
size_x = 2.5;
size_y = 2.5 * pins;
union() {
color("black") cube([size_x, size_y, height]);
for (i=[1:2.5:size_y]) {
color("dimgray") translate ([1,i,height-5+adj]) cube([.64,.64,5]);
}
}
}
// uart micro connector type
module uart_micro() {
size_x = 12.5;
size_y = 5;
union() {
difference() {
union() {
difference () {
color("white") translate([0,0,0]) cube([size_x,size_y,6]);
color("darkgray") translate([.5,.5,2]) cube([11.5,4,6]);
}
}
color("white") translate([12.5,0,-.5]) cube([2,6,7]);
color("white") translate([-1,0,-.5]) cube([1,6,7]);
color("white") translate([-1,5,-.5]) cube([14,2,7]);
color("darkgray") translate([-1,1.5,2]) cube([14,1,7]);
}
for (i=[2.5:2.5:10]) {
color("silver") translate ([i,3,.5]) cube([.6,.6,5]);
}
}
}
// usb2 micro otg
module usb_micro() {
size_x = 7;
size_y = 4.5;
union() {
difference () {
color("silver") translate([0,0,0]) cube([size_x, size_y, 3.5]);
color("dimgray") translate([.5,-.1,.5]) cube([6, 3.5, 2.5]);
color("silver") translate([0,-.1,0]) rotate ([-90,0,0])
cylinder(d=2.5, h=6.5,$fn=30);
color("silver") translate([7,-.1,0]) rotate ([-90,0,0])
cylinder(d=2.5, h=6.5,$fn=30);
}
difference() {
union() {
color("silver") translate([0,-.1,0]) rotate ([-90,0,0])
cylinder(d=2.5, h=4.5,$fn=30);
color("silver") translate([7,-.1,0]) rotate ([-90,0,0])
cylinder(d=2.5, h=4.5,$fn=30);
}
color("silver") translate([0,-.2,0]) rotate ([-90,0,0])
cylinder(d=1.25, h=6.5,$fn=30);
color("silver") translate([7,-.2,0]) rotate ([-90,0,0])
cylinder(d=1.25, h=6.5,$fn=30);
color("silver") translate([-3,-1,-3]) cube([3,6.5,7.5]);
color("silver") translate([7,-1,-3]) cube([3,6.5,7.5]);
color("silver") translate([0,-1,-3]) cube([9,6.5,3]);
color("silver") translate([-1,-1,-3]) cube([9,6.5,3]);
}
color("black") translate([1.5,.5,1.25]) cube([4,3.5,1]);
}
}
// rj45 single socket
module rj45(x,y,rotation,side,pcbsize_z) {
size_x = 15.9;
size_y = 21.3;
place(x,y,0,size_x,size_y,rotation,side)
union() {
difference () {
color("lightgray") translate([0,0,0]) cube([size_x, size_y, 13.5]);
color("darkgray") translate([1.5,-1,1.5]) cube([13, 19.5, 8]);
color("darkgray") translate([5.5,-2,7]) cube([5, 19.5, 5]);
}
color("green") translate([2,-.1,10]) cube([3, 2, 2]);
color("orange") translate([11,-.1,10]) cube([3, 2, 2]);
}
}
// momentary_4.5x4.5x1.5 button
module momentary45x15() {
adj = .01;
$fn = 90;
size_x = 4.5;
size_y = 4.5;
size_z = 3.1;
union() {
color("black") translate([0,0,0]) cube([size_x,size_y,3]);
color("silver") translate([0,0,3-adj]) cube([size_x,size_y,.1]);
color("black") translate([2.25,2.25,3.1-adj]) cylinder(d=2.35,h=1.50);
color("black") translate([.75,.75,3]) sphere(d=.75);
color("black") translate([.75,3.75,3]) sphere(d=.75);
color("black") translate([3.75,.75,3]) sphere(d=.75);
color("black") translate([3.75,3.75,3]) sphere(d=.75);
}
}
// single row headers
module header(pins) {
adj = .01;
$fn = 90;
size_x = 2.54;
size_y = 2.54 * pins;
union() {
color("black") translate([0,0,0]) cube([size_x, size_y, 2.5]);
for (i=[1:2.54:size_y]) {
color("silver") translate ([1,i,2.5]) cube([.64,.64,5]);
}
}
}
// gpio 12 enclosed header
module encl_header_12() {
size_x = 19.5;
size_y = 5.5;
union() {
difference () {
color("black") translate([0,0,0]) cube([size_x,size_y,6.25]);
color ("dimgray") translate ([.5,.5,.6]) cube([18.5,4.5,5.75]);
}
for (i=[4.5:2:16]) {
color("silver") translate ([i,1.5,1]) cube([.5,.5,5]);
color("silver") translate ([i,3.5,1]) cube([.5,.5,5]);
}
}
}
// micro connector type
module micro2pin() {
size_x = 7.5;
size_y = 3.75;
union() {
difference () {
color("white") translate([0,0,0]) cube([size_x,size_y,4.75]);
color("darkgray") translate([1.5,.5,1]) cube([4.5,2.75,6]);
color("white") translate([-.5,.75,-.5]) cube([1,2.5,6]);
color("white") translate([7,.75,-.5]) cube([1,2.5,6]);
color("darkgray") translate([2.25,-.5,1]) cube([3,2,6]);
}
color("silver") translate ([2.75,2,.5]) cube([.6,.6,4]);
color("silver") translate ([4.5,2,.5]) cube([.6,.6,4]);
}
}
// 3.5mm audio plug
module audio_jack35() {
adj = .01;
$fn = 90;
size_x = 6.5;
size_y = 13.5;
difference () {
union() {
color("dimgray") cube([size_x,size_y,3]);
color("dimgray") cube([size_x,5.6,4]);
color("dimgray") translate([size_x/2,0,2.25]) rotate([-90,0,0]) cylinder(d=6, h=size_y);
}
color("gray") translate([size_x/2,0,2.25]) rotate([-90,0,0]) cylinder(d=3, h=size_y+adj);
}
}
// can capacitor
module capacitor(diameter, height) {
adj = .01;
$fn = 90;
color("dimgray") rotate([0,0,0]) cylinder(d=diameter+.5, h=.5);
color("silver") translate([0,0,.5]) cylinder(d=diameter+.5, h=.5);
color("silver") translate([0,0,1]) cylinder(d=diameter, h=height-1);
}
// ic
module ic(size) {
color("dimgray") cube(size);
}
// d-sub connector
module dsub(dsubsize, mask = false) {
adj=.01;
$fn = 90;
if(mask == true) {
union() {
translate([-1, 1, -.75]) rotate([90,0,0]) slab_r([19,10.5,10], [4,4,4,4]);
translate([-4, 1, 4.5]) rotate([90,0,0]) cylinder(h=10, d=3);
translate([21, 1, 4.5]) rotate([90,0,0]) cylinder(h=10, d=3);
}
}
else {
if(dsubsize[0] == 9 && dsubsize[1] == "female") {
translate([8.5,0.4,4.5]) rotate([90,0,0]) import("./stl/db9_f.stl");
}
if(dsubsize[0] == 9 && dsubsize[1] == "male") {
translate([8.5,0.4,4.5]) rotate([90,0,0]) import("./stl/db9_m.stl");
}
}
}
module led(ledcolor = "red") {
color(ledcolor) cube([3,1.5,.4]);
color("silver") cube([.5,1.5,.5]);
color("silver") translate([2.5,0,0]) cube([.5,1.5,.5]);
}
module usbc() {
$fn=90;
adj = .01;
// usbc horizontal type
size_x = 9;
size_y = 7;
dia = 3.5;
diam = 3.75;
rotate([90, 0, 0]) translate([dia/2, dia/2, -size_y]) union() {
difference () {
color("silver")
hull() {
translate([0,0,0]) cylinder(d=dia,h=size_y);
translate([size_x-dia,0,0]) cylinder(d=dia,h=size_y);
}
color("silver") translate([0,0,1])
hull() {
translate([0,0,0]) cylinder(d=3,h=size_y+.2);
translate([size_x-dia,0,0]) cylinder(d=3,h=size_y+.2);
}
}
color("black") translate([0,-1.2/2,.1]) cube([5.5,1.2,6]);
}
}

View File

@@ -15,75 +15,102 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
h3_port_extender(style, mask = false)
h3_port_extender_holder(part, offset)
hk_h3_port_extender(style, mask)
hk_h3_port_extender_holder(part, offset)
*/
/*
NAME: h3_port_extender
NAME: hk_h3_port_extender
DESCRIPTION: @mctom's odroid-h3 gpio port extender
TODO: none
USAGE: h3_port_extender(style, mask = false)
USAGE: hk_h3_port_extender(style, mask)
style = "header", "remote"
mask = true or false, mask for openings
style = "header", "remote"
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module h3_port_extender(style, mask = false) {
module hk_h3_port_extender(style, mask) {
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj=.01;
$fn = 90;
if(style == "header") {
if(mask == true) {
translate([-20, 6.25, 15]) cube([12, 7.5, 14.75]);
translate([-20, 15.875, 15]) cube([12, 7.5, 14.75]);
translate([-20, 25.375, 15]) cube([12, 7.5, 14.75]);
translate([-20, 17, 32.2]) rotate([0, 90, 0]) cylinder(d=3.5, h=12);
if(enablemask == true && mstyle == "default") {
translate([0, 14.5, 12-msetback]) cube([7.75, 15.75, mlength]);
translate([9.5, 14.5, 12-msetback]) cube([7.75, 15.75, mlength]);
translate([19, 14.5, 12-msetback]) cube([7.75, 15.75, mlength]);
translate([16, 32.2, 12-msetback]) cylinder(d=3, h=12);
}
else {
if(enablemask == false) {
// gpio 24 pin front position
color("silver") translate([1.6, 188.5, 84]) rotate([90, 0, 270]) import("stl/h3_port_extender.stl");
// color("dimgrey") translate([-3, 15.75, 0.25]) rotate([90, 180, 180]) import("stl/header_f_2x12_90.stl");
translate([0, 2, 8.25]) rotate([0, 180, 0]) header_f(12,8);
translate([-2.54, 2, 8.25]) rotate([0, 180, 0]) header_f(12,8);
color("dimgrey") translate([-2.5, 0, 29.5]) rotate([270, 0, 90]) import("stl/header_2x2_90.stl");
header("angled", -1.75, .1, 0, "top", 0, [12,2,8], ["thruhole","black","female",2.54,"silver"],
1.6, false, [true,10,2,"default"]);
difference() {
color("#008066") slab([33,35.25,1.6], .25);
color("#008066") translate([15.95,4.6,-1]) cylinder(d=3, h=6);
color("#008066") translate([15.95,32.15,-1]) cylinder(d=3, h=6);
}
header("angled", 27.65, 29.6, 0, "bottom", 90, [2,2,6], ["thruhole","black","male",2.54,"silver"],
1.6, false, [true,10,2,"default"]);
header("angled", 30.5, 16.5, 0, "bottom", 90, [5,2,6], ["thruhole","black","male",2.54,"silver"],
1.6, false, [true,10,2,"default"]);
usb2("single_up_a", .925, 15.375, 0, "top", 180, [0,10.5,0], [0], 1.6, false, [true,10,2,"default"]);
usb2("single_up_a", 10.395, 15.375, 0, "top", 180, [0,10.5,0], [0], 1.6, false, [true,10,2,"default"]);
usb2("single_up_a", 19.925, 15.375, 0, "top", 180, [0,10.5,0], [0], 1.6, false, [true,10,2,"default"]);
}
}
if(style == "remote") {
if(mask == true) {
translate([-19, 6.25, 15]) cube([12,7.5,14.75]);
translate([-19, 15.875, 15]) cube([12,7.5,14.75]);
translate([-19, 25.375, 15]) cube([12,7.5,14.75]);
translate([-19, 17, 32.2]) rotate([0,90,0]) cylinder(d=2.5, h=12);
translate([-19, 17, 4.6]) rotate([0,90,0]) cylinder(d=2.5, h=12);
if(enablemask == true && mstyle == "default") {
translate([0, 14.5, 12-msetback]) cube([7.75, 15.75, mlength]);
translate([9.5, 14.5, 12-msetback]) cube([7.75, 15.75, mlength]);
translate([19, 14.5, 12-msetback]) cube([7.75, 15.75, mlength]);
translate([16, 32.2, 12-msetback]) cylinder(d=3, h=12);
translate([16, 4.6, 12-msetback]) cylinder(d=3, h=mlength);
}
else {
if(enablemask == false) {
difference() {
color("#008066") slab([33,35.25,1.6], .25);
color("#008066") translate([15.95,4.6,-1]) cylinder(d=3, h=6);
color("#008066") translate([15.95,32.15,-1]) cylinder(d=3, h=6);
}
// gpio 24 pin front position
color("silver") translate([1.6, 188.5, 84]) rotate([90, 0, 270]) import("stl/h3_port_extender.stl");
color("dimgrey") translate([-2.5, 0, 29.5]) rotate([270, 0, 90]) import("stl/header_2x2_90.stl");
color("dimgrey")translate([9,-.5,12.75]) rotate([0,270,90]) import("stl/header_encl_2x5_90.stl");
translate([2, 2, 14.08]) rotate([0, 90, 0]) header(12);
translate([2, 2, 11.54]) rotate([0, 90, 0]) header(12);
header("open", .75, 9, 0, "bottom", 0, [12,2,6], ["thruhole","black","male",2.54,"silver"],
1.6, false, [true,10,2,"default"]);
header("angled", 27.65, 29.6, 0, "bottom", 90, [2,2,6], ["thruhole","black","male",2.54,"silver"],
1.6, false, [true,10,2,"default"]);
header("angled", 30.5, 16.5, 0, "bottom", 90, [5,2,6], ["thruhole","black","male",2.54,"silver"],
1.6, false, [true,10,2,"default"]);
usb2("single_up_a", .925, 15.375, 0, "top", 180, [0,10.5,0], [0], 1.6, false, [true,10,2,"default"]);
usb2("single_up_a", 10.395, 15.375, 0, "top", 180, [0,10.5,0], [0], 1.6, false, [true,10,2,"default"]);
usb2("single_up_a", 19.925, 15.375, 0, "top", 180, [0,10.5,0], [0], 1.6, false, [true,10,2,"default"]);
}
}
}
/*
NAME: h3_port_extender
NAME: hk_h3_port_extender_holder
DESCRIPTION: holder for the @mctom's remote h3 port extender
TODO: none
USAGE: h3_port_extender_holder(part, offset)
USAGE: hk_h3_port_extender_holder(part, offset)
part = "top","bottom","both"
mask = true or false, mask for openings
part = "top","bottom","both"
offset = distance from mount face
*/
module h3_port_extender_holder(part,offset=2) {
module hk_h3_port_extender_holder(part,offset=2) {
size = [16-offset,40,5.5];
adj = .01;

107
lib/dsub.scad Normal file
View File

@@ -0,0 +1,107 @@
/*
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
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
dsub(style, gender, mask)
*/
/*
NAME: dsub
DESCRIPTION: creates dsub connectors
TODO: 9db male, 25db male and female
USAGE: dsub(style, gender, mask)
style = "db9"
gender = "female","male"
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module dsub(style, gender, mask) {
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(enablemask == true && mstyle == "default") {
translate([0,0,-msetback]) union() {
hull() {
translate([-7,3,-5]) cylinder(d=3, h=11+mlength);
translate([7,3,-5]) cylinder(d=3, h=11+mlength);
translate([-6.25,-3,-5]) cylinder(d=3, h=11+mlength);
translate([6.25,-3,-5]) cylinder(d=3, h=11+mlength);
}
// mount holes
translate([-12.5,0,-5]) cylinder(d=3.5, h=11+mlength);
translate([12.5,0,-5]) cylinder(d=3.5, h=11+mlength);
}
}
if(enablemask == false) {
if(style == "db9" && gender =="female") {
difference() {
union() {
color("silver") hull() {
translate([-6.5,2.5,-5]) cylinder(d=3, h=11);
translate([6.5,2.5,-5]) cylinder(d=3, h=11);
translate([-5.75,-2.5,-5]) cylinder(d=3, h=11);
translate([5.75,-2.5,-5]) cylinder(d=3, h=11);
}
color("black") hull() {
translate([-6,2.25,-6]) cylinder(d=3, h=12.25);
translate([6,2.25,-6]) cylinder(d=3, h=12.25);
translate([-5.25,-2.25,-6]) cylinder(d=3, h=12.25);
translate([5.25,-2.25,-6]) cylinder(d=3, h=12.25);
}
// mount plate
translate([-15.5,-6.5,-.25]) slab([31,13,.5], 2);
// rear pins
color("silver") translate([-5.48,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([-2.74,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([0,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([2.74,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([5.48,1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([-4.12,-1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([-1.38,-1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([1.36,-1.4,-8]) cylinder(d=1.5, h=9);
color("silver") translate([4,-1.4,-8]) cylinder(d=1.5, h=9);
}
// mount holes
color("silver") translate([-12.5,0,-3]) cylinder(d=3.2, h=6);
color("silver") translate([12.5,0,-3]) cylinder(d=3.2, h=6);
// pin holes
color("silver") translate([-5.48,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([-2.74,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([0,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([2.74,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([5.48,1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([-4.12,-1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([-1.38,-1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([1.36,-1.4,-9]) cylinder(d=1, h=16);
color("silver") translate([4,-1.4,-9]) cylinder(d=1, h=16);
}
}
}
}

View File

@@ -15,11 +15,102 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
fans(style, mask)
fan_cover(size, thick)
fan_mask(size, thick, style)
*/
/*
NAME: fans
DESCRIPTION: creates different fan styles and sizes
TODO: add efficient vanes
USAGE: fans(style, mask)
style = "box",
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default", "fan_open", "fan_1", "fan_2", "fan_hex"
*/
module fans(style, mask) {
// size, thick, hole-spacing, hole-size, hub-size
fan_data = [
["box140x25", 140, 25, 124.5, 4.3, 40, "#353535"],
["box120x25", 120, 25, 105, 4.3, 40, "#353535"],
["box92x25", 92, 25, 82.5, 4.3, 40, "#353535"],
["box92x10", 92, 10, 82.5, 4.3, 40, "#353535"],
["box80x25", 80, 25, 72.5, 4.3, 35, "#353535"],
["box80x10", 80, 10, 72.5, 4.3, 35, "#353535"],
["box60x25", 60, 25, 50, 4.3, 30, "#353535"],
["box60x10", 60, 10, 50, 4.3, 30, "#353535"],
["box50x10", 60, 10, 40, 4.3, 20, "#353535"],
["box40x10", 40, 10, 32, 4.3, 18, "#353535"],
["box30x10", 30, 10, 24, 3.2, 12, "#353535"]
];
f = search([style],fan_data);
diameter = fan_data[f[0]][1];
thickness = fan_data[f[0]][2];
hole_space = fan_data[f[0]][3];
hole_size = fan_data[f[0]][4];
hole_offset = (diameter-hole_space)/2;
hub_size = fan_data[f[0]][5];
fan_color = fan_data[f[0]][6];
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(enablemask == true) {
if(mstyle == "fan_open") {
translate([0, 0, thickness-msetback+1]) fan_mask(diameter, mlength, "fan_open");
}
if(mstyle == "default" || mstyle == "fan_1") {
translate([0, 0, thickness-msetback+1]) fan_mask(diameter, mlength, "fan_1");
}
if(mstyle == "fan_2") {
translate([0, 0, thickness-msetback+1]) fan_mask(diameter, mlength, "fan_2");
}
if(mstyle == "fan_hex") {
translate([0, 0, thickness-msetback+1]) fan_mask(diameter, mlength, "fan_hex");
}
}
if(enablemask == false) {
difference() {
union() {
color(fan_color) slab([diameter, diameter, 3], 4);
color(fan_color) translate([0, 0, thickness-3]) slab([diameter, diameter, 3], 4);
color(fan_color) translate([diameter/2, diameter/2, 0]) cylinder(d=diameter+2, h=thickness);
}
// holes
color(fan_color) translate([diameter/2, diameter/2, -1]) cylinder(d=diameter-2, h=thickness+2);
color(fan_color) translate([hole_offset,hole_offset,-1]) cylinder(d=hole_size, h=thickness+2);
color(fan_color) translate([hole_offset,diameter-hole_offset,-1]) cylinder(d=hole_size, h=thickness+2);
color(fan_color) translate([diameter-hole_offset,hole_offset,-1]) cylinder(d=hole_size, h=thickness+2);
color(fan_color) translate([diameter-hole_offset,diameter-hole_offset,-1]) cylinder(d=hole_size, h=thickness+2);
// trim sides
color(fan_color) translate([-4,-4, -1]) cube([4, diameter+8, thickness+2]);
color(fan_color) translate([diameter,-4, -1]) cube([4, diameter+8, thickness+2]);
color(fan_color) translate([-4,-4, -1]) cube([diameter+8, 4, thickness+2]);
color(fan_color) translate([-4,diameter, -1]) cube([diameter+8, 4, thickness+2]);
}
color(fan_color) translate([diameter/2, diameter/2, thickness/2]) rotate([0,0,30])
cylinder_fillet_inside(h=thickness, r=hub_size/2, top=1, bottom=1, $fn=90, fillet_fn=90, center=true);
}
}
/*
NAME: fan_cover
DESCRIPTION: creates fan covers for fan openings
@@ -29,7 +120,7 @@
size = size of fan
thick = thickness of cover
style = fan mask style
style = "fan_open", "fan_1", "fan_2", "fan_hex"
*/
module fan_cover(size, thick, style) {
@@ -41,14 +132,14 @@ module fan_cover(size, thick, style) {
/*
DESCRIPTION: creates heatsink masks for openings
DESCRIPTION: creates fan masks for openings
TODO:
USAGE: heatsink_mask(size, thick, style)
USAGE: fan_mask(size, thick, style)
size = size of fan
thick = thickness of cover
style = 0="fan_open", 1="fan_1", 2="fan_2", 3"fan_hex"
size = size of fan
thick = thickness of cover
style = "fan_open", "fan_1", "fan_2", "fan_hex"
*/
module fan_mask(size, thick, style) {
@@ -60,7 +151,7 @@ module fan_mask(size, thick, style) {
$fn = 90;
adj = .01;
if(style == 0) {
if(style == "fan_open") {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-1);
// mount holes
@@ -69,7 +160,7 @@ module fan_mask(size, thick, style) {
translate([hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
}
if(style == 1 && size == 30) {
if(style == "fan_1" && size == 30) {
union() {
difference() {
@@ -97,7 +188,7 @@ module fan_mask(size, thick, style) {
}
}
}
if(style == 1 && size == 40) {
if(style == "fan_1" && size == 40) {
union() {
difference() {
@@ -129,7 +220,7 @@ module fan_mask(size, thick, style) {
}
}
}
if(style == 1 && (size == 50 || size == 60 || size == 70)) {
if(style == "fan_1" && (size == 50 || size == 60 || size == 70)) {
union() {
difference() {
@@ -163,7 +254,7 @@ module fan_mask(size, thick, style) {
}
}
}
if(style == 1 && size >= 80) {
if(style == "fan_1" && size >= 80) {
union() {
difference() {
@@ -213,7 +304,7 @@ module fan_mask(size, thick, style) {
}
}
}
if(style == 2) {
if(style == "fan_2") {
inner = size == 30 ? 24 :
size == 40 ? 32 :
@@ -248,16 +339,16 @@ module fan_mask(size, thick, style) {
}
}
translate([0, 0, 2])
translate([0, 0, 11])
union() {
cylinder(d=bar_size*2+0.1, thick+2); // Add a circle to prevent any tiny holes around cross bar
rotate([0, 0, 45]) cube([size, bar_size, thick+2], center=true);
rotate([0, 0, 45]) cube([bar_size, size, thick+2], center=true);
rotate([0, 0, 45]) cube([size, bar_size, thick+4], center=true);
rotate([0, 0, 45]) cube([bar_size, size, thick+4], center=true);
}
}
}
}
if(style == 3) {
if(style == "fan_hex") {
hex_pos = size == 30 ? [-11.75, -4.5, 0] :
size == 40 ? [-14, -11.25, 0] :

View File

@@ -16,10 +16,10 @@
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
m_insert(type="M3", icolor = "#ebdc8b")
screw(screw_type)
*/
/*
NAME: fan_cover
DESCRIPTION: creates fan covers for fan openings
@@ -46,33 +46,3 @@ module m_insert(type="M3", icolor = "#ebdc8b") { //#f4e6c3, #ebdc8b
cube([.5, .5, 1.5]);
}
}
/*
NAME: screw
DESCRIPTION: creates screws
TODO: needs improvement
USAGE: screw(screw_type)
screw_type = [d,l,style]
d = thread diameter
l = thread length
style = screw head style, 0 = Mushroom head, 5mm diameter
*/
module screw(screw_type) {
d = screw_type[0];
l = screw_type[1];
style = screw_type[2];
if(style == 0) {
difference() {
translate([ 0, 0, -0.3]) sphere(2.7);
translate([-10,-10,-10]) cube([20,20,10]);
translate([-10,-10, 2]) cube([20,20,10]);
}
}
rotate([180,0,0]) cylinder(d=d, h=l);
}

View File

@@ -15,6 +15,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
feet (diameter, height)
*/
/*
NAME: feet
DESCRIPTION: creates simple case feet
TODO: none

View File

@@ -15,120 +15,109 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
hd_mount(hd, orientation, position, side)
hd25(orientation, height, mask)
hd25_tab(side)
hd25_vtab(side)
hd35(orientation, mask)
hdd35_25holder(length)
hd35_tab(side)
hd35_vtab(side)
hd_bottom_holes(hd, orientation, position, side, thick)
hd25(height)
hd35()
hdd35_25holder(length)
hd_bottom_holes(hd, orientation, side, thick)
hd_mount(hd, orientation, position, side)
*/
/*
NAME: hd_mount
DESCRIPTION: creates 2.5" and 3.5" hard drive mounts
NAME: hd25
DESCRIPTION: creates 2.5" hard drive model
TODO: none
USAGE: hd_mount(hd, orientation, position, side)
USAGE: hd25(orientation, height, mask)
hd = 2.5, 3.5
orientation = "portrait", "landscape"
position = "vertical", "horizontal"
side = "left", "right"
orientation = "landscape", "portrait"
height = drive height
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default", "bottom", "side", "both"
*/
module hd_mount(hd, orientation, position, side) {
module hd25(orientation, height, mask) {
hd25_x = 100;
hd25_y = 69.85;
hd25_z = height;
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(hd == 2.5) {
if(orientation == "portrait") {
if(position == "vertical") {
if(side == "left") {
translate([0,14,0]) rotate([0,0,0]) hd25_vtab("right");
translate([0,90.6,0]) rotate([0,0,0]) hd25_vtab("right");
}
else { // right
translate([0,14,0]) rotate([0,0,0]) hd25_vtab("left");
translate([0,90.6,0]) rotate([0,0,0]) hd25_vtab("left");
}
}
else {
translate([-.5,14,0]) hd25_tab("left");
translate([-.5,90.6,0]) hd25_tab("left");
translate([70.35,14,0]) hd25_tab("right");
translate([70.35,90.6,0]) hd25_tab("right");
}
if(enablemask == true) {
if(orientation == "landscape" && (mstyle == "side" || mstyle == "both" || mstyle == "default")) {
translate([0, msetback, 0]) hd_holes(2.5, "landscape", "left", mlength);
translate([0, -msetback, 0]) hd_holes(2.5, "landscape", "right", mlength);
}
if(orientation == "landscape") {
if(position == "vertical") {
if(side == "left") {
translate([9.4,0,0]) rotate([0,0,90]) hd25_vtab("right");
translate([86,0,0]) rotate([0,0,90]) hd25_vtab("right");
}
else { // right
translate([9.4,0,0]) rotate([0,0,90]) hd25_vtab("left");
translate([86,0,0]) rotate([0,0,90]) hd25_vtab("left");
}
}
else {
translate([9.4,4.07-4.5,0]) rotate([0,0,90]) hd25_tab("left");
translate([86,4.07-4.5,0]) rotate([0,0,90]) hd25_tab("left");
translate([86,65.79+4.5,0]) rotate([0,0,90]) hd25_tab("right");
translate([9.4,65.79+4.5,0]) rotate([0,0,90]) hd25_tab("right");
}
if(orientation == "landscape" && (mstyle == "bottom" || mstyle == "both")) {
translate([0, 0, msetback]) hd_holes(2.5, "landscape", "bottom", mlength);
}
if(orientation == "portrait" && (mstyle == "side" || mstyle == "both" || mstyle == "default")) {
translate([msetback, 0, 0]) hd_holes(2.5, "portrait", "left", mlength);
translate([-msetback, 0, 0]) hd_holes(2.5, "portrait", "right", mlength);
}
if(orientation == "portrait" && (mstyle == "bottom" || mstyle == "both")) {
translate([0, 0, -mlength+msetback]) hd_holes(2.5, "portrait", "bottom", mlength);
}
}
if(hd == 3.5) {
if(orientation == "portrait") {
if(position == "vertical") {
if(side == "left") {
translate([0,41.28,0]) rotate([0,0,0]) hd35_vtab("right");
translate([0,41.28+44.45,0]) rotate([0,0,0]) hd35_vtab("right");
translate([0,41.28+76.20,0]) rotate([0,0,0]) hd35_vtab("right");
}
else { // right
translate([0,41.28,0]) rotate([0,0,0]) hd35_vtab("left");
translate([0,41.28+44.45,0]) rotate([0,0,0]) hd35_vtab("left");
translate([0,41.28+76.20,0]) rotate([0,0,0]) hd35_vtab("left");
}
}
else {
translate([-.5,28.5,0]) hd35_tab("left");
translate([-.5,69.75,0]) hd35_tab("left");
translate([-.5,130.1,0]) hd35_tab("left");
translate([101.6+.5,28.5,0]) hd35_tab("right");
translate([101.6+.5,69.75,0]) hd35_tab("right");
translate([101.6+.5,130.1,0]) hd35_tab("right");
if(enablemask == false) {
if(orientation == "landscape") {
difference() {
color("LightGrey",.6) cube([hd25_x,hd25_y,hd25_z]);
// bottom screw holes
color("Black",.6) translate([9.4,4.07,-adj]) cylinder(d=3,h=3);
color("Black",.6) translate([86,4.07,-adj]) cylinder(d=3,h=3);
color("Black",.6) translate([86,65.79,-adj]) cylinder(d=3,h=4);
color("Black",.6) translate([9.4,65.79,-adj]) cylinder(d=3,h=4);
// side screw holes
color("Black",.6) translate([9.4,-adj,3]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([86,-adj,3]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([86,hd25_y+adj,3]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([9.4,hd25_y+adj,3]) rotate([90,0,0]) cylinder(d=3,h=3);
// connector opening
color("LightSlateGray",.6) translate([hd25_x-5,11,-1]) cube([5+adj,32,5+adj]);
}
}
if(orientation == "landscape") {
if(position == "vertical") {
if(side == "left") {
translate([9.4,0,0]) rotate([0,0,90]) hd35_vtab("right");
translate([86,0,0]) rotate([0,0,90]) hd35_vtab("right");
if(orientation == "portrait") {
translate([0,hd25_x,0]) rotate([0,0,270])
difference() {
color("LightGrey",.6) cube([hd25_x,hd25_y,hd25_z]);
// bottom screw holes
color("Black",.6) translate([9.4,4.07,-adj]) cylinder(d=3,h=3);
color("Black",.6) translate([86,4.07,-adj]) cylinder(d=3,h=3);
color("Black",.6) translate([86,65.79,-adj]) cylinder(d=3,h=4);
color("Black",.6) translate([9.4,65.79,-adj]) cylinder(d=3,h=4);
// side screw holes
color("Black",.6) translate([9.4,-adj,3]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([86,-adj,3]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([86,hd25_y+adj,3]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([9.4,hd25_y+adj,3]) rotate([90,0,0]) cylinder(d=3,h=3);
// connector opening
color("LightSlateGray",.6) translate([hd25_x-5,11,-1]) cube([5+adj,32,5+adj]);
}
else { // right
translate([9.4,0,0]) rotate([0,0,90]) hd35_vtab("left");
translate([86,0,0]) rotate([0,0,90]) hd35_vtab("left");
}
}
else {
translate([16.9,-.5,0]) rotate([0,0,90]) hd35_tab("left");
translate([76.6,-.5,0]) rotate([0,0,90]) hd35_tab("left");
translate([118.5,-.5,0]) rotate([0,0,90]) hd35_tab("left");
translate([16.9,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
translate([76.6,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
translate([118.5,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
}
}
}
}
/*
NAME: hd25_tab
DESCRIPTION: creates 2.5" hard drive tabs for horizontal mounting
@@ -275,6 +264,202 @@ module hd25_vtab(side) {
}
/*
NAME: hd35
DESCRIPTION: creates 3.5" hard drive model
TODO: none
USAGE: hd35(orientation, mask)
orientation = "landscape", "portrait"
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default", "bottom", "side", "both"
*/
module hd35(orientation, mask) {
hd35_x = 147;
hd35_y = 101.6;
hd35_z = 26.1;
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(enablemask == true) {
if(orientation == "landscape" && (mstyle == "side" || mstyle == "both" || mstyle == "default")) {
translate([0, msetback, 0]) hd_holes(3.5, "landscape", "left", mlength);
translate([0, -msetback, 0]) hd_holes(3.5, "landscape", "right", mlength);
}
if(orientation == "landscape" && (mstyle == "bottom" || mstyle == "both")) {
translate([0, 0, msetback]) hd_holes(3.5, "landscape", "bottom", mlength);
}
if(orientation == "portrait" && (mstyle == "side" || mstyle == "both" || mstyle == "default")) {
translate([msetback, 0, 0]) hd_holes(3.5, "portrait", "left", mlength);
translate([-msetback, 0, 0]) hd_holes(3.5, "portrait", "right", mlength);
}
if(orientation == "portrait" && (mstyle == "bottom" || mstyle == "both")) {
translate([0, 0, -mlength+msetback]) hd_holes(3.5, "portrait", "bottom", mlength);
}
}
if(enablemask == false) {
if(orientation == "landscape") {
difference() {
color("LightGrey",.6) cube([hd35_x,hd35_y,hd35_z]);
// bottom screw holes
color("Black",.6) translate([29.52,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([61.27,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([105.72,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([29.52,98.43,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([61.27,98.43,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([105.72,98.43,-adj]) cylinder(d=3,h=3+adj);
// side screw holes
color("Black",.6) translate([16.9,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([76.6,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([118.5,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([118.5,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([76.6,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([16.9,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
// connector opening
color("LightSlateGray",.6) translate([hd35_x-5,11,-1]) cube([5+adj,32,5+adj]);
}
}
if(orientation == "portrait") {
translate([0,hd35_x,0]) rotate([0,0,270])
difference() {
color("LightGrey",.6) cube([hd35_x,hd35_y,hd35_z]);
// bottom screw holes
color("Black",.6) translate([29.52,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([61.27,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([105.72,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([29.52,98.43,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([61.27,98.43,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([105.72,98.43,-adj]) cylinder(d=3,h=3+adj);
// side screw holes
color("Black",.6) translate([16.9,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([76.6,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([118.5,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([118.5,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([76.6,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([16.9,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
// connector opening
color("LightSlateGray",.6) translate([hd35_x-5,11,-1]) cube([5+adj,32,5+adj]);
}
}
}
}
/*
NAME: hd35_25holder
DESCRIPTION: 3.5" hdd to 2.5" hdd holder
TODO: none
USAGE: hdd35_25holder(length, width=101.6)
length = length of holder min. 145mm for 3.5" drive
*/
module hd35_25holder(length, width=101.6) {
wallthick = 3;
floorthick = 2;
hd35_x = length; // 145mm for 3.5" drive
hd35_y = width;
hd35_z = 12;
hd25_x = 100;
hd25_y = 69.85;
hd25_z = 9.5;
hd25_xloc = 2; // or (hd35_x-hd25_x)/2
hd25_yloc = (hd35_y-hd25_y)/2;
hd25_zloc = 9.5;
adj = .1;
$fn=90;
difference() {
union() {
difference() {
translate([(hd35_x/2),(hd35_y/2),(hd35_z/2)])
cube_fillet_inside([hd35_x,hd35_y,hd35_z],
vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
translate([(hd35_x/2),(hd35_y/2),(hd35_z/2)+floorthick])
cube_fillet_inside([hd35_x-(wallthick*2),hd35_y-(wallthick*2),hd35_z],
vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
// end trim
translate([-adj,5,wallthick+2]) cube([wallthick+(adj*2),hd35_y-10,10]);
translate([hd35_x-wallthick-adj,5,wallthick+2]) cube([wallthick+(adj*2),hd35_y-10,10]);
// bottom vents
for ( r=[15:40:hd35_x-40]) {
for (c=[hd35_y-76:4:75]) {
translate ([r,c,-adj]) cube([35,2,wallthick+(adj*2)]);
}
}
}
// 2.5 hdd bottom support
translate([9.4+hd25_xloc,4.07+hd25_yloc,floorthick-adj]) cylinder(d=8,h=4);
translate([86+hd25_xloc,4.07+hd25_yloc,floorthick-adj]) cylinder(d=8,h=4);
translate([86+hd25_xloc,65.79+hd25_yloc,floorthick-adj]) cylinder(d=8,h=4);
translate([9.4+hd25_xloc,65.79+hd25_yloc,floorthick-adj]) cylinder(d=8,h=4);
// side nut holder support
translate([16,wallthick-adj,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
translate([76,wallthick-adj,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
if(length >= 120) {
translate([117.5,wallthick-adj,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
translate([117.5,hd35_y-wallthick+adj,7]) rotate([90,0,0]) cylinder(d=10,h=3);
}
translate([76,hd35_y-wallthick+adj,7]) rotate([90,0,0]) cylinder(d=10,h=3);
translate([16,hd35_y-wallthick+adj,7]) rotate([90,0,0]) cylinder(d=10,h=3);
// bottom-side support
translate([wallthick,wallthick,floorthick-2]) rotate([45,0,0]) cube([hd35_x-(wallthick*2),3,3]);
translate([wallthick,hd35_y-wallthick+adj,floorthick-2]) rotate([45,0,0]) cube([hd35_x-(wallthick*2),3,3]);
}
// bottom screw holes
translate([9.4+hd25_xloc,4.07+hd25_yloc,-adj]) cylinder(d=3,h=(floorthick*3)+(adj*2));
translate([86+hd25_xloc,4.07+hd25_yloc,-adj]) cylinder(d=3,h=(floorthick*3)+(adj*2));
translate([86+hd25_xloc,65.79+hd25_yloc,-adj]) cylinder(d=3,h=(floorthick*3)+(adj*2));
translate([9.4+hd25_xloc,65.79+hd25_yloc,-adj]) cylinder(d=3,h=(floorthick*3)+(adj*2));
// countersink holes
translate([9.4+hd25_xloc,4.07+hd25_yloc,-adj]) cylinder(d1=6.5, d2=3, h=3);
translate([86+hd25_xloc,4.07+hd25_yloc,-adj]) cylinder(d1=6.5, d2=3, h=3);
translate([86+hd25_xloc,65.79+hd25_yloc,-adj]) cylinder(d1=6.5, d2=3, h=3);
translate([9.4+hd25_xloc,65.79+hd25_yloc,-adj]) cylinder(d1=6.5, d2=3, h=3);
// side screw holes
translate([16,-adj,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
translate([76,-adj,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
translate([117.5,-adj,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
translate([117.5,hd35_y+adj,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
translate([76,hd35_y+adj,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
translate([16,hd35_y+adj,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
// side nut trap
translate([16,wallthick-adj,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([76,wallthick-adj,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([117.5,wallthick-adj,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([117.5,hd35_y-wallthick-adj,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([76,hd35_y-wallthick-adj,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([16,hd35_y-wallthick-adj,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
}
}
/*
NAME: hd35_tab
DESCRIPTION: creates 3.5" hard drive tabs for horizontal mounting
@@ -425,20 +610,127 @@ module hd35_vtab(side) {
/*
NAME: hd_bottom_holes
NAME: hd_holes
DESCRIPTION: creates 2.5" and 3.5" hard drive hole mask for mounting
TODO: none
USAGE: hd_bottom_holes(hd, orientation, position, side, thick)
USAGE: hd_bottom_holes(hd, orientation, side, thick)
hd = 2.5, 3.5
orientation = "portrait", "landscape"
position = "vertical", "horizontal"
side = "left", "right"
side = "left", "right", "both", "bottom", "all"
thick = floor thickness
*/
module hd_bottom_holes(hd, orientation, position, side, thick) {
module hd_holes(hd, orientation, side, thick) {
hd25_x = 100;
hd25_y = 69.85;
hd35_x = 147;
hd35_y = 101.6;
hd35_z = 26.1;
adj = .01;
$fn = 90;
if(hd == 2.5) {
if(orientation == "portrait") {
translate([0,hd25_x,0]) rotate([0,0,270]) union() {
if(side == "left" || side == "both" || side == "all") {
translate([9.4,-thick,3]) rotate([270,0,0]) cylinder(d=3.6,h=thick);
translate([86,-thick,3]) rotate([270,0,0]) cylinder(d=3.6,h=thick);
}
if(side == "right" || side == "both" || side == "all") {
translate([9.4,hd25_y+thick,3]) rotate([90,0,0]) cylinder(d=3.6,h=thick);
translate([86,hd25_y+thick,3]) rotate([90,0,0]) cylinder(d=3.6,h=thick);
}
if(side == "bottom" || side == "all") {
translate([9.4,4.07,0]) cylinder(d=3.6,h=thick);
translate([86,4.07,0]) cylinder(d=3.6,h=thick);
translate([86,65.79,0]) cylinder(d=3.6,h=thick);
translate([9.4,65.79,0]) cylinder(d=3.6,h=thick);
}
}
}
if(orientation == "landscape") {
if(side == "left" || side == "both" || side == "all") {
translate([9.4,-thick,3]) rotate([270,0,0]) cylinder(d=3.6,h=thick);
translate([86,-thick,3]) rotate([270,0,0]) cylinder(d=3.6,h=thick);
}
if(side == "right" || side == "both" || side == "all") {
translate([9.4,hd25_y+thick,3]) rotate([90,0,0]) cylinder(d=3.6,h=thick);
translate([86,hd25_y+thick,3]) rotate([90,0,0]) cylinder(d=3.6,h=thick);
}
if(side == "bottom" || side == "all") {
translate([9.4,4.07,-thick]) cylinder(d=3.6,h=thick);
translate([86,4.07,-thick]) cylinder(d=3.6,h=thick);
translate([86,65.79,-thick]) cylinder(d=3.6,h=thick);
translate([9.4,65.79,-thick]) cylinder(d=3.6,h=thick);
}
}
}
if(hd == 3.5) {
if(orientation == "portrait") {
translate([0,hd35_x,0]) rotate([0,0,270]) union() {
if(side == "left" || side == "both" || side == "all") {
translate([16.9,-thick,6.35]) rotate([270,0,0]) cylinder(d=3,h=thick);
translate([76.6,-thick,6.35]) rotate([270,0,0]) cylinder(d=3,h=thick);
translate([118.5,-thick,6.35]) rotate([270,0,0]) cylinder(d=3,h=thick);
}
if(side == "right" || side == "both" || side == "all") {
translate([118.5,hd35_y+thick,6.35]) rotate([90,0,0]) cylinder(d=3,h=thick);
translate([76.6,hd35_y+thick,6.35]) rotate([90,0,0]) cylinder(d=3,h=thick);
translate([16.9,hd35_y+thick,6.35]) rotate([90,0,0]) cylinder(d=3,h=thick);
}
if(side == "bottom" || side == "all") {
// landscape 3.5" bottom screw holes
translate([29.52,3.18,0]) cylinder(d=3.6,h=thick);
translate([61.27,3.18,0]) cylinder(d=3.6,h=thick);
translate([105.72,3.18,0]) cylinder(d=3.6,h=thick);
translate([29.52,98.43,0]) cylinder(d=3.6,h=thick);
translate([61.27,98.43,0]) cylinder(d=3.6,h=thick);
translate([105.72,98.43,0]) cylinder(d=3.6,h=thick);
}
}
}
if(orientation == "landscape") {
if(side == "left" || side == "both" || side == "all") {
translate([16.9,-thick,6.35]) rotate([270,0,0]) cylinder(d=3,h=thick);
translate([76.6,-thick,6.35]) rotate([270,0,0]) cylinder(d=3,h=thick);
translate([118.5,-thick,6.35]) rotate([270,0,0]) cylinder(d=3,h=thick);
}
if(side == "right" || side == "both" || side == "all") {
translate([118.5,hd35_y+thick,6.35]) rotate([90,0,0]) cylinder(d=3,h=thick);
translate([76.6,hd35_y+thick,6.35]) rotate([90,0,0]) cylinder(d=3,h=thick);
translate([16.9,hd35_y+thick,6.35]) rotate([90,0,0]) cylinder(d=3,h=thick);
}
if(side == "bottom" || side == "all") {
// landscape 3.5" bottom screw holes
translate([29.52,3.18,-thick]) cylinder(d=3.6,h=thick);
translate([61.27,3.18,-thick]) cylinder(d=3.6,h=thick);
translate([105.72,3.18,-thick]) cylinder(d=3.6,h=thick);
translate([29.52,98.43,-thick]) cylinder(d=3.6,h=thick);
translate([61.27,98.43,-thick]) cylinder(d=3.6,h=thick);
translate([105.72,98.43,-thick]) cylinder(d=3.6,h=thick);
}
}
}
}
/*
NAME: hd_mount
DESCRIPTION: creates 2.5" and 3.5" hard drive mounts
TODO: none
USAGE: hd_mount(hd, orientation, position, side)
hd = 2.5, 3.5
orientation = "portrait", "landscape"
position = "vertical", "horizontal"
side = "left", "right"
*/
module hd_mount(hd, orientation, position, side) {
adj = .01;
$fn = 90;
@@ -447,42 +739,37 @@ module hd_bottom_holes(hd, orientation, position, side, thick) {
if(orientation == "portrait") {
if(position == "vertical") {
if(side == "left") {
translate([-3,14,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([-3,90.6,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([0,14,0]) rotate([0,0,0]) hd25_vtab("right");
translate([0,90.6,0]) rotate([0,0,0]) hd25_vtab("right");
}
else {
// portrait 2.5" bottom screw holes
translate([3,14,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([3,90.6,0]) cylinder(d=3.6,h=thick+(adj*2));
else { // right
translate([0,14,0]) rotate([0,0,0]) hd25_vtab("left");
translate([0,90.6,0]) rotate([0,0,0]) hd25_vtab("left");
}
}
else {
// portrait 2.5" bottom screw holes
translate([4.07,14,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([4.07,90.6,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([65.79,90.6,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([65.79,14,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([-.5,14,0]) hd25_tab("left");
translate([-.5,90.6,0]) hd25_tab("left");
translate([70.35,14,0]) hd25_tab("right");
translate([70.35,90.6,0]) hd25_tab("right");
}
}
if(orientation == "landscape") {
if(position == "vertical") {
if(side == "left") {
translate([9.4,-3,0]) cylinder(d=3.6,h=thick+5);
translate([86,-3,0]) cylinder(d=3.6,h=thick+5);
translate([9.4,0,0]) rotate([0,0,90]) hd25_vtab("right");
translate([86,0,0]) rotate([0,0,90]) hd25_vtab("right");
}
else {
echo(side);
translate([9.4,3,0]) cylinder(d=3.6,h=thick+5);
translate([86,3,0]) cylinder(d=3.6,h=thick+5);
else { // right
translate([9.4,0,0]) rotate([0,0,90]) hd25_vtab("left");
translate([86,0,0]) rotate([0,0,90]) hd25_vtab("left");
}
}
else {
// landscape 2.5" bottom screw holes
translate([9.4,4.07,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([86,4.07,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([86,65.79,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([9.4,65.79,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([9.4,4.07-4.5,0]) rotate([0,0,90]) hd25_tab("left");
translate([86,4.07-4.5,0]) rotate([0,0,90]) hd25_tab("left");
translate([86,65.79+4.5,0]) rotate([0,0,90]) hd25_tab("right");
translate([9.4,65.79+4.5,0]) rotate([0,0,90]) hd25_tab("right");
}
}
}
@@ -490,217 +777,44 @@ module hd_bottom_holes(hd, orientation, position, side, thick) {
if(orientation == "portrait") {
if(position == "vertical") {
if(side == "left") {
translate([-6,28.5,0]) cylinder(d=3.6,h=thick+5);
translate([-6,70.5,0]) cylinder(d=3.6,h=thick+5);
translate([-6,28.5+101.6,0]) cylinder(d=3.6,h=thick+5);
translate([0,41.28,0]) rotate([0,0,0]) hd35_vtab("right");
translate([0,41.28+44.45,0]) rotate([0,0,0]) hd35_vtab("right");
translate([0,41.28+76.20,0]) rotate([0,0,0]) hd35_vtab("right");
}
else {
// portrait 3.5" bottom screw holes
translate([6,28.5,0]) cylinder(d=3.6,h=thick+5);
translate([6,70.5,0]) cylinder(d=3.6,h=thick+5);
translate([6,28.5+101.6,0]) cylinder(d=3.6,h=thick+5);
else { // right
translate([0,41.28,0]) rotate([0,0,0]) hd35_vtab("left");
translate([0,41.28+44.45,0]) rotate([0,0,0]) hd35_vtab("left");
translate([0,41.28+76.20,0]) rotate([0,0,0]) hd35_vtab("left");
}
}
else {
// portrait 3.5" bottom screw holes
translate([3.18,41.28,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([3.18,85.73,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([3.18,117.48,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([98.43,41.28,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([98.43,85.73,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([98.43,117.48,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([-.5,28.5,0]) hd35_tab("left");
translate([-.5,69.75,0]) hd35_tab("left");
translate([-.5,130.1,0]) hd35_tab("left");
translate([101.6+.5,28.5,0]) hd35_tab("right");
translate([101.6+.5,69.75,0]) hd35_tab("right");
translate([101.6+.5,130.1,0]) hd35_tab("right");
}
}
if(orientation == "landscape") {
// landscape 3.5" bottom screw holes
translate([29.52,3.18,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([61.27,3.18,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([105.72,3.18,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([29.52,98.43,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([61.27,98.43,0]) cylinder(d=3.6,h=thick+(adj*2));
translate([105.72,98.43,0]) cylinder(d=3.6,h=thick+(adj*2));
}
}
}
/*
NAME: hd25
DESCRIPTION: creates 2.5" hard drive model
TODO: none
USAGE: hd25(height)
height = drive height
*/
module hd25(height) {
hd25_x = 100;
hd25_y = 69.85;
hd25_z = height;
adj = .01;
$fn=90;
difference() {
color("LightGrey",.6) cube([hd25_x,hd25_y,hd25_z]);
// bottom screw holes
color("Black",.6) translate([9.4,4.07,-adj]) cylinder(d=3,h=3);
color("Black",.6) translate([86,4.07,-adj]) cylinder(d=3,h=3);
color("Black",.6) translate([86,65.79,-adj]) cylinder(d=3,h=4);
color("Black",.6) translate([9.4,65.79,-adj]) cylinder(d=3,h=4);
// side screw holes
color("Black",.6) translate([9.4,-adj,3]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([86,-adj,3]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([86,hd25_y+adj,3]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([9.4,hd25_y+adj,3]) rotate([90,0,0]) cylinder(d=3,h=3);
// connector opening
color("LightSlateGray",.6) translate([hd25_x-5,11,-1]) cube([5+adj,32,5+adj]);
}
}
/*
NAME: hd35
DESCRIPTION: creates 3.5" hard drive model
TODO: none
USAGE: hd35()
*/
module hd35() {
hd35_x = 147;
hd35_y = 101.6;
hd35_z = 26.1;
adj = .01;
$fn=90;
difference() {
color("LightGrey",.6) cube([hd35_x,hd35_y,hd35_z]);
// bottom screw holes
color("Black",.6) translate([29.52,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([61.27,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([105.72,3.18,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([29.52,98.43,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([61.27,98.43,-adj]) cylinder(d=3,h=3+adj);
color("Black",.6) translate([105.72,98.43,-adj]) cylinder(d=3,h=3+adj);
// side screw holes
color("Black",.6) translate([16.9,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([76.6,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([118.5,-adj,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([118.5,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([76.6,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
color("Black",.6) translate([16.9,hd35_y+adj,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
// connector opening
color("LightSlateGray",.6) translate([hd35_x-5,11,-1]) cube([5+adj,32,5+adj]);
}
}
/*
NAME: hd25
DESCRIPTION: 3.5" hdd to 2.5" hdd holder
TODO: none
USAGE: hdd35_25holder(length, width=101.6)
length = length of holder min. 145mm for 3.5" drive
*/
module hdd35_25holder(length, width=101.6) {
wallthick = 3;
floorthick = 2;
hd35_x = length; // 145mm for 3.5" drive
hd35_y = width;
hd35_z = 12;
hd25_x = 100;
hd25_y = 69.85;
hd25_z = 9.5;
hd25_xloc = 2; // or (hd35_x-hd25_x)/2
hd25_yloc = (hd35_y-hd25_y)/2;
hd25_zloc = 9.5;
adj = .1;
$fn=90;
difference() {
union() {
difference() {
translate([(hd35_x/2),(hd35_y/2),(hd35_z/2)])
cube_fillet_inside([hd35_x,hd35_y,hd35_z],
vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
translate([(hd35_x/2),(hd35_y/2),(hd35_z/2)+floorthick])
cube_fillet_inside([hd35_x-(wallthick*2),hd35_y-(wallthick*2),hd35_z],
vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
// end trim
translate([-adj,5,wallthick+2]) cube([wallthick+(adj*2),hd35_y-10,10]);
translate([hd35_x-wallthick-adj,5,wallthick+2]) cube([wallthick+(adj*2),hd35_y-10,10]);
// bottom vents
for ( r=[15:40:hd35_x-40]) {
for (c=[hd35_y-76:4:75]) {
translate ([r,c,-adj]) cube([35,2,wallthick+(adj*2)]);
}
if(position == "vertical") {
if(side == "left") {
translate([9.4,0,0]) rotate([0,0,90]) hd35_vtab("right");
translate([86,0,0]) rotate([0,0,90]) hd35_vtab("right");
}
else { // right
translate([9.4,0,0]) rotate([0,0,90]) hd35_vtab("left");
translate([86,0,0]) rotate([0,0,90]) hd35_vtab("left");
}
}
// 2.5 hdd bottom support
translate([9.4+hd25_xloc,4.07+hd25_yloc,floorthick-adj]) cylinder(d=8,h=4);
translate([86+hd25_xloc,4.07+hd25_yloc,floorthick-adj]) cylinder(d=8,h=4);
translate([86+hd25_xloc,65.79+hd25_yloc,floorthick-adj]) cylinder(d=8,h=4);
translate([9.4+hd25_xloc,65.79+hd25_yloc,floorthick-adj]) cylinder(d=8,h=4);
// side nut holder support
translate([16,wallthick-adj,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
translate([76,wallthick-adj,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
if(length >= 120) {
translate([117.5,wallthick-adj,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
translate([117.5,hd35_y-wallthick+adj,7]) rotate([90,0,0]) cylinder(d=10,h=3);
else {
translate([16.9,-.5,0]) rotate([0,0,90]) hd35_tab("left");
translate([76.6,-.5,0]) rotate([0,0,90]) hd35_tab("left");
translate([118.5,-.5,0]) rotate([0,0,90]) hd35_tab("left");
translate([16.9,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
translate([76.6,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
translate([118.5,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
}
translate([76,hd35_y-wallthick+adj,7]) rotate([90,0,0]) cylinder(d=10,h=3);
translate([16,hd35_y-wallthick+adj,7]) rotate([90,0,0]) cylinder(d=10,h=3);
// bottom-side support
translate([wallthick,wallthick,floorthick-2]) rotate([45,0,0]) cube([hd35_x-(wallthick*2),3,3]);
translate([wallthick,hd35_y-wallthick+adj,floorthick-2]) rotate([45,0,0]) cube([hd35_x-(wallthick*2),3,3]);
}
// bottom screw holes
translate([9.4+hd25_xloc,4.07+hd25_yloc,-adj]) cylinder(d=3,h=(floorthick*3)+(adj*2));
translate([86+hd25_xloc,4.07+hd25_yloc,-adj]) cylinder(d=3,h=(floorthick*3)+(adj*2));
translate([86+hd25_xloc,65.79+hd25_yloc,-adj]) cylinder(d=3,h=(floorthick*3)+(adj*2));
translate([9.4+hd25_xloc,65.79+hd25_yloc,-adj]) cylinder(d=3,h=(floorthick*3)+(adj*2));
// countersink holes
translate([9.4+hd25_xloc,4.07+hd25_yloc,-adj]) cylinder(d1=6.5, d2=3, h=3);
translate([86+hd25_xloc,4.07+hd25_yloc,-adj]) cylinder(d1=6.5, d2=3, h=3);
translate([86+hd25_xloc,65.79+hd25_yloc,-adj]) cylinder(d1=6.5, d2=3, h=3);
translate([9.4+hd25_xloc,65.79+hd25_yloc,-adj]) cylinder(d1=6.5, d2=3, h=3);
// side screw holes
translate([16,-adj,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
translate([76,-adj,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
translate([117.5,-adj,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
translate([117.5,hd35_y+adj,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
translate([76,hd35_y+adj,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
translate([16,hd35_y+adj,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
// side nut trap
translate([16,wallthick-adj,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([76,wallthick-adj,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([117.5,wallthick-adj,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([117.5,hd35_y-wallthick-adj,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([76,hd35_y-wallthick-adj,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
translate([16,hd35_y-wallthick-adj,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
}
}
}

View File

@@ -15,12 +15,143 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
pcb_holder(size, wallthick)
nut_holder(nut, style, dia_x, dia_y, height)
pcb_holder(size, wallthick)
vu_holder(vu_model, side, vesa, cheight)
*/
/*
NAME: nut_holder
DESCRIPTION: creates various nut holders
TODO: none
USAGE: nut_holder(nut, style, dia_x, dia_y, height, mask)
nut = "m2", "m2.5", "m3", "m4"
style = "default", "sloped", "trap"
dia_x = top diameter or x size in mm
dia_y = bottom diameter or y size in mm
height = holder height in mm
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module nut_holder(nut, style, dia_x, dia_y, height, mask) {
nuts = [[2,4,1.6], // m2 size, diameter, height
[2.5,5,2], // m2.5 size, diameter, height
[3,5.5,2.4], // m3 size, diameter, height
[4,7,3.2]]; // m4 size, diameter, height
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(enablemask == true && mstyle == "default") {
if(nut == "m2") {
translate([0, 0, -mlength+msetback]) cylinder(d = nuts[0][0], h = mlength);
}
if(nut == "m2.5") {
translate([0, 0, -mlength+msetback]) cylinder(d = nuts[1][0], h = mlength);
}
if(nut == "m3") {
translate([0, 0, -mlength+msetback]) cylinder(d = nuts[2][0], h = mlength);
}
if(nut == "m4") {
translate([0, 0, -mlength+msetback]) cylinder(d = nuts[3][0], h = mlength);
}
}
if(enablemask == false) {
if( style == "default") {
difference() {
cylinder(d=dia_x, h=height);
if(nut == "m2") {
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[0][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m2.5") {
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.25, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[1][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m3") {
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[2][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m4") {
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[3][1]*2/sqrt(3), h=height, $fn=6);
}
}
}
if( style == "sloped") {
difference() {
cylinder(d2=dia_x, d1=dia_y, h=height);
if(nut == "m2") {
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[0][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m2.5") {
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.25, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[1][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m3") {
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[2][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m4") {
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[3][1]*2/sqrt(3), h=height, $fn=6);
}
}
}
if( style == "trap") {
if(nut == "m2") {
difference() {
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[0][1]*2/sqrt(3), h=nuts[0][2], $fn=6);
translate([-nuts[0][1]/2, 0, 2]) cube([nuts[0][1], dia_x, nuts[0][2]]);
}
}
if(nut == "m2.5") {
difference() {
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.325, h=height+2);
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[1][1]*2/sqrt(3), h=nuts[1][2], $fn=6);
translate([-nuts[1][1]/2, 0, 2]) cube([nuts[1][1], dia_x, nuts[1][2]]);
}
}
if(nut == "m3") {
difference() {
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[2][1]*2/sqrt(3), h=nuts[2][2], $fn=6);
translate([-nuts[2][1]/2, 0, 2]) cube([nuts[2][1], dia_x, nuts[2][2]]);
}
}
if(nut == "m4") {
difference() {
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[3][1]*2/sqrt(3), h=nuts[3][2], $fn=6);
translate([-nuts[3][1]/2, 0, 2]) cube([nuts[3][1], dia_x, nuts[3][2]]);
}
}
}
}
}
/*
NAME: pcb_holder
DESCRIPTION: pcb bottom edge holder
@@ -60,108 +191,6 @@ module pcb_holder(size, wallthick) {
}
/*
NAME: nut_holder
DESCRIPTION: creates various nut holders
TODO: none
USAGE: nut_holder(nut, style, dia_x, dia_y, height)
nut = "m2", "m2.5", "m3", "m4"
style = "default", "sloped", "trap"
dia_x = top diameter or x size in mm
dia_y = bottom diameter or y size in mm
height = holder height in mm
*/
module nut_holder(nut, style, dia_x, dia_y, height) {
nuts = [[2,4,1.6], // m2 size, diameter, height
[2.5,5,2], // m2.5 size, diameter, height
[3,5.5,2.4], // m3 size, diameter, height
[4,7,3.2]]; // m4 size, diameter, height
$fn = 180;
if( style == "default") {
difference() {
cylinder(d=dia_x, h=height);
if(nut == "m2") {
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[0][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m2.5") {
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.25, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[1][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m3") {
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[2][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m4") {
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[3][1]*2/sqrt(3), h=height, $fn=6);
}
}
}
if( style == "sloped") {
difference() {
cylinder(d2=dia_x, d1=dia_y, h=height);
if(nut == "m2") {
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[0][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m2.5") {
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.25, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[1][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m3") {
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[2][1]*2/sqrt(3), h=height, $fn=6);
}
if(nut == "m4") {
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
translate([0, 0, 2]) cylinder(d=nuts[3][1]*2/sqrt(3), h=height, $fn=6);
}
}
}
if( style == "trap") {
if(nut == "m2") {
difference() {
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[0][1]*2/sqrt(3), h=nuts[0][2], $fn=6);
translate([-nuts[0][1]/2, 0, 2]) cube([nuts[0][1], dia_x, nuts[0][2]]);
}
}
if(nut == "m2.5") {
difference() {
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.325, h=height+2);
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[1][1]*2/sqrt(3), h=nuts[1][2], $fn=6);
translate([-nuts[1][1]/2, 0, 2]) cube([nuts[1][1], dia_x, nuts[1][2]]);
}
}
if(nut == "m3") {
difference() {
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[2][1]*2/sqrt(3), h=nuts[2][2], $fn=6);
translate([-nuts[2][1]/2, 0, 2]) cube([nuts[2][1], dia_x, nuts[2][2]]);
}
}
if(nut == "m4") {
difference() {
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[3][1]*2/sqrt(3), h=nuts[3][2], $fn=6);
translate([-nuts[3][1]/2, 0, 2]) cube([nuts[3][1], dia_x, nuts[3][2]]);
}
}
}
}
/*
NAME: vu_holder
DESCRIPTION: hk vu5,vu5a,vu7,vu7a display holder
@@ -191,6 +220,7 @@ vu7_pcb_width = 172.90;
vu7_pcb_height = 124.27;
vu7_width = vu7_pcb_width + vu7_case_x_offset;
vu7_height = vu7_pcb_height + 9.75;
vu_rotation = [15,0,0];
difference() {
union() {
@@ -198,23 +228,23 @@ vu7_height = vu7_pcb_height + 9.75;
translate([width-wallthick-gap,-(2*wallthick)-gap,0])
cube([sidethick,depth+2*wallthick,cheight]);
// right tabs for vu5 attachment
if(case_style == "vu5") {
if(vu_model == "vu5") {
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-39,
case_z+80]) rotate([90-vu_rotation[0],180,0])
slab_r([((width-vesa)/2)+4.5,10,sidethick], [.1,.1,3,3]);
case_z+80]) rotate([75,180,0])
slab_r([((width-vesa)/2)+4.5,10,sidethick], [.01,.01,3,3]);
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-26,
case_z+31.5]) rotate([90-vu_rotation[0],180,0])
slab_r([((width-vesa)/2)+4.5,10,sidethick], [.1,.1,3,3]);
case_z+31.5]) rotate([75,180,0])
slab_r([((width-vesa)/2)+4.5,10,sidethick], [.01,.01,3,3]);
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-41.85-adj,
case_z+79.25]) rotate([90-vu_rotation[0],180,0])
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick-1.5,depth-40.85-adj,
case_z+79.5]) rotate([75,180,0])
difference() {
cube([sidethick,10,sidethick]);
translate([0,-adj,sidethick]) rotate([0,45,0])
cube([2*sidethick,10+(2*adj),sidethick]);
}
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-28.85-adj,
case_z+30.75]) rotate([90-vu_rotation[0],180,0])
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick-1.5,depth-27.85-adj,
case_z+31]) rotate([75,180,0])
difference() {
cube([sidethick,10,sidethick]);
translate([0,-adj,sidethick]) rotate([0,45,0])
@@ -222,23 +252,23 @@ vu7_height = vu7_pcb_height + 9.75;
}
}
// right tabs for vu7 attachment
if(case_style == "vu7") {
if(vu_model == "vu7") {
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick-1,depth-49.40,
case_z+vu7_height-15]) rotate([90-vu_rotation[0],180,0])
slab_r([((width-vesa)/2)+12,10,sidethick], [.1,.1,3,3]);
case_z+vu7_height-15]) rotate([75,180,0])
slab_r([((width-vesa)/2)+12,10,sidethick], [.01,.01,3,3]);
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick-1,depth-23.60,
case_z+22.5]) rotate([90-vu_rotation[0],180,0])
slab_r([((width-vesa)/2)+12,10,sidethick], [.1,.1,3,3]);
case_z+22.5]) rotate([75,180,0])
slab_r([((width-vesa)/2)+12,10,sidethick], [.01,.01,3,3]);
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-52.25,
case_z+vu7_height-15.75]) rotate([90-vu_rotation[0],180,0])
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick-1.5,depth-51.25,
case_z+vu7_height-15.5]) rotate([75,180,0])
difference() {
cube([sidethick,10,sidethick]);
translate([0,-adj,sidethick]) rotate([0,45,0])
cube([2*sidethick,10+(2*adj),sidethick]);
}
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-26.5,
case_z+21.8]) rotate([90-vu_rotation[0],180,0])
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick-1.5,depth-25.5,
case_z+21.8]) rotate([75,180,0])
difference() {
cube([sidethick,10,sidethick]);
translate([0,-adj,sidethick]) rotate([0,45,0])
@@ -253,22 +283,22 @@ vu7_height = vu7_pcb_height + 9.75;
translate([-wallthick-gap-sidethick,-(2*wallthick)-gap,0])
cube([sidethick,depth+2*wallthick,cheight]);
// left tabs for vu5 attachment
if(case_style == "vu5") {
if(vu_model == "vu5") {
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-36.4,
case_z+70]) rotate([90+vu_rotation[0],0,0])
slab_r([((width-vesa)/2)+4,10, sidethick], [.1,.1,3,3]);
case_z+70]) rotate([105,0,0])
slab_r([((width-vesa)/2)+4,10, sidethick], [.01,.01,3,3]);
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-23.5,
case_z+22]) rotate([90+vu_rotation[0],0,0])
slab_r([((width-vesa)/2)+4,10,sidethick], [.1,.1,3,3]);
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-39.35+adj,
case_z+69.25]) rotate([90+vu_rotation[0],0,0])
case_z+22]) rotate([105,0,0])
slab_r([((width-vesa)/2)+4,10,sidethick], [.01,.01,3,3]);
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-38.35+adj,
case_z+69.5]) rotate([105,0,0])
difference() {
cube([sidethick,10,sidethick]);
translate([0,-adj,sidethick]) rotate([0,45,0])
cube([2*sidethick,10+(2*adj),2*sidethick]);
}
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-26.4+adj,
case_z+21.25]) rotate([90+vu_rotation[0],0,0])
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-25.4+adj,
case_z+21.5]) rotate([105,0,0])
difference() {
cube([sidethick,10,sidethick]);
translate([0,-adj,sidethick]) rotate([0,45,0])
@@ -276,22 +306,22 @@ vu7_height = vu7_pcb_height + 9.75;
}
}
// left tabs for vu7 attachment
if(case_style == "vu7") {
if(vu_model == "vu7") {
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-4.25-adj,depth-46.85,
case_z+vu7_height-24.5]) rotate([90+vu_rotation[0],0,0])
slab_r([((width-vesa)/2),10, sidethick], [.1,.1,3,3]);
case_z+vu7_height-24.5]) rotate([105,0,0])
slab_r([((width-vesa)/2),10, sidethick], [.01,.01,3,3]);
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-4.25-adj,depth-21,
case_z+13]) rotate([90+vu_rotation[0],0,0])
slab_r([((width-vesa)/2),10,sidethick], [.1,.1,3,3]);
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-4-adj,depth-49.75+adj,
case_z+vu7_height-25.25]) rotate([90+vu_rotation[0],0,0])
case_z+13]) rotate([105,0,0])
slab_r([((width-vesa)/2),10,sidethick], [.01,.01,3,3]);
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-48.75+adj,
case_z+vu7_height-25]) rotate([105,0,0])
difference() {
cube([sidethick,10,sidethick]);
translate([0,-adj,sidethick]) rotate([0,45,0])
cube([2*sidethick,10+(2*adj),2*sidethick]);
}
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-4-adj,depth-23.75+adj,
case_z+12.25]) rotate([90+vu_rotation[0],0,0])
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-22.65+adj,
case_z+12.5]) rotate([105,0,0])
difference() {
cube([sidethick,10,sidethick]);
translate([0,-adj,sidethick]) rotate([0,45,0])
@@ -306,7 +336,7 @@ vu7_height = vu7_pcb_height + 9.75;
if(side == "right") {
// vu5 shape and back cut
if(case_style == "vu5") {
if(vu_model == "vu5") {
translate([width+adj,-.6,case_z+sidethick+2.5])
rotate([0,-90,0])
linear_extrude(height = 3*sidethick)
@@ -321,12 +351,12 @@ vu7_height = vu7_pcb_height + 9.75;
top=[0,0,0,0],bottom=[3,3,3,3], $fn=90);
// tab holes
translate([width/2+(vesa/2)-3,depth-37,
case_z+75]) rotate([90-vu_rotation[0],180,0]) cylinder(d=3, h=sidethick+1);
case_z+75]) rotate([75,180,0]) cylinder(d=3, h=sidethick+1);
translate([width/2+(vesa/2)-3,depth-24,
case_z+26.75]) rotate([90-vu_rotation[0],180,0]) cylinder(d=3, h=sidethick+1);
case_z+26.75]) rotate([75,180,0]) cylinder(d=3, h=sidethick+1);
}
// vu7 shape and back cut
if(case_style == "vu7") {
if(vu_model == "vu7") {
translate([width+adj,-.6,case_z+sidethick+2.5])
rotate([0,-90,0])
linear_extrude(height = 2*sidethick)
@@ -341,9 +371,9 @@ vu7_height = vu7_pcb_height + 9.75;
top=[0,0,0,0],bottom=[3,3,3,3], $fn=90);
// tab holes
translate([width/2+(vesa/2)-10,depth-47,case_z+vu7_height-19.75])
rotate([90-vu_rotation[0],180,0]) cylinder(d=3, h=sidethick+4);
rotate([75,180,0]) cylinder(d=3, h=sidethick+4);
translate([width/2+(vesa/2)-10,depth-21.25,case_z+18])
rotate([90-vu_rotation[0],180,0]) cylinder(d=3, h=sidethick+4);
rotate([75,180,0]) cylinder(d=3, h=sidethick+4);
}
// bottom attachment holes
translate([width-wallthick-gap-adj-5,wallthick+gap+10,
@@ -354,7 +384,7 @@ vu7_height = vu7_pcb_height + 9.75;
if(side == "left") {
// vu5 shape and back cut
if(case_style == "vu5") {
if(vu_model == "vu5") {
translate([-sidethick+adj,-.6,case_z+sidethick+2.5])
rotate([0,-90,0])
linear_extrude(height = 3*sidethick)
@@ -369,12 +399,12 @@ vu7_height = vu7_pcb_height + 9.75;
top=[0,0,0,0],bottom=[3,3,3,3], $fn=90);
// tab holes
translate([width/2-(vesa/2)-3,depth-36.75,case_z+75])
rotate([90+vu_rotation[0],0,0]) cylinder(d=3, h=sidethick+1);
rotate([105,0,0]) cylinder(d=3, h=sidethick+1);
translate([width/2-(vesa/2)-3,depth-24.25,case_z+26.75])
rotate([90+vu_rotation[0],0,0]) cylinder(d=3, h=sidethick+1);
rotate([75,0,0]) cylinder(d=3, h=sidethick+1);
}
// vu7 shape and back cut
if(case_style == "vu7") {
if(vu_model == "vu7") {
translate([-sidethick+adj,-.6,case_z+sidethick+2.5])
rotate([0,-90,0])
linear_extrude(height = 2*sidethick)
@@ -389,9 +419,9 @@ vu7_height = vu7_pcb_height + 9.75;
top=[0,0,0,0],bottom=[3,3,3,3], $fn=90);
// tab holes
translate([width/2-(vesa/2)-10,depth-48,case_z+vu7_height-19.75])
rotate([90+vu_rotation[0],0,0]) cylinder(d=3, h=sidethick+4);
rotate([105,0,0]) cylinder(d=3, h=sidethick+4);
translate([width/2-(vesa/2)-10,depth-22.25,case_z+18])
rotate([90+vu_rotation[0],0,0]) cylinder(d=3, h=sidethick+4);
rotate([105,0,0]) cylinder(d=3, h=sidethick+4);
}
// bottom attachment holes
translate([-sidethick-adj-6,wallthick+gap+10,((bottom_height+floorthick)/2)-1])

View File

@@ -15,25 +15,35 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
*/
/*
NAME: keyhole
DESCRIPTION: enclosed keyhole
TODO: none
USAGE: keyhole(keysize, mask = false)
USAGE: keyhole(keysize, mask)
keysize[0] = size_x
keysize[1] = size_y
keysize[2] = size_z
mask = true, false enable mask
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module keyhole(keysize, mask = false) {
module keyhole(keysize, mask) {
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
adj=.01;
$fn = 90;
if(mask == true) {
if(enablemask == true && mstyle == "default") {
union() {
translate([0, 0, -adj]) cylinder(h=keysize[3]+2*adj, d=keysize[0]);
translate([-keysize[1]/2, 0, -adj]) cube([keysize[1], keysize[2]+keysize[0]/2, keysize[3]+2*adj]);
@@ -71,4 +81,4 @@ module keyhole(keysize, mask = false) {
}
}
}
}
}

86
lib/oem_adafruit.scad Normal file
View File

@@ -0,0 +1,86 @@
/*
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
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
adafruit_lcd(mask)
*/
/*
NAME: adafruit_lcd
DESCRIPTION: adafruit 4311 2in TFT IPS Display model
TODO: none
USAGE: adafruit_lcd(mask[])
mask[0] = true enables mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module adafruit_lcd(mask) {
size_x = 35.5;
size_y = 59;
size_z = 1.6;
size_xm = size_x+1;
size_ym = size_y+1;
lcd_size = [34.75,48,2];
corner_radius = 2;
hole_size = 2.5;
enablemask = mask[0];
mlen = mask[1];
back = mask[2];
mstyle = mask[3];
adj = .01;
$fn = 90;
if(enablemask == true && mstyle == "default") {
translate([2.25, 11, size_z+2.5-back]) cube([lcd_size[0]-4, lcd_size[1]-7, mlen]);
storage("microsdcard", 11, 44, 0, "bottom", 180, [size_x, size_z, size_y], [0], size_z, enablemask, [true, 20, 0, "default"]);
fpc("fh19", .5, 22, 0, "bottom", 270, [18,0,0], ["smt","side","white","black"], size_z, enablemask, [true,10,2,"default"]);
}
if(enablemask == false) {
difference() {
union() {
color("#252525") slab([size_x, size_y, size_z], corner_radius);
color("black",1) translate([0.375, 5.75, size_z-adj]) cube([lcd_size[0], lcd_size[1], 2.5]);
color("#353535",1) translate([.375, 9.25, size_z+2.5-adj]) cube([lcd_size[0], lcd_size[1]-4, .1]);
color("dimgrey",1) translate([2.25, 11, size_z+2.5-adj]) cube([lcd_size[0]-4, lcd_size[1]-7, .2]);
}
color("#252525") translate([hole_size, size_y-hole_size, -adj]) cylinder(d=hole_size,h=6);
color("#252525") translate([size_x-hole_size, size_y-hole_size, -adj]) cylinder(d=hole_size, h=4);
for(i=[5:2.54:31]) {
color("#fee5a6",1) translate([i, 2.5, -adj]) cylinder(d=.8, h=6);
}
}
storage("microsdcard", 11, 44, 0, "bottom", 180, [size_x, size_z, size_y], [0], size_z, enablemask, [true, 20, 0, "default"]);
ic("generic", 13.25, 9, 0, "bottom", 0, [4, 10, 1.75], ["dimgrey"], size_z, enablemask, [false, 20, 0, "default"]);
fpc("fh19", .5, 22, 0, "bottom", 270, [18,0,0], ["smt","side","white","black"], size_z, enablemask, [true,10,2,"default"]);
for(i=[5:2.54:31]) {
pcbpad("round", i, 2.5, 0, "top", 0, [1, 1, 0], [.8, "#fee5a6", 1.2], size_z, enablemask, [false, 20, 0, "default"]);
}
pcbpad("round", hole_size, size_y-hole_size, 0, "top", 0, [1, 1, 0],
[hole_size, "#fee5a6", hole_size+1], size_z, enablemask, [false, 20, 0, "default"]);
pcbpad("round", size_x-hole_size, size_y-hole_size, 0, "top", 0, [1, 1, 0],
[hole_size, "#fee5a6", hole_size+1], size_z, enablemask, [false, 20, 0, "default"]);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,52 +0,0 @@
/*
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
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: pcb_pad
DESCRIPTION: single row pcb pad
TODO: none
USAGE: pcb_pad(pads = 1, style = "round")
pads = # pads
style = "round", "square"
*/
module pcb_pad(pads = 1, style = "round") {
adj = .01;
$fn = 90;
pad_size = 1.25;
size_y = 2.54;
size_x = 2.54 * (pads-1);
union() {
for (i=[0:2.54:size_x]) {
if(style == "round") {
difference() {
color("#fee5a6") translate ([i,0,0]) cylinder(d=pad_size, h=.125);
color("dimgray") translate([i,0,-adj]) cylinder(d=.625, h=.125+2*adj);
}
}
if(style == "square") {
difference() {
color("#fee5a6") translate ([i-pad_size/2,-pad_size/2,0]) cube([pad_size, pad_size, .125]);
color("dimgray") translate([i,0,-adj]) cylinder(d=.625, h=.125+2*adj);
}
}
}
}
}

View File

@@ -1,242 +0,0 @@
/*
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
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
slab(size, radius)
slab_r(size, radius)
slot(hole,length,depth)
knockout(width,depth,gap,thick,fillet,shape)
hdmi_open(hdmi_style)
microusb_open()
*/
/*
NAME: slab
DESCRIPTION: create rectangle with uniform fillet corners
TODO: none
USAGE: slab(size, radius)
size = [x, y, z]
radius = corner fillet size
*/
module slab(size, radius) {
x = size[0];
y = size[1];
z = size[2];
linear_extrude(height=z)
hull() {
translate([0+radius ,0+radius, 0]) circle(r=radius);
translate([0+radius, y-radius, 0]) circle(r=radius);
translate([x-radius, y-radius, 0]) circle(r=radius);
translate([x-radius, 0+radius, 0]) circle(r=radius);
}
}
/*
NAME: slab_r
DESCRIPTION: create rectangle with multi-radius fillet corners
TODO: none
USAGE: slab_r(size, radius)
size = [x, y, z]
radius = [radius1, radius2, radius3, radius4]
*/
module slab_r(size, radius) {
x = size[0];
y = size[1];
z = size[2];
r0 = radius[0];
r1 = radius[1];
r2 = radius[2];
r3 = radius[3];
linear_extrude(height=z)
hull() {
translate([0+radius[0] ,0+radius[0], 0]) circle(r=radius[0]);
translate([0+radius[1], y-radius[1], 0]) circle(r=radius[1]);
translate([x-radius[2], y-radius[2], 0]) circle(r=radius[2]);
translate([x-radius[3], 0+radius[3], 0]) circle(r=radius[3]);
}
}
/*
NAME: slot
DESCRIPTION: create slot shape
TODO: none
USAGE: slot(hole, length, depth)
hole = diameter of slot
length = length of slot
depth = thickness of slot
*/
module slot(hole, length, depth) {
hull() {
translate([0,0,0]) cylinder(d=hole,h=depth);
translate([length,0,0]) cylinder(d=hole,h=depth);
}
}
/*
NAME: knockout
DESCRIPTION: create knockout shapes
TODO: none
USAGE: knockout(width, depth, gap, thick, fillet, shape)
width = length
depth = width
gap = space between
thick = thickness
fillet = corner fillet
shape = "slot", "rectangle", "round"
*/
module knockout(width, depth, gap, thick, fillet, shape) {
adj = .01;
$fn=90;
// slot knockout
if(shape == "slot") {
difference() {
slot(depth, width, thick);
translate([gap/2, 0, -adj]) slot(depth-gap, width-gap, thick+(2*adj));
// cross ties
translate([(depth/2), -(depth/2)-1, -adj]) cube([2, depth+2, thick+(2*adj)]);
translate([(width/2)-1-(width/4)+4, -(depth/2)-1, -adj]) cube([2,depth+2, thick+(2*adj)]);
translate([(width/2)-1+(width/4)-4, -(depth/2)-1, -adj]) cube([2, depth+2, thick+(2*adj)]);
translate([width-(depth/2)-2, -(depth/2)-1, -adj]) cube([2, depth+2, thick+(2*adj)]);
}
}
if(shape == "rectangle") {
difference() {
translate([(width/2), (depth/2), thick/2])
cube_fillet_inside([width, depth, thick],
vertical=[fillet, fillet, fillet, fillet],
top=[0, 0, 0, 0], bottom=[0, 0, 0, 0], $fn=90);
translate([(width/2), (depth/2), (thick/2)-adj])
cube_fillet_inside([width-gap, depth-gap, thick+(3*adj)],
vertical=[fillet, fillet, fillet, fillet],
top=[0, 0, 0, 0], bottom=[0, 0, 0, 0], $fn=90);
// cross ties
translate([-1, (depth/2)-1, -adj]) cube([gap+2, 2, thick+(2*adj)]);
translate([width-4, depth-gap-1, -adj]) cube([2, gap+2, thick+(2*adj)]);
translate([2, depth-gap-1, -adj]) cube([2, gap+2, thick+(2*adj)]);
translate([width-gap-1, (depth/2)-1, -adj]) cube([gap+2, 2, thick+(2*adj)]);
translate([width-4, -1, -adj]) cube([2, gap+2, thick+(2*adj)]);
translate([2, -1, -adj]) cube([2, gap+2, thick+(2*adj)]);
}
}
if(shape == "round") {
difference() {
translate([(width/2),(width/2),0])
cylinder(d=width, h=thick);
translate([(width/2), (width/2), -adj])
cylinder(d=width-gap, h=thick+2*adj);
// cross ties
translate([-1, (depth/2)-1, -adj]) cube([gap+2, 2, thick+(2*adj)]);
translate([(width/2)-1, depth-gap-1, -adj]) cube([2, gap+2, thick+(2*adj)]);
translate([width-gap-1, (depth/2)-1, -adj]) cube([gap+2, 2, thick+(2*adj)]);
translate([(width/2)-1, -1, -adj]) cube([2, gap+2, thick+(2*adj)]);
}
}
}
/*
NAME: hdmi_open
DESCRIPTION: create hdmi mask opening
TODO: none
USAGE: hdmi_open(hdmi_style)
hdmi_style = "hdmi_a", "hdmi_micro", "hdmi_mini", "dp_mini"
*/
module hdmi_open(hdmi_style) {
if(hdmi_style == "hdmi_a") {
union() {
difference() {
translate([0,-5,1.25]) cube([15.5,8,5.75]);
translate([0.5,-5.2,.5]) rotate ([-90,0,0]) cylinder(d=3, h=13.5,$fn=30);
translate([15,-5.2,.5]) rotate ([-90,0,0]) cylinder(d=3, h=13.5,$fn=30);
}
translate([1.75,-5,.5]) cube([12, 8, 1]);
}
}
if(hdmi_style == "hdmi_micro") {
union() {
difference() {
translate([-.25,-6,-.01]) cube([7,8,3.15]);
translate([-.25,-6.2,0]) rotate ([-90,0,0]) cylinder(d=1.5, h=9.5,$fn=30);
translate([6.75,-6.2,0]) rotate ([-90,0,0]) cylinder(d=1.5, h=9.5,$fn=30);
}
}
}
if(hdmi_style == "hdmi_mini") {
union() {
difference() {
translate([-.25,-6,-.01]) cube([11.5,8,3.5]);
translate([-1,-6.2,-.5]) rotate ([-90,0,0]) cylinder(d=3, h=10,$fn=30);
translate([12.25,-6.2,-.5]) rotate ([-90,0,0]) cylinder(d=3, h=10,$fn=30);
}
}
}
if(hdmi_style=="dp_mini") {
size_x = 9;
size_y = 8;
union() {
difference() {
translate([-.25,-6,0]) cube([size_x, size_y, 5.75]);
translate([-7.5,-7,1]) rotate([0,45,0]) cube([size_x, size_y+2, 5.6]);
translate([10,-7,-5]) rotate([0,-45,0]) cube([size_x, size_y+2, 5.6]);
}
}
}
}
/*
NAME: microusb_open
DESCRIPTION: create micro-usb mask opening
TODO: none
USAGE: microusb_open()
*/
module microusb_open() {
translate([0,0,.5])rotate([90,0,0])
hull() {
translate([6,1.5,-5]) cylinder(d=3.5,h=12);
translate([1,1.5,-5]) cylinder(d=3.5,h=12);
}
}

View File

@@ -15,109 +15,176 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
*/
/*
NAME: standoff
DESCRIPTION: create standoffs
TODO: none
USAGE: standoff(stand_off)
USAGE: standoff(stand_off, mask)
stand_off[size, diameter, height, holesize, supportsize, supportheight, sink, pillarstyle,
pillarsupport, reverse, insert_e, i_dia, i_depth], mask)
size = "m2_tap","m2","m2+","m2.5_tap","m2.5","m2.5+","m3_tap","m3","m3+","m4_tap","m4","m4+","custom"
diameter = pillar diameter
height = total height
holesize = hole diameter
supportsize = support size for sink
supportheight = height of support for sink
sink = none, countersunk, recessed, nut holder, blind
pillarstyle = hex, round
pillarsupport = none, left, rear, front, right
reverse = true or false
insert_e = true or false
i_dia = insert diameter
i_depth = insert hole depth
mask[0] = enablemask
mask[1] = mlength
mask[2] = msetback
mask[3] = mstyle
stand_off[radius,
height,
holesize,
supportsize,
supportheight,
sink,
0 = none
1 = countersink
2 = recessed hole
3 = nut holder
4 = blind hole
style,
0 = hex shape
1 = cylinder
reverse,
insert_e,
i_dia,
i_depth]
*/
module standoff(stand_off){
module standoff(stand_off, mask){
radius = stand_off[0];
height = stand_off[1];
holesize = stand_off[2];
supportsize = stand_off[3];
supportheight = stand_off[4];
sink = stand_off[5];
style = stand_off[6];
reverse = stand_off[7];
insert_e = stand_off[8];
i_dia = stand_off[9];
i_depth = stand_off[10];
size = stand_off[0];
diameter = size == "m2_tap" || size == "m2" || size == "m2+" ? 4 :
size == "m2.5_tap" || size == "m2.5" || size == "m2.5+" ? 4 :
size == "m3_tap" || size == "m3" || size == "m3+" ? 5 :
size == "m4_tap" || size == "m4" || size == "m4+" ? 6 : stand_off[1];
height = stand_off[2];
holesize = size == "m2_tap" ? 1.6 : size == "m2" ? 2 : size == "m2+" ? 2.26 :
size == "m2.5_tap" ? 2.05 : size == "m2.5" ? 2.5 : size == "m2.5+" ? 2.83 :
size == "m3_tap" ? 2.5 : size == "m3" ? 3 : size == "m3+" ? 3.4 :
size == "m4_tap" ? 3.3 : size == "m4" ? 4 : size == "m4+" ? 4.4 : stand_off[3];
supportsize = stand_off[4];
supportheight = stand_off[5];
sink = stand_off[6];
pillarstyle = stand_off[7];
pillarsupport = stand_off[8];
reverse = stand_off[9];
insert_e = stand_off[10];
i_dia = stand_off[11];
i_depth = stand_off[12];
enablemask = mask[0];
mlength = mask[1];
msetback = mask[2];
mstyle = mask[3];
ps = size == "m2_tap" || size == "m2" || size == "m2+" ? 4 :
size == "m2.5_tap" || size == "m2.5" || size == "m2.5+" ? 5 :
size == "m3_tap" || size == "m3" || size == "m3+" ? 6.72 :
size == "m4_tap" || size == "m4" || size == "m4+" ? 8.96 : (2*holesize)+.5;
ds = size == "m2_tap" || size == "m2" || size == "m2+" ? 1.2 :
size == "m2.5_tap" || size == "m2.5" || size == "m2.5+" ? 1.5 :
size == "m3_tap" || size == "m3" || size == "m3+" ? 1.86 :
size == "m4_tap" || size == "m4" || size == "m4+" ? 2.48 : holesize*.465;
adj = 0.1;
$fn = 90;
difference (){
union () {
if(style == 0 && reverse == 0) {
rotate([0,0,30]) cylinder(d=radius*2/sqrt(3),h=height,$fn=6);
}
if(style == 0 && reverse == 1) {
translate([0,0,-height]) rotate([0,0,30]) cylinder(d=radius*2/sqrt(3),h=height,$fn=6);
}
if(style == 1 && reverse == 0) {
cylinder(d=radius,h=height,$fn=90);
}
if(style == 1 && reverse == 1) {
translate([0,0,-height]) cylinder(d=radius,h=height,$fn=90);
}
if(reverse == 1) {
translate([0,0,-supportheight]) cylinder(d=(supportsize),h=supportheight,$fn=60);
}
else {
cylinder(d=(supportsize),h=supportheight,$fn=60);
}
if(enablemask == true && mstyle == "default") {
if(reverse == true) {
translate([0,0,-msetback-adj]) cylinder(d=supportsize-2*adj,h=mlength);
}
// hole
if(sink <= 3 && reverse == 0) {
translate([0,0,-adj]) cylinder(d=holesize, h=height+(adj*2),$fn=90);
}
if(sink <= 3 && reverse == 1) {
translate([0,0,-adj-height]) cylinder(d=holesize, h=height+(adj*2),$fn=90);
}
// countersink hole
if(sink == 1 && reverse == 0) {
translate([0,0,-adj]) cylinder(d1=6.5, d2=(holesize), h=3);
}
if(sink == 1 && reverse == 1) {
translate([0,0,+adj-2.5]) cylinder(d1=(holesize), d2=6.5, h=3);
}
// recessed hole
if(sink == 2 && reverse == 0) {
translate([0,0,-adj]) cylinder(d=6.5, h=3);
}
if(sink == 2 && reverse == 1) {
translate([0,0,+adj-3]) cylinder(d=6.5, h=3);
}
// nut holder
if(sink == 3 && reverse == 0) {
translate([0,0,-adj]) cylinder(r=3.3,h=3,$fn=6);
}
if(sink == 3 && reverse == 1) {
translate([0,0,+adj-3]) cylinder(r=3.3,h=3,$fn=6);
}
// blind hole
if(sink == 4 && reverse == 0) {
translate([0,0,2]) cylinder(d=holesize, h=height,$fn=90);
}
if(sink == 4 && reverse == 1) {
translate([0,0,-height-2-adj]) cylinder(d=holesize, h=height,$fn=90);
}
if(insert_e > 0 && reverse == 0) {
translate([0,0,height-i_depth]) cylinder(d=i_dia, h=i_depth+adj,$fn=90);
}
if(insert_e > 0 && reverse == 1) {
translate([0,0,-height-adj]) cylinder(d=i_dia, h=i_depth+adj,$fn=90);
else {
translate([0,0,-mlength+msetback+adj]) cylinder(d=supportsize-2*adj,h=mlength);
}
}
}
if(enablemask == false) {
difference (){
union () {
if(pillarstyle == "hex" && reverse == false) {
rotate([0,0,30]) cylinder(d=diameter*2/sqrt(3), h=height, $fn=6);
}
if(pillarstyle == "hex" && reverse == true) {
translate([0,0,-height]) rotate([0,0,30]) cylinder(d=diameter*2/sqrt(3), h=height, $fn=6);
}
if(pillarstyle == "round" && reverse == false) {
cylinder(d=diameter, h=height);
}
if(pillarstyle == "round" && reverse == true) {
translate([0,0,-height]) cylinder(d=diameter, h=height);
}
if(reverse == true) {
translate([0,0,-supportheight]) cylinder(d=supportsize, h=supportheight);
}
else {
cylinder(d=(supportsize),h=supportheight);
}
if(pillarsupport == "rear" && reverse == true) {
translate([-1,-supportsize/2,-height]) cube([2, supportsize/2, height]);
}
if(pillarsupport == "rear" && reverse == false) {
translate([-1,-supportsize/2,0]) cube([2, supportsize/2, height]);
}
if(pillarsupport == "front" && reverse == true) {
translate([-1,0,-height]) cube([2, supportsize/2, height]);
}
if(pillarsupport == "front" && reverse == false) {
translate([-1,0,0]) cube([2, supportsize/2, height]);
}
if(pillarsupport == "left" && reverse == true) {
translate([-supportsize/2,-1,-height]) cube([supportsize/2, 2, height]);
}
if(pillarsupport == "left" && reverse == false) {
translate([-supportsize/2,-1,0]) cube([supportsize/2, 2, height]);
}
if(pillarsupport == "right" && reverse == true) {
translate([0,-1,-height]) cube([supportsize/2, 2, height]);
}
if(pillarsupport == "right" && reverse == false) {
translate([0,-1,0]) cube([supportsize/2, 2, height]);
}
}
// hole
if(sink == "none" && reverse == false) {
translate([0,0,-adj]) cylinder(d=holesize, h=height+(adj*2));
}
if(sink != "blind" && reverse == false) {
translate([0,0,-adj]) cylinder(d=holesize, h=height+(adj*2));
}
if(sink != "blind" && reverse == true) {
translate([0,0,-adj-height]) cylinder(d=holesize, h=height+(adj*2));
}
// countersink hole
if(sink == "countersunk" && reverse == false) {
translate([0,0,-adj]) cylinder(d1=ps, d2=holesize, h=ds);
}
if(sink == "countersunk" && reverse == true) {
translate([0,0,+adj-ds]) cylinder(d1=holesize, d2=ps, h=ds);
}
// recessed hole
if(sink == "recessed" && reverse == false) {
translate([0,0,-adj]) cylinder(d=6.5, h=supportheight-2);
}
if(sink == "recessed" && reverse == true) {
translate([0,0,+adj-supportheight+2]) cylinder(d=6.5, h=supportheight-2);
}
// nut holder
if(sink == "nut holder" && reverse == false) {
translate([0,0,-adj]) cylinder(d=ps*2/sqrt(3),h=ds,$fn=6);
}
if(sink == "nut holder" && reverse == true) {
translate([0,0,+adj-ds]) cylinder(d=ps*2/sqrt(3),h=ds,$fn=6);
}
// blind hole
if(sink == "blind" && reverse == false) {
translate([0,0,2]) cylinder(d=holesize, h=height);
}
if(sink == "blind" && reverse == true) {
translate([0,0,-height-2-adj]) cylinder(d=holesize, h=height);
}
if(insert_e == true && reverse == false) {
translate([0,0,height-i_depth]) cylinder(d=i_dia, h=i_depth+adj);
}
if(insert_e == true && reverse == true) {
translate([0,0,-height-adj]) cylinder(d=i_dia, h=i_depth+adj);
}
}
}
}

View File

@@ -15,90 +15,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
vent(width, length, height, gap, rows, columns, orientation)
vent_hex(cells_x, cells_y, thickness, cell_size, cell_spacing, orientation)
vent_panel_hex(x, y, thick, cell_size, cell_spacing, border, borders);
*/
/*
NAME: vent
DESCRIPTION: creates vent mask patterns
TODO: none
USAGE: vent(width, length, height, gap, rows, columns, orientation)
width = coloumn size_x
length = column size_y
height = size_z
gap = space between
rows = #row
columns = #columns
orientation = "horizontal", "vertical"
*/
module vent(width, length, height, gap, rows, columns, orientation) {
fillet = width/2;
adj = .01;
$fn=90;
// vertical orientation
if(orientation == "vertical") { rotate([90,0,0])
for (r=[0:length+gap:rows*(length+gap)-1]) {
for (c=[0:width+(2*gap):(columns*(width+(2*gap)))-1]) {
translate ([c,r,-1]) cube([width,length,height]);
}
}
}
// horizontal orientation
if(orientation == "horizontal") {
for (r=[0:length+(2*gap):rows*(length+gap)]) {
for (c=[0:width+(2*gap):(columns*(width+(2*gap)))-1]) {
translate ([c,r,-1]) cube([width,length,height]);
}
}
}
}
/*
NAME: vent_hex
DESCRIPTION: creates hex vent mask patterns
TODO: none
USAGE: vent_hex(cells_x, cells_y, thickness, cell_size, cell_spacing, orientation)
cells_x = #rows
cells_y = #columns
thickness = pattern thickness
cell_size = size of hex
cell_spacing = space between hex
orientation = "horizontal", "vertical"
*/
module vent_hex(cells_x, cells_y, thickness, cell_size, cell_spacing, orientation) {
xs = cell_size + cell_spacing;
ys = xs * sqrt(3/4);
rot = (orientation=="vertical") ? 90 : 0;
rotate([rot,0,0]) translate([cell_size/2, cell_size*sqrt(1/3),-1]) {
for (ix = [0 : ceil(cells_x/2)-1]) {
for (iy = [0 : 2 : cells_y-1]) {
translate([ix*xs, iy*ys,0]) rotate([0,0,90])
cylinder(r=cell_size/sqrt(3), h=thickness, $fn=6);
}
}
for (ix = [0 : (cells_x/2)-1]) {
for (iy = [1 : 2 : cells_y-1]) {
translate([(ix+0.5)*xs, iy*ys,0]) rotate([0,0,90])
cylinder(r=cell_size/sqrt(3), h=thickness, $fn=6);
}
}
}
}
/*
NAME: vent_panel_hex
@@ -140,4 +60,4 @@ module vent_panel_hex(x, y, thick, cell_size=8, cell_spacing=3, border=3, border
color("grey",1) translate([x - hxb, y - hyb, -1]) cylinder(d=hole, h=thick+3);
}
}
}
}

View File

@@ -20,27 +20,103 @@
DESCRIPTION: places additive objects
TODO: none
USAGE: add(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, data_1, data_2, data_3, data_4)
USAGE: add(type, loc_x, loc_y, loc_z, face, rotation, size[], data[], mask[])
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
type = component type
loc_x = x location placement
loc_y = y location placement
loc_z = z location placement
face = "top", "bottom", "left", "right", "front", "rear"
rotation[] = object rotation
parametric[] = parametric movement array
size[] = size array x,y,z
data[] = data variable on type
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module add(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, data_1, data_2, data_3, data_4) {
module add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
size_x = size[0];
size_y = size[1];
size_z = size[2];
enablemask = mask[0];
mlen = mask[1];
msetback = mask[2];
mstyle = mask[3];
if(type == "access_cover") {
if(rotation[2] == 180) {
color("grey",1) translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data[0]);
}
else {
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data[0]);
}
}
if(type == "access_panel") {
if(rotation[2] == 180) {
translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_panel([size_x,size_y,size_z],data[0],mask);
}
else {
translate([loc_x,loc_y,loc_z]) rotate(rotation) access_panel([size_x,size_y,size_z],data[0],mask);
}
}
if(type == "art") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data[0],data[1],data[2]);
}
if(type == "batt_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) batt_holder(data[0]);
}
if(type == "button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) buttons(data[0],[size_x,size_y,size_z],data[1],data[2],mask);
}
if(type == "button_assembly") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) button_assembly(data[0],size_x,size_z);
}
if(type == "fan_cover") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_cover(size_x, size_z, data[0]);
}
if(type == "feet") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) feet(size_x, size_z);
}
if(type == "hd_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data[0],data[1],data[2],data[3]);
}
if(type == "hk_boom_grill") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_grill(data[0],size_z);
}
if(type == "hk_boom_speaker_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_speaker_holder(data[0],data[1]);
}
if(type == "hk_boom_vring") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_vring(data[0]);
}
if(type == "hk_h3_port_extender_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_h3_port_extender_holder(data[1],data[0]);
}
if(type == "hk_hc4_oled_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_hc4_oled_holder(face, size_z, mask);
}
if(type == "hk_uart_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart_holder(mask);
}
if(type == "hk_uart_strap") {
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart_strap();
}
if(type == "keyhole") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data[0],mask);
}
if(type == "nut_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) nut_holder(data[0], data[1], size_x, size_y, size_z, mask);
}
if(type == "pcb_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) pcb_holder([size_x,size_y,size_z],data[0]);
}
if(type == "rectangle") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data[0]);
}
if(type == "round") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) cylinder(d=size_x,h=size_z);
@@ -48,135 +124,85 @@ module add(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, da
if(type == "slot") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slot(size_x,size_y,size_z);
}
if(type == "text") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data_3, size=data_1);
}
if(type == "art") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data_1,data_2,data_3);
}
if(type == "button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data_3,[size_x,size_y,size_z],data_4,data_1);
}
if(type == "button_top") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) button_assembly(data_3,size_x,size_z);
}
if(type == "pcb_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) pcb_holder([size_x,size_y,size_z],data_1);
}
if(type == "batt_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) batt_holder(data_1);
}
if(type == "hk_uart_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart_holder();
}
if(type == "hk_uart_strap") {
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart_strap();
if(type == "sphere") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) sphere(d=size_x);
}
if(type == "standoff") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data[0], mask);
}
if(type == "hd_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"horizontal","none");
if(type == "text") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data[1], size=data[0]);
}
if(type == "vent_panel_hex") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_panel_hex(size_x, size_y, thick=size_z,
cell_size=data[0], cell_spacing=data[1], border=data[3], borders=data[2]);
}
if(type == "hd_vertleft") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"vertical","left");
// models
if(type == "adafruit_lcd") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) adafruit_lcd(mask);
}
if(type == "hd_vertright") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"vertical","right");
if(type == "dsub") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data[0], data[1], mask);
}
if(type == "fan") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) fans(data[0],mask);
}
if(type == "hd25") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd25(data_1);
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd25(data[0],data[1],mask);
}
if(type == "hd35") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd35();
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd35(data[0],mask);
}
if(type == "hk_boom") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom(data[0],data[1],mask);
}
if(type == "hk_boom_speaker") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_speaker(mask);
}
if(type == "hk_boom_speaker_pcb") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_speaker_pcb(data[1],true,data[0],mask);
}
if(type == "hk_h3_port_extender") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_h3_port_extender(data[0],mask);
}
if(type == "hk_hc4_oled") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_hc4_oled(mask);
}
if(type == "hk_lcd35") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_35lcd(mask);
}
if(type == "hk_m1s_ups") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_m1s_ups(mask);
}
if(type == "hk_netcard") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_netcard(mask);
}
if(type == "hk_pwr_button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_pwr_button(mask);
}
if(type == "hk_speaker") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_speaker(mask);
}
if(type == "hk_uart") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart(mask);
}
if(type == "hk_vu7c") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_vu7c(data[0],data[1],mask);
}
if(type == "hk_vu8m") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_vu8m(data[0],mask);
}
if(type == "hk_vu8s") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_vu8s(mask);
}
if(type == "hk_wb2") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_wb2();
}
if(type == "hc4_oled") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hc4_oled();
if(type == "hk_xu4_shifter_shield") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_xu4_shifter_shield(mask);
}
if(type == "hc4_oled_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hc4_oled_holder(face,size_z);
}
if(type == "h2_netcard") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) h2_netcard();
}
if(type == "hk_lcd35") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk35_lcd();
}
if(type == "hk_m1s_ups") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_m1s_ups();
}
if(type == "hk_uart") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart();
}
if(type == "hk_vu7c") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_vu7c(data_1,data_2);
}
if(type == "hk_boom") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom(data_1,data_3);
}
if(type == "boom_speaker") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_speaker(data_3,true,data_1);
}
if(type == "boom_grill") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_grill(data_3,size_z);
}
if(type == "boom_speaker_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) boom_speaker_holder(data_1);
}
if(type == "hk_speaker") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_speaker();
}
if(type == "fan_cover") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_cover(size_x, size_z, data_1);
}
if(type == "vent_panel_hex") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_panel_hex(x=size_x, y=size_y, thick=size_z,
cell_size=data_1, cell_spacing=data_2, border=data_4, borders=data_3);
}
if(type == "feet") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) feet(size_x, size_z);
}
if(type == "access_port") {
if(rotation[2] == 180) {
translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_port([size_x,size_y,size_z],data_3);
}
else {
translate([loc_x,loc_y,loc_z]) rotate(rotation) access_port([size_x,size_y,size_z],data_3);
}
}
if(type == "access_cover") {
if(rotation[2] == 180) {
color("grey",1) translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data_3);
}
else {
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data_3);
}
}
if(type == "boom_vring") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) boom_vring(data_1);
}
if(type == "h3_port_extender") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender(data_3);
}
if(type == "h3_port_extender_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender_holder(data_3,data_1);
}
if(type == "hk_pwr_button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_pwr_button();
}
if(type == "keyhole") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data_4);
}
if(type == "dsub") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data_4);
}
if(type == "nut_holder") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) nut_holder(data_1, data_2, size_x, size_y, size_z);
}
if(type == "standoff") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data_4);
if(type == "stl_model") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) stl_model(data[0],data[1]);
}
}

428
mod/case_adapter.scad Normal file
View File

@@ -0,0 +1,428 @@
/*
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
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: case_adapter
DESCRIPTION: creates adapters for legacy cases footprints
TODO: nano-itx hole locations
USAGE: case_adapter(case_design)
*/
module case_adapter(case_design) {
mb_adapters=[
["adapter_ssi-eeb", 304.8, 330.2, ["left_rear", 6.35, 33.02], ["middle_rear", 163.83, 10.16], ["right_rear", 288.29, 10.16],
["left_middle", 6.35, 165.1], ["middle_middle", 163.83, 165.1], ["right_middle", 288.29, 165.1],
["middle_middle2", 209.55, 237.49], ["right_middle2", 288.29, 237.49],
["left_front", 6.35, 322.58], ["middle_front", 163.83, 322.58], ["right_front", 299.72, 322.58]],
["adapter_ssi-ceb", 304.8, 266.7, ["left_rear", 6.35, 33.02], ["middle_rear", 163.83, 10.16], ["right_rear", 288.29, 10.16],
["left_middle", 6.35, 165.1], ["middle_middle", 163.83, 165.1], ["right_middle", 288.29, 165.1],
["middle_front", 209.55, 237.49], ["right_front", 288.29, 237.49]],
["adapter_atx", 304.8, 243.84, ["left_rear", 6.35, 33.02], ["middle_rear", 163.83, 10.16],
["middle2_rear", 211.99, 10.16], ["right_rear", 288.29, 10.16],
["left_middle", 6.35, 165.1], ["middle_middle", 163.83, 165.1], ["right_middle", 288.29, 165.1],
["left_front", 6.35, 237.49], ["middle_front", 163.83, 237.49], ["right_front", 288.29, 237.49]],
["adapter_micro-atx", 243.84, 243.84, ["left_rear", 6.35, 33.02], ["middle_rear", 163.83, 10.16], ["right_rear", 211.99, 10.16],
["left_middle", 6.35, 165.1], ["middle_middle", 163.83, 165.1],
["middle2_middle", 209.55, 165.1], ["right_middle", 229.87, 165.1],
["left_front", 6.35, 237.49], ["right_front", 163.83, 237.49]],
["adapter_dtx", 230.2, 243.84, ["left_rear", 6.35, 33.02], ["middle_rear", 163.83, 10.16], ["right_rear", 211.99, 10.16],
["left_middle", 6.35, 165.1], ["middle_middle", 163.83, 165.1], ["right_middle", 209.55, 165.1],
["left_front", 6.35, 237.49], ["right_front", 163.83, 237.49]],
["adapter_flex-atx", 228.6, 190.5, ["left_rear", 6.35, 33.02], ["middle_rear", 163.83, 10.16], ["right_rear", 211.99, 10.16],
["left_front", 6.35, 165.1], ["middle_front", 163.83, 165.1],
["right_front", 209.55, 165.1]],
["adapter_mini-dtx", 203.2, 170.18, ["left_rear", 6.35, 33.02], ["right_rear", 163.83, 10.16],
["left_front", 6.35, 165.1], ["right_front", 163.83, 165.1]],
["adapter_mini-itx", 170, 170, ["left_rear", 6.35, 33.02], ["right_rear", 163.83, 10.16],
["left_front", 6.35, 165.1], ["right_front", 163.83, 165.1]],
["adapter_mini-itx_thin", 170, 170, ["left_rear", 6.35, 33.02], ["right_rear", 163.83, 10.16],
["left_front", 6.35, 165.1], ["right_front", 163.83, 165.1]],
["adapter_mini-stx", 140, 147, ["left_rear", 5, 5], ["right_rear", 135, 5],
["left_front", 5, 142], ["right_front", 135, 142]],
["adapter_mini-stx_thin", 140, 147, ["left_rear", 5, 5], ["right_rear", 135, 5],
["left_front", 5, 142], ["right_front", 135, 142]],
];
mb = search([case_design],mb_adapters);
mba_x = mb_adapters[mb[0]][1];
mba_y = mb_adapters[mb[0]][2];
mba_z = floorthick;
mba_offset_x = -8.35;
mba_offset_y = 0;
mba_radius = 5;
mba_standoff = [6.75, floorthick, 4, 7, floorthick, "none", "round", "none", true, false, 0, 0];
io_offset = 6.35;
adj = .01;
difference() {
union() {
difference() {
union() {
translate([mba_offset_x,mba_offset_y,0]) slab([mba_x,mba_y,mba_z], mba_radius);
// additive accessories
if(accessory_name != "none") {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
loc_y = accessory_data[a[0]][i+3];
loc_z = accessory_data[a[0]][i+4];
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size = accessory_data[a[0]][i+8];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if(class == "add1" && face == "bottom") {
parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric, size, data, [false,mask[1],mask[2],mask[3]]);
}
}
}
}
// adapter holes
for (i=[2:len(mb_adapters[mb[0]])-3:len(mb_adapters[mb[0]])-3]) {
for (c=[1:1:len(mb_adapters[mb[0]])-3]) {
mbhole_pos = mb_adapters[mb[0]][i+c][0];
mbhole_x = mb_adapters[mb[0]][i+c][1]+mba_offset_x;
mbhole_y = mb_adapters[mb[0]][i+c][2]+mba_offset_y;
mbhole_z = -floorthick;
translate([mbhole_x,mbhole_y,-1]) cylinder(d=4, h=mba_z+2);
}
}
// pcb standoff holes
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];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
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 && pcbhole_pos == "left_rear" &&
bottom_rear_left_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=bottom_standoff[4]-.2, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_front" &&
bottom_front_left_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=bottom_standoff[4]-.2, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_rear" &&
bottom_rear_right_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=bottom_standoff[4]-.2, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_front" &&
bottom_front_right_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=bottom_standoff[4]-.2, h=bottom_height);
}
}
}
// bottom cover pattern
if(bottom_cover_pattern != "solid") {
if(bottom_cover_pattern == "hex_5mm") {
translate([1,0,-2]) vent_hex(mba_x/3.75,mba_y/6,floorthick+4,5,1.5,"horizontal");
}
if(bottom_cover_pattern == "hex_8mm") {
translate([1,2,-2]) vent_hex(mba_x/5.5,mba_y/9.5,floorthick+4,8,1.5,"horizontal");
}
if(bottom_cover_pattern == "linear_vertical") {
translate([0,-gap,-2]) vent(wallthick,mba_y-2*wallthick-gap,floorthick+4,1,1,(mba_x-2*wallthick-gap)/4,"horizontal");
}
if(bottom_cover_pattern == "linear_horizontal") {
translate([-gap,-gap,-2]) vent(mba_x-2*wallthick-gap,wallthick,floorthick+4,1,(mba_y-2*wallthick-gap)/3,1,"horizontal");
}
if(bottom_cover_pattern == "astroid") {
for(c=[3:12:mba_y-8]) {
for(r=[4:12:mba_x-8]) {
translate([r,c,-4]) linear_extrude(floorthick+5) import("./dxf/astroid_8mm.dxf");
}
}
}
}
// subtractive accessories
if(accessory_name != "none") {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
loc_y = accessory_data[a[0]][i+3];
loc_z = accessory_data[a[0]][i+4];
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8][0];
size_y = accessory_data[a[0]][i+8][1];
size_z = accessory_data[a[0]][i+8][2];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if ((class == "sub" && face == "bottom") || class == "suball") {
if(accessory_highlight == false) {
parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric,
[size_x,size_y,size_z],data, mask);
}
else {
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
[size_x,size_y,size_z],data, mask);
}
}
// create openings for additive
if ((class == "add1" || class == "add2" || class == "model") && mask[0] == true) {
if(accessory_highlight == false) {
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,[true,mask[1],mask[2],mask[3]]);
}
else {
#parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,[true,mask[1],mask[2],mask[3]]);
}
}
}
}
// ui access panel
if(bottom_access_panel_enable == true) {
if(access_panel_rotation == 0) {
translate([access_panel_location[0],access_panel_location[1], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [true,10,2,"default"]);
}
if(access_panel_rotation == 90) {
translate([access_panel_location[0]+access_panel_size[1],access_panel_location[1], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [true,10,2,"default"]);
}
if(access_panel_rotation == 180) {
translate([access_panel_location[0]+access_panel_size[0],access_panel_location[1]+access_panel_size[1],0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [true,10,2,"default"]);
}
if(access_panel_rotation == 270) {
translate([access_panel_location[0],access_panel_location[1]+access_panel_size[0], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [true,10,2,"default"]);
}
}
}
// adapter standoffs
for (i=[2:len(mb_adapters[mb[0]])-3:len(mb_adapters[mb[0]])-3]) {
for (c=[1:1:len(mb_adapters[mb[0]])-3]) {
mbhole_pos = mb_adapters[mb[0]][i+c][0];
mbhole_x = mb_adapters[mb[0]][i+c][1]+mba_offset_x;
mbhole_y = mb_adapters[mb[0]][i+c][2]+mba_offset_y;
mbhole_z = -floorthick;
translate([mbhole_x,mbhole_y,floorthick]) standoff(mba_standoff,[false,10,2,"default"]);
}
}
// pcb standoffs
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];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
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 &&
(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) {
bottom_support = bottom_sidewall_support == true ? bottom_rear_left_support : "none";
pcb_standoff = [bottom_standoff[0],
bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_left_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"]);
}
if (pcbhole_pos == "left_front" && bottom_front_left_enable == true) {
bottom_support = bottom_sidewall_support == true ? bottom_front_left_support : "none";
pcb_standoff = [bottom_standoff[0],
bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+bottom_front_left_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"]);
}
if (pcbhole_pos == "right_rear" && bottom_rear_right_enable == true) {
bottom_support = bottom_sidewall_support == true ? bottom_rear_right_support : "none";
pcb_standoff = [bottom_standoff[0],
bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_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"]);
}
if (pcbhole_pos == "right_front" && bottom_front_right_enable == true) {
bottom_support = bottom_sidewall_support == true ? bottom_front_right_support : "none";
pcb_standoff = [bottom_standoff[0],
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"]);
}
}
}
}
}
translate([mba_offset_x-10, -10, -1]) cube([mba_x+20, 10, floorthick+10]);
}
// additive accessories
if(accessory_name != "none") {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
loc_y = accessory_data[a[0]][i+3];
loc_z = accessory_data[a[0]][i+4];
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size = accessory_data[a[0]][i+8];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if(class == "add2" && face == "bottom") {
parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric, size, data, [false,mask[1],mask[2],mask[3]]);
}
}
}
// ui access port
if(bottom_access_panel_enable == true) {
if(access_panel_rotation == 0) {
translate([access_panel_location[0],access_panel_location[1], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [false,10,2,"default"]);
}
if(access_panel_rotation == 90) {
translate([access_panel_location[0]+access_panel_size[1],access_panel_location[1], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [false,10,2,"default"]);
}
if(access_panel_rotation == 180) {
translate([access_panel_location[0]+access_panel_size[0],access_panel_location[1]+access_panel_size[1],0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [false,10,2,"default"]);
}
if(access_panel_rotation == 270) {
translate([access_panel_location[0],access_panel_location[1]+access_panel_size[0], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [false,10,2,"default"]);
}
}
}
/*
NAME: io_shield
DESCRIPTION: creates rear io panel for legacy cases
TODO: none
USAGE: io_shield()
*/
module io_shield() {
io_window_x = case_design == "adapter_mini-stx_thin" || case_design == ("adapter_mini-stx") ? 123.95 : 158.75;
io_window_y = 4;
io_window_z = case_design == "adapter_mini-stx" ? 40 : case_design == "adapter_mini-stx_thin" || case_design == "adapter_mini-itx_thin" ? 25 : 44;
io_offset = case_design == "adapter_mini-stx_thin" || case_design == "adapter_mini-stx" ? 1.2 : 10.79;
difference() {
union() {
translate([-1,io_window_y-1,-1]) cube([io_window_x+2,1,io_window_z+2]);
cube([io_window_x,4,io_window_z]);
}
translate([2,-2,2]) cube([io_window_x-4,5,io_window_z-4]);
translate([io_offset+pcb_loc_x,6+pcb_loc_y,bottom_height-pcb_z+pcb_loc_z+2])
sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
// subtractive accessories
if(accessory_name != "none") {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2]+io_offset;
loc_y = accessory_data[a[0]][i+3]+io_window_y;
loc_z = accessory_data[a[0]][i+4]+2;
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8][0];
size_y = accessory_data[a[0]][i+8][1];
size_z = accessory_data[a[0]][i+8][2];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if ((class == "sub" && face == "bottom") || class == "suball") {
if(accessory_highlight == false) {
parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric,
[size_x,size_y,size_z],data, mask);
}
else {
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
[size_x,size_y,size_z],data, mask);
}
}
// create openings for additive
if ((class == "add1" || class == "add2" || class == "model") && mask[0] == true) {
if(accessory_highlight == false) {
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,[true,mask[1],mask[2],mask[3]]);
}
else {
#parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,[true,mask[1],mask[2],mask[3]]);
}
}
}
}
}
}

View File

@@ -26,6 +26,11 @@
module case_bottom(case_design) {
lip = 5;
vu_rotation = [15,0,0];
case_fn = 360; // circle segments for round cases
case_ffn = 90; // circle segments for fillet of round cases
difference() {
union() {
difference() {
@@ -34,13 +39,13 @@ module case_bottom(case_design) {
difference() {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,bottom_height/2])
cube_fillet_inside([width,depth,bottom_height],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[0,0,0,0], bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
translate([(width/2)-wallthick-gap,
(depth/2)-wallthick-gap,(bottom_height/2)+floorthick])
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),bottom_height],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],
top=[0,0,0,0], bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
}
}
if(case_design == "panel") {
@@ -60,52 +65,75 @@ module case_bottom(case_design) {
if(case_design == "stacked") {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,floorthick/2])
cube_fillet_inside([width-(2*wallthick),depth-(2*wallthick),floorthick],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
}
if(case_design == "tray") {
if(case_design == "tray" || case_design == "tray_vu5" || case_design == "tray_vu7" || case_design == "tray_sides") {
difference() {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,(bottom_height)/2])
cube_fillet_inside([width,depth,bottom_height],
vertical=[0,0,0,0], top=[0,0,0,0],
bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,(bottom_height/2)+floorthick])
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),bottom_height+adj],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],
top=[0,0,0,0],bottom=[2,2,2,2], $fn=90);
}
// right side nut
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+10,
floorthick+3.4]) rotate([90,0,90])
cylinder(d=10, h=4, $fn=6);
// left side nut
translate([-adj-gap,wallthick+gap+10,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
if(depth >= 75 && sbc_model != "visionfive2" && sbc_model != "visionfive2q" &&
sbc_model != "rock5b" && sbc_model != "rock5bq" && sbc_model != "rock5b-v1.3") {
translate([width-wallthick-gap-wallthick-4+adj,depth-wallthick-gap-10,
floorthick+3.4]) rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
translate([-adj-gap,depth-wallthick-gap-10,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
}
else {
if(sbc_model == "visionfive2" || sbc_model == "visionfive2q" || sbc_model == "rock5b" ||
sbc_model == "rock5bq" || sbc_model == "rock5b-v1.3") {
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+58,
floorthick+3.4]) rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
translate([-adj-gap,wallthick+gap+58,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
// case nut placement
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]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
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 && pcbhole_pos == "left_rear") {
if((pcbhole_y <= 10 && pcbhole_x <= 10) || (ext_bottom_standoffs == true && ext_bottom_rear_left_enable == true)) {
translate([-adj-gap,wallthick+gap+10,floorthick+3.4]) rotate([90,0,90])
cylinder(d=10, h=4, $fn=6);
}
else {
translate([-adj-gap,wallthick+gap+2,floorthick+3.4]) rotate([90,0,90])
cylinder(d=10, h=4, $fn=6);
}
}
else {
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+40,
floorthick+3.4]) rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
translate([-adj-gap,wallthick+gap+40,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_front") {
if((pcbhole_y >= pcb_depth+case_offset_y-10 && pcbhole_x <= 10) || (ext_bottom_standoffs == true && ext_bottom_front_left_enable == true)) {
translate([-adj-gap,wallthick-gap+pcb_depth+case_offset_y-14,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
}
else {
translate([-adj-gap,wallthick+gap+pcb_depth+case_offset_y-8,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
}
}
}
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_rear") {
if((pcbhole_y <= 10 && pcbhole_x >= pcb_width-10) || (ext_bottom_standoffs == true && ext_bottom_rear_right_enable == true)) {
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+10,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
}
else {
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+2,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
}
}
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_front") {
if((pcbhole_y >= pcb_depth+case_offset_y-10 && pcbhole_x >= width-10) || (ext_bottom_standoffs == true && ext_bottom_front_right_enable == true)) {
translate([width-wallthick-gap-wallthick-4+adj,wallthick-gap+pcb_depth+case_offset_y-14,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
}
else {
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+pcb_depth+case_offset_y-8,floorthick+3.4])
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
}
}
}
// front panel
if(case_style == "sides" || case_style == "vu5" || case_style == "vu7") {
if(case_design == "tray_vu5" || case_design == "tray_vu7" || case_design == "tray_sides") {
translate([-wallthick-gap,depth-(2*wallthick)-gap,bottom_height-adj])
rotate([0,0,0]) cube([width,wallthick,top_height]);
}
@@ -123,10 +151,10 @@ module case_bottom(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,30])
cylinder_fillet_inside(h=bottom_height, r=case_diameter/2,
top=0, bottom=fillet, $fn=case_fn, fillet_fn=case_ffn, center=true);
top=0, bottom=edge_fillet, $fn=case_fn, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+floorthick]) rotate([0,0,30])
cylinder_fillet_inside(h=bottom_height+adj, r=(case_diameter/2)-lip/2,
top=0, bottom=fillet-1, $fn=case_fn, fillet_fn=case_ffn, center=true);
top=0, bottom=edge_fillet-1, $fn=case_fn, fillet_fn=case_ffn, center=true);
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,30])
cylinder(h=lip+adj, r=(case_diameter/2)+1, $fn=case_fn);
@@ -137,7 +165,7 @@ module case_bottom(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+2*floorthick]) rotate([0,0,30])
cylinder_fillet_inside(h=bottom_height+adj+floorthick+lip,
r=(case_diameter/2)-lip/2,top=0,bottom=fillet-1, $fn=case_fn,
r=(case_diameter/2)-lip/2,top=0,bottom=edge_fillet-1, $fn=case_fn,
fillet_fn=case_ffn, center=true);
if(width/depth >= 1.4 && sbc_model != "vim1" && sbc_model != "vim2" &&
sbc_model != "vim3l" && sbc_model != "vim3" && sbc_model != "vim4" &&
@@ -162,10 +190,10 @@ module case_bottom(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,30])
cylinder_fillet_inside(h=bottom_height, r=case_diameter/2,
top=0, bottom=fillet, $fn=6, fillet_fn=case_ffn, center=true);
top=0, bottom=edge_fillet, $fn=6, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+floorthick]) rotate([0,0,30])
cylinder_fillet_inside(h=bottom_height+adj,r=(case_diameter/2)-lip/2,top=0,
bottom=fillet-1,$fn=6,fillet_fn=case_ffn, center=true);
bottom=edge_fillet-1,$fn=6,fillet_fn=case_ffn, center=true);
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,30])
cylinder(h=lip+adj,r=(case_diameter/2)+1, $fn=6);
@@ -176,7 +204,7 @@ module case_bottom(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+2*floorthick]) rotate([0,0,30])
cylinder_fillet_inside(h=bottom_height+adj+floorthick+lip,
r=(case_diameter/2)-lip/2,top=0, bottom=fillet-1, $fn=6,
r=(case_diameter/2)-lip/2,top=0, bottom=edge_fillet-1, $fn=6,
fillet_fn=case_ffn, center=true);
translate([-16,(depth/2)-150,-adj])
cube([width+10,300,case_z-2*floorthick-2]);
@@ -188,10 +216,10 @@ module case_bottom(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,0])
cylinder_fillet_inside(h=bottom_height, r=hex_diameter/2,
top=0, bottom=fillet, $fn=6, fillet_fn=case_ffn, center=true);
top=0, bottom=edge_fillet, $fn=6, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+floorthick]) rotate([0,0,0])
cylinder_fillet_inside(h=bottom_height+adj,r=(hex_diameter/2)-lip/2,top=0,
bottom=fillet-1,$fn=6,fillet_fn=case_ffn, center=true);
bottom=edge_fillet-1,$fn=6,fillet_fn=case_ffn, center=true);
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,0])
cylinder(h=lip+adj,r=(hex_diameter/2)+1, $fn=6);
@@ -202,7 +230,7 @@ module case_bottom(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+2*floorthick]) rotate([0,0,0])
cylinder_fillet_inside(h=bottom_height+adj+floorthick+lip,
r=(hex_diameter/2)-lip/2,top=0, bottom=fillet-1, $fn=6,
r=(hex_diameter/2)-lip/2,top=0, bottom=edge_fillet-1, $fn=6,
fillet_fn=case_ffn, center=true);
translate([-width/2,0,-adj])
cube([300,depth+100,case_z-2*floorthick-2]);
@@ -215,12 +243,12 @@ module case_bottom(case_design) {
difference() {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,(floorthick+case_z)/2])
cube_fillet_inside([width,depth,floorthick+case_z],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[0,0,0,0], bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,floorthick+(floorthick+case_z)/2])
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),case_z+floorthick],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],
top=[0,0,0,0], bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
// snap top indent
translate([-gap-wallthick+.75,(depth/2)-(depth*.75)/2-gap-wallthick,case_z-.5])
rotate([0,45,0]) cube([4,depth*.75,4]);
@@ -232,29 +260,29 @@ module case_bottom(case_design) {
difference() {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z/2])
cube_fillet_inside([width,depth,case_z],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[0,0,0,0], bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
translate([(width/2)-wallthick-gap,
(depth/2)-wallthick-gap,(case_z/2)+floorthick])
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),case_z],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],
top=[0,0,0,0], bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
difference() {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-lip/2])
cube_fillet_inside([width+adj,depth+adj,lip+adj],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[0,0,0,0],bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[0,0,0,0],bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-lip/2])
cube_fillet_inside([width-wallthick,depth-wallthick,lip+adj],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],top=[0,0,0,0],
bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],top=[0,0,0,0],
bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
}
}
}
// additive accessories
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -263,76 +291,18 @@ module case_bottom(case_design) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size = accessory_data[a[0]][i+8];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if(class == "add1" && face == "bottom") {
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric, size, data, [false,mask[1],mask[2],mask[3]]);
}
}
}
}
// side attachment holes
if(case_design == "tray") {
// right side bottom attachment holes
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
// right side bottom nut inset
translate([width-3.5-(2*wallthick)-gap-.6,wallthick+gap+10,
floorthick+3.4]) rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
// left side bottom attachment holes
translate([-wallthick-gap-adj,wallthick+gap+10,floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
// left side bottom nut inset
translate([-gap+.6,wallthick+gap+10,floorthick+3.4])
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
if(depth >= 75 && sbc_model != "visionfive2" && sbc_model != "visionfive2q" &&
sbc_model != "rock5b" && sbc_model != "rock5bq" && sbc_model != "rock5b-v1.3") {
translate([width-2*(wallthick+gap)-sidethick-adj,depth-wallthick-gap-10,
floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
translate([-wallthick-gap-adj-6,depth-wallthick-gap-10,
floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
translate([width-3.5-(2*wallthick)-gap-.6,depth-wallthick-gap-10,
floorthick+3.4])rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
translate([-gap+.6,depth-wallthick-gap-10,floorthick+3.4])
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
else {
if(sbc_model == "visionfive2" || sbc_model == "visionfive2q" || sbc_model == "rock5b" ||
sbc_model == "rock5bq" || sbc_model == "rock5b-v1.3") {
translate([width-3*(wallthick+gap)-adj,wallthick+gap+58,
floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
translate([-wallthick-gap-adj-6,wallthick+gap+58,
floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
translate([width-3.5-(2*wallthick)-gap-.6,wallthick+gap+58,
floorthick+3.4])rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
translate([-gap+.6,wallthick+gap+58,floorthick+3.4])
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
else {
translate([width-3*(wallthick+gap)-adj,wallthick+gap+40,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([-wallthick-gap-adj-6,wallthick+gap+40,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([width-3.5-(2*wallthick)-gap-.6,wallthick+gap+40,
floorthick+3.4])rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
translate([-gap+.6,wallthick+gap+40,floorthick+3.4])
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
}
}
// pcb standoff holes
if(sbc_bottom_standoffs == true && bottom_standoff[5] != 4) {
// tray side attachment holes
if(case_design == "tray" || case_design == "tray_vu5" || case_design == "tray_vu7" || case_design == "tray_sides") {
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,33 +313,163 @@ 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") {
if((pcbhole_y <= 10 && pcbhole_x <= 10) || (ext_bottom_standoffs == true && ext_bottom_rear_left_enable == true)) {
translate([-wallthick-gap-adj-6,wallthick+gap+10,floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
translate([-gap+.6,wallthick+gap+10,floorthick+3.4]) rotate([90,0,90])
cylinder(d=6.6, h=3.5, $fn=6);
}
else {
translate([-wallthick-gap-adj-6,wallthick+gap+2,floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
translate([-gap+.6,wallthick+gap+2,floorthick+3.4]) rotate([90,0,90])
cylinder(d=6.6, h=3.5, $fn=6);
}
}
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_front") {
if((pcbhole_y >= pcb_depth+case_offset_y-10 && pcbhole_x <= 10) || (ext_bottom_standoffs == true && ext_bottom_front_left_enable == true)) {
translate([-wallthick-gap-adj-6,wallthick-gap+pcb_depth+case_offset_y-14,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([-gap+.6,wallthick-gap+pcb_depth+case_offset_y-14,floorthick+3.4])
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
else {
echo(pcb_depth+case_offset_y-10);
translate([-wallthick-gap-adj-6,wallthick+gap+pcb_depth+case_offset_y-8,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([-gap+.6,wallthick+gap+pcb_depth+case_offset_y-8,floorthick+3.4])
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
}
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_rear") {
if((pcbhole_y <= 10 && pcbhole_x >= pcb_width-10) || (ext_bottom_standoffs == true && ext_bottom_rear_right_enable == true)) {
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,floorthick+3.4])
rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([width-3.5-(2*wallthick)-gap-.6,wallthick+gap+10,floorthick+3.4])
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
else {
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+2,floorthick+3.4])
rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([width-3.5-(2*wallthick)-gap-.6,wallthick+gap+2,floorthick+3.4])
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
}
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_front") {
if((pcbhole_y >= pcb_depth+case_offset_y-10 && pcbhole_x >= width-10) || (ext_bottom_standoffs == true && ext_bottom_front_right_enable == true)) {
translate([width-3*(wallthick+gap)-adj,wallthick-gap+pcb_depth+case_offset_y-14,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([width-3.5-(2*wallthick)-gap-.6,wallthick-gap+pcb_depth+case_offset_y-14,
floorthick+3.4])rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
else {
translate([width-3*(wallthick+gap)-adj,wallthick-gap+pcb_depth+case_offset_y-8,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([width-3.5-(2*wallthick)-gap-.6,wallthick-gap+pcb_depth+case_offset_y-8,
floorthick+3.4])rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
}
}
}
}
// pcb standoff holes
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];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
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 && pcbhole_pos == "left_rear" &&
bottom_rear_left_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=bottom_standoff[4]-.2, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_front" &&
bottom_front_left_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=bottom_standoff[4]-.2, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_rear" &&
bottom_rear_right_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=bottom_standoff[4]-.2, h=bottom_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_front" &&
bottom_front_right_enable == true && bottom_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,-1]) cylinder(d=bottom_standoff[4]-.2, h=bottom_height);
}
}
}
// extended standoff holes
if(case_ext_standoffs == true) {
if(ext_bottom_standoffs == true) {
// right-rear standoff
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
translate([width-(2*(wallthick+gap))-(c_fillet/2),(c_fillet/2),-1]) cylinder(d=6.5, h=bottom_height);
if(((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10)) &&
ext_bottom_rear_right_enable == true && ext_bottom_standoff[6] != "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=ext_bottom_standoff[4]-.2, h=bottom_height);
}
// right-front standoff
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10) || width-pcb_loc_x-pcb_width >= 10) {
translate([width-(c_fillet/2)-(2*(wallthick+gap)),
depth-(c_fillet/2)-(2*(wallthick+gap)),-1]) cylinder(d=6.5, h=bottom_height);
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)) &&
ext_bottom_front_right_enable == true && ext_bottom_standoff[6] != "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=ext_bottom_standoff[4]-.2, h=bottom_height);
}
// left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
translate([(c_fillet/2),(c_fillet/2),-1]) cylinder(d=6.5, h=bottom_height);
if((pcb_loc_x >= 10 || pcb_loc_y >= 10) && ext_bottom_rear_left_enable == true && ext_bottom_standoff[6] != "blind") {
translate([(corner_fillet/2)+ext_bottom_standoff_support_size/4,
(corner_fillet/2)+ext_bottom_standoff_support_size/4,-1]) cylinder(d=ext_bottom_standoff[4]-.2, h=bottom_height);
}
// left-front standoff
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
translate([(c_fillet/2),depth-(c_fillet/2)-(2*(wallthick+gap)),-1])
cylinder(d=6.5, h=bottom_height);
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 && ext_bottom_standoff[6] != "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=ext_bottom_standoff[4]-.2, h=bottom_height);
}
}
// bottom cover pattern
if(bottom_cover_pattern != "solid") {
if(bottom_cover_pattern == "hex_5mm") {
translate([1,0,-2]) vent_hex((width)/3.75,(depth)/6,floorthick+4,5,1.5,"horizontal");
}
if(bottom_cover_pattern == "hex_8mm") {
translate([1,2,-2]) vent_hex((width)/5.5,(depth)/9.5,floorthick+4,8,1.5,"horizontal");
}
if(bottom_cover_pattern == "linear_vertical") {
translate([0,-gap,-2]) vent(wallthick,depth-2*wallthick-gap,floorthick+4,1,1,(width-2*wallthick-gap)/4,"horizontal");
}
if(bottom_cover_pattern == "linear_horizontal") {
translate([-gap,-gap,-2]) vent(width-2*wallthick-gap,wallthick,floorthick+4,1,(depth-2*wallthick-gap)/3,1,"horizontal");
}
if(bottom_cover_pattern == "astroid") {
for(c=[3:12:depth-8]) {
for(r=[4:12:width-8]) {
translate([r,c,-4]) linear_extrude(floorthick+5) import("./dxf/astroid_8mm.dxf");
}
}
}
}
// rear io shield opening for standard form motherboards
if(rear_io_shield == true) {
if(sbc_model == "mini-stx_thin") {
translate([6.2+pcb_loc_x,-4.5,-4.65+bottom_height-pcb_z+pcb_loc_z]) cube([123.95, 10+pcb_loc_y, 25]);
}
if(sbc_model == "mini-stx") {
translate([6.2+pcb_loc_x,-4.5,-4.65+bottom_height-pcb_z+pcb_loc_z]) cube([123.95, 10+pcb_loc_y, 40]);
}
if(sbc_model == "mini-itx_thin") {
translate([-2.62+pcb_loc_x,-4.5,-2.25+bottom_height-pcb_z+pcb_loc_z]) cube([158.75, 10+pcb_loc_y, 25]);
}
if(sbc_model != "mini-stx_thin" && sbc_model != "mini-stx" && sbc_model != "mini-itx_thin") {
translate([-2.62+pcb_loc_x,-4.5,-2.25+bottom_height-pcb_z+pcb_loc_z]) cube([158.75, 10+pcb_loc_y, 44]);
}
}
}
@@ -385,159 +485,166 @@ 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") {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_left,
bottom_standoff[2],
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) {
bottom_support = bottom_sidewall_support == true ? bottom_rear_left_support : "none";
pcb_standoff = [bottom_standoff[0],
bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_left_adjust,
bottom_standoff[3],
bottom_standoff[4],
bottom_standoff[5],
bottom_standoff[6],
bottom_standoff[7],
bottom_standoff[8],
bottom_support,
bottom_standoff[9],
bottom_standoff[10]];
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
bottom_standoff[10],
bottom_standoff[11],
bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0]) standoff(pcb_standoff,[false,10,2,"default"]);
}
if (pcbhole_pos == "left_front") {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_front_left,
bottom_standoff[2],
if (pcbhole_pos == "left_front" && bottom_front_left_enable == true) {
bottom_support = bottom_sidewall_support == true ? bottom_front_left_support : "none";
pcb_standoff = [bottom_standoff[0],
bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+bottom_front_left_adjust,
bottom_standoff[3],
bottom_standoff[4],
bottom_standoff[5],
bottom_standoff[6],
bottom_standoff[7],
bottom_standoff[8],
bottom_support,
bottom_standoff[9],
bottom_standoff[10]];
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
bottom_standoff[10],
bottom_standoff[11],
bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0]) standoff(pcb_standoff,[false,10,2,"default"]);
}
if (pcbhole_pos == "right_rear") {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_right,
bottom_standoff[2],
if (pcbhole_pos == "right_rear" && bottom_rear_right_enable == true) {
bottom_support = bottom_sidewall_support == true ? bottom_rear_right_support : "none";
pcb_standoff = [bottom_standoff[0],
bottom_standoff[1],
bottom_height-pcb_z+pcb_loc_z+bottom_rear_right_adjust,
bottom_standoff[3],
bottom_standoff[4],
bottom_standoff[5],
bottom_standoff[6],
bottom_standoff[7],
bottom_standoff[8],
bottom_support,
bottom_standoff[9],
bottom_standoff[10]];
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
bottom_standoff[10],
bottom_standoff[11],
bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0]) standoff(pcb_standoff,[false,10,2,"default"]);
}
if (pcbhole_pos == "right_front") {
normal_standoff = [bottom_standoff[0],
bottom_height-pcb_z+pcb_loc_z+bottom_front_right,
bottom_standoff[2],
if (pcbhole_pos == "right_front" && bottom_front_right_enable == true) {
bottom_support = bottom_sidewall_support == true ? bottom_front_right_support : "none";
pcb_standoff = [bottom_standoff[0],
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_standoff[8],
bottom_support,
bottom_standoff[9],
bottom_standoff[10]];
translate([pcbhole_x,pcbhole_y,0]) standoff(normal_standoff);
bottom_standoff[10],
bottom_standoff[11],
bottom_standoff[12]];
translate([pcbhole_x,pcbhole_y,0]) standoff(pcb_standoff,[false,10,2,"default"]);
}
}
}
}
// extended standoffs
if(case_ext_standoffs == true) {
// right-rear standoff
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
translate([width-(2*(wallthick+gap))-(c_fillet/2),(c_fillet/2),0]) standoff(bottom_ext_standoff);
if(ext_bottom_standoffs == true) {
// extended right-rear standoff
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) && ext_bottom_rear_right_enable == true) {
extended_standoff = [ext_bottom_standoff[0],
ext_bottom_standoff[1],
bottom_height+ext_bottom_rear_right_adjust,
ext_bottom_standoff[3],
ext_bottom_standoff[4],
ext_bottom_standoff[5],
ext_bottom_standoff[6],
ext_bottom_standoff[7],
ext_bottom_rear_right_support,
ext_bottom_standoff[9],
ext_bottom_standoff[10],
ext_bottom_standoff[11],
ext_bottom_standoff[12]];
translate([width-ext_top_standoff_support_size/4-(2*(wallthick+gap))-(corner_fillet/2),
(corner_fillet/2)+ext_top_standoff_support_size/4,0]) standoff(extended_standoff,[false,10,2,"default"]);
}
// right-front standoff
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10) || width-pcb_loc_x-pcb_width >= 10) {
translate([width-(c_fillet/2)-(2*(wallthick+gap)),
depth-(c_fillet/2)-(2*(wallthick+gap)),0]) standoff(bottom_ext_standoff);
// extended right-front standoff
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)) &&
ext_bottom_front_right_enable == true) {
extended_standoff = [ext_bottom_standoff[0],
ext_bottom_standoff[1],
bottom_height+ext_bottom_front_right_adjust,
ext_bottom_standoff[3],
ext_bottom_standoff[4],
ext_bottom_standoff[5],
ext_bottom_standoff[6],
ext_bottom_standoff[7],
ext_bottom_front_right_support,
ext_bottom_standoff[9],
ext_bottom_standoff[10],
ext_bottom_standoff[11],
ext_bottom_standoff[12]];
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)),0]) standoff(extended_standoff,[false,10,2,"default"]);
}
// left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
translate([(c_fillet/2),(c_fillet/2),0]) standoff(bottom_ext_standoff);
// extended left-rear standoff
if((pcb_loc_x >= 10 || pcb_loc_y >= 10) && ext_bottom_rear_left_enable == true) {
extended_standoff = [ext_bottom_standoff[0],
ext_bottom_standoff[1],
bottom_height+ext_bottom_rear_left_adjust,
ext_bottom_standoff[3],
ext_bottom_standoff[4],
ext_bottom_standoff[5],
ext_bottom_standoff[6],
ext_bottom_standoff[7],
ext_bottom_rear_left_support,
ext_bottom_standoff[9],
ext_bottom_standoff[10],
ext_bottom_standoff[11],
ext_bottom_standoff[12]];
translate([(corner_fillet/2)+ext_top_standoff_support_size/4,
(corner_fillet/2)+ext_top_standoff_support_size/4,0]) standoff(extended_standoff,[false,10,2,"default"]);
}
// left-front standoff
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
translate([(c_fillet/2),depth-(c_fillet/2)-(2*(wallthick+gap)),0])
standoff(bottom_ext_standoff);
}
}
// standoff sidewall support
if(sidewall_support == true && 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];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcb_side_pos = sbc_data[s[0]][i+10][2];
pcbhole_pos = sbc_data[s[0]][i+10][4];
ex_stand = 0;
if (class == "pcbhole" && id == pcb_id && (pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" ||
pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
ex_stand = pcbhole_pos == "left_rear" ? bottom_rear_left :
pcbhole_pos == "left_front" ? bottom_front_left :
pcbhole_pos == "right_rear" ? bottom_rear_right :
pcbhole_pos == "right_front" ? bottom_front_right : 0;
if(pcb_side_pos == "rear") {
translate([pcbhole_x-1, pcbhole_y-(bottom_standoff[0]/2)-(gap-adj)-1.4, 0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
}
if(pcb_side_pos == "front") {
translate([pcbhole_x-1, pcbhole_y+(bottom_standoff[0]/2)-.6+adj,0])
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
}
if(pcb_side_pos == "left") {
translate([pcbhole_x-(bottom_standoff[0]/2)-2.4+adj,pcbhole_y-1,0])
cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
}
if(pcb_side_pos == "right") {
translate([pcbhole_x+(bottom_standoff[0]/2)-.6+adj,pcbhole_y-1,0])
cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+ex_stand]);
}
}
}
}
// extended standoff sidewall support
if(case_ext_standoffs == true && sidewall_support == true) {
// right-rear standoff
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
translate([width-(2*(wallthick+gap))-(c_fillet/2)+(bottom_ext_standoff[0]/2)-.5,
(c_fillet/2)-1,0]) cube([gap+adj+2,2,bottom_ext_standoff[1]]);
}
// right-front standoff
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10)
|| width-pcb_loc_x-pcb_width >= 10) {
translate([width-(2*(wallthick+gap))-(c_fillet/2)+(bottom_ext_standoff[0]/2)-.5,
depth-(c_fillet/2)-(2*(wallthick+gap))-1,0])
cube([gap+adj+2,2,bottom_ext_standoff[1]]);
}
// left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
translate([(c_fillet/2)-(wallthick+gap)-(bottom_ext_standoff[0]/2)+.6,
(c_fillet/2)-1,0]) cube([gap+adj+2,2,bottom_ext_standoff[1]]);
}
// left-front standoff
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
translate([(c_fillet/2)-(wallthick+gap)-(bottom_ext_standoff[0]/2)+.6,
depth-(c_fillet/2)-(2*(wallthick+gap))-1,0])
cube([gap+adj+2,2,bottom_ext_standoff[1]]);
// 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)) &&
ext_bottom_front_left_enable == true) {
extended_standoff = [ext_bottom_standoff[0],
ext_bottom_standoff[1],
bottom_height+ext_bottom_front_left_adjust,
ext_bottom_standoff[3],
ext_bottom_standoff[4],
ext_bottom_standoff[5],
ext_bottom_standoff[6],
ext_bottom_standoff[7],
ext_bottom_front_left_support,
ext_bottom_standoff[9],
ext_bottom_standoff[10],
ext_bottom_standoff[11],
ext_bottom_standoff[12]];
translate([(corner_fillet/2)+ext_top_standoff_support_size/4,
depth-ext_top_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)),0])
standoff(extended_standoff,[false,10,2,"default"]);
}
}
}
// subtractive accessories
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -546,106 +653,63 @@ module case_bottom(case_design) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size_x = accessory_data[a[0]][i+8][0];
size_y = accessory_data[a[0]][i+8][1];
size_z = accessory_data[a[0]][i+8][2];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if ((class == "sub" && face == "bottom") || class == "suball") {
if(accessory_highlight == false) {
parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric,
[size_x,size_y,size_z],data, mask);
}
else {
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
[size_x,size_y,size_z],data, mask);
}
}
// create openings for additive
if (class == "add2" && face == "bottom" && type == "standoff") {
parametric_move_sub("round",loc_x,loc_y,loc_z-.1,face,rotation,parametric,
6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
}
if ((class == "add1" || class == "add2") && type == "uart_holder") {
if ((class == "add1" || class == "add2" || class == "model") && mask[0] == true) {
if(accessory_highlight == false) {
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
0,0,0,data_1,data_2,data_3,data_4);
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,[true,mask[1],mask[2],mask[3]]);
}
else {
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
0,0,0,data_1,data_2,data_3,data_4);
#parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,[true,mask[1],mask[2],mask[3]]);
}
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+25.5,face,rotation,parametric,
26.5,wallthick+gap+4,15,data_1,data_2,data_3,[.1,.1,.1,.1]);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "access_port") {
if(data_3 == "landscape") {
if(rotation[2] == 180) {
parametric_move_sub("rectangle",loc_x-6+size_x,loc_y+.5+size_y,loc_z-adj,face,rotation,
parametric,size_x-17,size_y-1,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
parametric_move_sub("rectangle",loc_x-size_x+12.5+size_x,loc_y-(size_y/2)+6+size_y,loc_z-adj,
face,rotation,parametric,5.5,10.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
}
else {
parametric_move_sub("rectangle",loc_x+6,loc_y-.5,loc_z-adj,face,rotation,
parametric,size_x-17,size_y-1,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
parametric_move_sub("rectangle",loc_x+size_x-12.5,loc_y+(size_y/2)-6,loc_z-adj,face,rotation,
parametric,5.5,10.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
}
}
}
else {
if(rotation[2] == 180) {
if(data_3 == "portrait") {
parametric_move_sub("rectangle",loc_x+size_x-.5,loc_y+size_y-5.75,loc_z-adj,face,
rotation,parametric,size_x-1,size_y-17,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
parametric_move_sub("rectangle",loc_x-(size_x/2)+5+size_x,loc_y-size_y+12.5+size_y,
loc_z-adj,face,rotation,parametric,10.5,5.5,floorthick+.12,data_1,data_2,data_3,
[5.5,5.5,5.5,5.5]);
}
else {
parametric_move_sub("rectangle",loc_x-.5,loc_y-5.75,loc_z-adj,face,rotation,
parametric,size_x-1,size_y-17,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
parametric_move_sub("rectangle",loc_x-(size_x/2)+5,loc_y-size_y+12.5,loc_z-adj,face,
rotation,parametric,10.5,5.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
}
}
else {
parametric_move_sub("rectangle",loc_x+.5,loc_y+5.75,loc_z-adj,face,rotation,
parametric,size_x-1,size_y-17,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
parametric_move_sub("rectangle",loc_x+(size_x/2)-5,loc_y+size_y-12.5,loc_z-adj,face,rotation,
parametric,10.5,5.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
}
}
}
if ((class == "model") && face == "bottom" && type == "h2_netcard") {
parametric_move_sub("rectangle",loc_x+25,loc_y-6,loc_z-14,face,rotation,
parametric,68.5,wallthick+3,14.5,data_1,data_2,data_3,[1,1,1,1]);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
if(data_3 == "recess") {
#parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
parametric,size_x-1,size_y,size_z,data_1,data_2,data_3,0);
}
if(data_3 == "cutout") {
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
parametric,size_x+2,size_y+1,size_z+2*adj,data_1,data_2,data_3,[.1,.1,.1,.1]);
}
}
}
// ui access panel
if(bottom_access_panel_enable == true) {
if(access_panel_rotation == 0) {
translate([access_panel_location[0],access_panel_location[1], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [true,10,2,"default"]);
}
if(access_panel_rotation == 90) {
translate([access_panel_location[0]+access_panel_size[1],access_panel_location[1], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [true,10,2,"default"]);
}
if(access_panel_rotation == 180) {
translate([access_panel_location[0]+access_panel_size[0],access_panel_location[1]+access_panel_size[1],0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [true,10,2,"default"]);
}
if(access_panel_rotation == 270) {
translate([access_panel_location[0],access_panel_location[1]+access_panel_size[0], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [true,10,2,"default"]);
}
}
// sbc openings
if(sbc_highlight == true) {
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj])
sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
}
else {
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj])
sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
}
// indents
if(indents == true) {
@@ -660,6 +724,7 @@ module case_bottom(case_design) {
side = sbc_data[s[0]][i+7];
rotation = sbc_data[s[0]][i+8];
// indent(loc_x, loc_y, bottom_height+pcb_loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z);
indent(loc_x, loc_y, bottom_height+pcb_loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z);
}
}
@@ -667,13 +732,13 @@ module case_bottom(case_design) {
if(case_design == "shell") {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,bottom_height/2])
cube_negative_fillet([width,depth,bottom_height], radius=-1,
vertical=[c_fillet,c_fillet,c_fillet,c_fillet], top=[0,0,0,0],
bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet], top=[0,0,0,0],
bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
}
}
// additive accessories
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -682,18 +747,32 @@ module case_bottom(case_design) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size = accessory_data[a[0]][i+8];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if(class == "add2" && face == "bottom") {
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric, size, data, [false,mask[1],mask[2],mask[3]]);
}
}
}
// ui access port
if(bottom_access_panel_enable == true) {
if(access_panel_rotation == 0) {
translate([access_panel_location[0],access_panel_location[1], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [false,10,2,"default"]);
}
if(access_panel_rotation == 90) {
translate([access_panel_location[0]+access_panel_size[1],access_panel_location[1], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [false,10,2,"default"]);
}
if(access_panel_rotation == 180) {
translate([access_panel_location[0]+access_panel_size[0],access_panel_location[1]+access_panel_size[1],0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [false,10,2,"default"]);
}
if(access_panel_rotation == 270) {
translate([access_panel_location[0],access_panel_location[1]+access_panel_size[0], 0]) rotate([0,0,access_panel_rotation])
access_panel([access_panel_size[0],access_panel_size[1],floorthick], access_panel_orientation, [false,10,2,"default"]);
}
}
}

292
mod/case_folded.scad Normal file
View File

@@ -0,0 +1,292 @@
/*
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
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: case_folded
DESCRIPTION: creates folded case flat blanks for supported designs
TODO: none
USAGE: case_folded(case_design)
case_design = paper_full-top, paper_split-top
*/
module case_folded(case_design) {
section_position = 2;
ba = bend_allowance;
slit_len = pcb_depth < pcb_width ? pcb_depth/10 : pcb_width/10;
slit_width = material_thickness;
slit_offset = pcb_depth < pcb_width ? pcb_depth/10 : pcb_width/10;
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") {
// 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/2)-ba, 0])
cube([pcb_width, (pcb_depth/2)+ba, material_thickness]);
translate([0, pcb_depth+fold_height, 0])
cube([pcb_width, (pcb_depth/2)+ba, material_thickness]);
// 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+material_thickness]) rotate([180, 0, 0])
sbc(sbc_model, cooling, 0, "disable", "disable", true);
translate([0, 2*pcb_depth+fold_height, pcb_tmaxz+2+material_thickness]) rotate([180, 0, 0])
sbc(sbc_model, cooling, 0, "disable", "disable", true);
}
translate([0, -fold_height-(pcb_depth/2)-ba, 0]) cube([pcb_width, 2, material_thickness]);
translate([0, pcb_depth+fold_height+(pcb_depth/2)-ba, 0]) cube([pcb_width, 2, material_thickness]);
}
if(case_design == "paper_full-top") {
// 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+material_thickness]) rotate([180, 0, 0])
sbc(sbc_model, cooling, 0, "disable", "disable", true);
translate([0, 2*pcb_depth+fold_height, pcb_tmaxz+2+material_thickness]) 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-slit_width, -adj])
cube([slit_len, slit_width, material_thickness+(2*adj)]);
translate([pcb_width/2-slit_len/2, pcb_depth+fold_height-slit_width, -adj])
cube([slit_len, slit_width, material_thickness+(2*adj)]);
translate([pcb_width-slit_offset-slit_len, pcb_depth+fold_height-slit_width, -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)]);
}
}

View File

@@ -20,11 +20,11 @@
DESCRIPTION: creates case side for supported designs and styles
TODO: none
USAGE: case_side(case_design, case_style, side)
USAGE: case_side(case_design, side)
*/
module case_side(case_design, case_style, side) {
module case_side(case_design, side) {
difference() {
union() {
@@ -128,7 +128,7 @@ module case_side(case_design, case_style, side) {
}
}
}
if(case_design == "tray" && case_style == "sides") {
if(case_design == "tray_sides") {
if(side == "right") {
difference() {
union() {
@@ -186,19 +186,19 @@ module case_side(case_design, case_style, side) {
}
}
}
if(case_design == "tray" && case_style == "vu5") {
if(case_design == "tray_vu5") {
cheight = case_z+90;
vesa = 75;
vu_holder(case_style,side,vesa,cheight);
vu_holder("vu5",side,vesa,cheight);
}
if(case_design == "tray" && case_style == "vu7") {
if(case_design == "tray_vu7") {
cheight = case_z+122;
vesa = 100;
vu_holder(case_style,side,vesa,cheight);
vu_holder("vu7",side,vesa,cheight);
}
// additive accessories
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -207,23 +207,19 @@ module case_side(case_design, case_style, side) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size = accessory_data[a[0]][i+8];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if (class == "add1" && face == side) {
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,size,data,[false,mask[1],mask[2],mask[3]]);
}
}
}
}
// subtractive accessories
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -232,90 +228,41 @@ module case_side(case_design, case_style, side) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size_x = accessory_data[a[0]][i+8][0];
size_y = accessory_data[a[0]][i+8][1];
size_z = accessory_data[a[0]][i+8][2];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if ((class == "sub" && face == side) || class == "suball") {
if(accessory_highlight == false) {
parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
[size_x,size_y,size_z],data,mask);
}
else {
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
[size_x,size_y,size_z],data,mask);
}
}
// create openings for additive
if ((class == "sub" && face == "bottom") || class == "suball") {
if((class == "add1" || class == "add2" || class == "model") && mask[0] == true) {
if(accessory_highlight == false) {
parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,mask);
}
else {
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
}
}
// create openings for additive
if (class == "add2" && face == "bottom" && type == "standoff") {
parametric_move_sub("round",loc_x,loc_y,-.1,face,rotation,parametric,
6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
if(accessory_highlight == false) {
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
0,0,0,data_1,data_2,data_3,data_4);
}
else {
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
0,0,0,data_1,data_2,data_3,data_4);
}
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+25.5,face,rotation,
parametric,26.5,wallthick+gap+4,15,data_1,data_2,data_3,[.1,.1,.1,.1]);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "access_port") {
if(data_3 == "landscape") {
parametric_move_sub("rectangle",loc_x+6,loc_y-.5,loc_z-adj,face,rotation,
parametric,size_x-17,size_y-1,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
parametric_move_sub("rectangle",loc_x+size_x-12.5,loc_y+(size_y/2)-6,loc_z-adj,face,rotation,
parametric,5.5,10.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
}
else {
parametric_move_sub("rectangle",loc_x+.5,loc_y+5.75,loc_z-adj,face,rotation,parametric,
size_x-1,size_y-17,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
parametric_move_sub("rectangle",loc_x+(size_x/2)-5,loc_y+size_y-12.5,loc_z-adj,face,rotation,
parametric,10.5,5.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
}
}
if ((class == "model") && face == "bottom" && type == "h2_netcard") {
parametric_move_sub("rectangle",loc_x+25,loc_y-6,loc_z-14,face,rotation,
parametric,68.5,wallthick+3,14.5,data_1,data_2,data_3,[1,1,1,1]);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
if(data_3 == "recess") {
parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
parametric,size_x-1,size_y,size_z,data_1,data_2,data_3,0);
}
if(data_3 == "cutout") {
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
parametric,size_x+2,size_y+1,size_z+2*adj,data_1,data_2,data_3,[.1,.1,.1,.1]);
#parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,mask);
}
}
}
}
// sbc openings
if(sbc_highlight == true) {
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj-adj])
sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
}
else {
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj-adj])
sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
}
// indents
if(indents == true) {
@@ -335,7 +282,7 @@ module case_side(case_design, case_style, side) {
}
}
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -344,17 +291,12 @@ module case_side(case_design, case_style, side) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size = accessory_data[a[0]][i+8];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if (class == "add2" && face == side) {
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,size,data,[false,mask[1],mask[2],mask[3]]);
}
}
}

View File

@@ -26,6 +26,12 @@
module case_top(case_design) {
lip = 5;
vu_rotation = [15,0,0];
case_fn = 360; // circle segments for round cases
case_ffn = 90; // circle segments for fillet of round cases
adj = .01;
difference() {
union() {
difference() {
@@ -35,14 +41,14 @@ module case_top(case_design) {
translate([(width/2)-wallthick-gap,
(depth/2)-wallthick-gap,bottom_height+(top_height/2)])
cube_fillet_inside([width,depth,top_height],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[fillet,fillet,fillet,fillet,fillet],
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet],
bottom=[0,0,0,0], $fn=90);
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,
bottom_height+(top_height/2)-floorthick])
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),top_height],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
top=[fillet,fillet,fillet,fillet,fillet],
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],
top=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet],
bottom=[0,0,0,0], $fn=90);
}
}
@@ -68,51 +74,74 @@ module case_top(case_design) {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,
case_z-(floorthick/2)])
cube_fillet_inside([width-(2*wallthick),depth-(2*wallthick),floorthick],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
}
if(case_design == "tray" && (case_style == "vu5" || case_style == "vu7" || case_style == "sides")) {
if(case_design == "tray_vu5" || case_design == "tray_vu7" || case_design == "tray_sides") {
translate([-wallthick-gap+.5,-wallthick-gap,case_z])
cube([width-1,depth,floorthick]);
translate([-wallthick-gap+.5,-wallthick-gap,
case_z-floorthick+adj]) cube([width-1,wallthick,wallthick]);
}
if(case_design == "tray" && case_style == "none") {
if(case_design == "tray") {
difference() {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z/2])
cube_fillet_inside([width+2*wallthick+1,depth,case_z],
vertical=[0,0,0,0], top=[0,fillet,0,fillet,fillet],
vertical=[0,0,0,0], top=[0,edge_fillet,0,edge_fillet,edge_fillet],
bottom=[0,0,0,0], $fn=90);
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,(case_z/2)-floorthick+.25])
cube_fillet_inside([width+1,depth+(wallthick*2),case_z],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],
top=[0,0,0,0],bottom=[0,0,0,0], $fn=90);
// right side bottom attachment hole
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
// left side bottom attachment hole
translate([-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
if(depth >= 75 && sbc_model != "visionfive2" && sbc_model != "visionfive2q" &&
sbc_model != "rock5b" && sbc_model != "rock5bq" && sbc_model != "rock5b-v1.3") {
translate([width-2*(wallthick+gap)-sidethick-adj,depth-wallthick-gap-10,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([-wallthick-gap-adj-6,depth-wallthick-gap-10,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
}
else {
if(sbc_model == "visionfive2" || sbc_model == "visionfive2q" || sbc_model == "rock5b" ||
sbc_model == "rock5bq" || sbc_model == "rock5b-v1.3") {
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+58,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([-wallthick-gap-adj-6,wallthick+gap+58,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
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]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
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 && pcbhole_pos == "left_rear") {
if((pcbhole_y <= 10 && pcbhole_x <= 10) || (ext_top_standoffs == true && ext_top_rear_left_enable == true)) {
translate([-wallthick-gap-adj-6,wallthick+gap+10,floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
}
else {
translate([-wallthick-gap-adj-6,wallthick+gap+2,floorthick+3.4]) rotate([0,90,0])
cylinder(d=3, h=10+sidethick+(2*adj));
}
}
else {
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+40,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
translate([-wallthick-gap-adj-6,wallthick+gap+40,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_front") {
if((pcbhole_y >= pcb_depth+case_offset_y-10 && pcbhole_x <= 10) || (ext_top_standoffs == true && ext_top_front_left_enable == true)) {
translate([-wallthick-gap-adj-6,wallthick-gap+pcb_depth+case_offset_y-14,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
}
else {
translate([-wallthick-gap-adj-6,wallthick+gap+pcb_depth+case_offset_y-8,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
}
}
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_rear") {
if((pcbhole_y <= 10 && pcbhole_x >= pcb_width-10) || (ext_top_standoffs == true && ext_top_rear_right_enable == true)) {
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,floorthick+3.4])
rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
}
else {
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+2,floorthick+3.4])
rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
}
}
if(class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_front") {
if((pcbhole_y >= pcb_depth+case_offset_y-10 && pcbhole_x >= width-10) || (ext_bottom_standoffs == true && ext_bottom_front_right_enable == true)) {
translate([width-3*(wallthick+gap)-adj,wallthick-gap+pcb_depth+case_offset_y-14,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
}
else {
translate([width-3*(wallthick+gap)-adj,wallthick-gap+pcb_depth+case_offset_y-8,
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
}
}
}
}
@@ -121,13 +150,13 @@ module case_top(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-lip/2]) rotate([0,0,30])
cylinder_fillet_inside(h=top_height+lip, r=case_diameter/2,
top=fillet, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
top=edge_fillet, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-floorthick-lip/2]) rotate([0,0,30])
cylinder_fillet_inside(h=top_height+lip, r=(case_diameter/2)-wallthick,
top=fillet-1, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
top=edge_fillet-1, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,bottom_height-adj-lip/2]) rotate([0,0,30])
cylinder_fillet_inside(h=lip+2*adj, r=(case_diameter/2)-wallthick/2+tol/2,
top=fillet-1, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
top=edge_fillet-1, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
// io cutout
if(width/depth >= 1.4 && sbc_model != "vim1" && sbc_model != "vim2" &&
sbc_model != "vim3l" && sbc_model != "vim3" && sbc_model != "vim4" &&
@@ -160,13 +189,13 @@ module case_top(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-lip/2]) rotate([0,0,30])
cylinder_fillet_inside(h=top_height+lip, r=case_diameter/2,
top=fillet, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
top=edge_fillet, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-floorthick-lip/2]) rotate([0,0,30])
cylinder_fillet_inside(h=top_height+lip, r=(case_diameter/2)-wallthick,
top=fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
top=edge_fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,bottom_height-adj-lip/2]) rotate([0,0,30])
cylinder_fillet_inside(h=lip+2*adj, r=(case_diameter/2)-wallthick/2+tol/2,
top=fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
top=edge_fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
// io cutout
translate([width,(depth/2)-wallthick-gap,bottom_height-lip+top_height/2-floorthick])
cube_fillet_inside([18,depth-2*(wallthick+gap)-1,top_height+lip+2],
@@ -177,13 +206,13 @@ module case_top(case_design) {
difference() {
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-lip/2]) rotate([0,0,0])
cylinder_fillet_inside(h=top_height+lip, r=hex_diameter/2,
top=fillet, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
top=edge_fillet, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-floorthick-lip/2])
rotate([0,0,0]) cylinder_fillet_inside(h=top_height+lip, r=(hex_diameter/2)-wallthick,
top=fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
top=edge_fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
translate([pcb_width/2,pcb_depth/2,bottom_height-adj-lip/2]) rotate([0,0,0])
cylinder_fillet_inside(h=lip+2*adj, r=(hex_diameter/2)-wallthick/2+tol/2,
top=fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
top=edge_fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
// io cutout
translate([(width/2)-wallthick-gap,-23,bottom_height-lip+top_height/2-floorthick])
cube_fillet_inside([width-2*(wallthick+gap),40,top_height+lip+2],
@@ -204,18 +233,18 @@ module case_top(case_design) {
if(case_design == "snap") {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,floorthick*1.5+case_z])
cube_fillet_inside([width,depth,floorthick],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[0,0,0,0],bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[0,0,0,0],bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
difference() {
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-adj])
cube_fillet_inside([width-2*wallthick-tol,depth-2*wallthick-tol,2*floorthick+1.5],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[0,0,0,0],bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[0,0,0,0],bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-adj])
cube_fillet_inside([width-(3*wallthick),depth-(3*wallthick),2*floorthick+1.5+adj],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],top=[0,0,0,0],
bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],top=[0,0,0,0],
bottom=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet], $fn=90);
}
// snap top outdent
difference() {
@@ -236,18 +265,18 @@ module case_top(case_design) {
translate([(width/2)-wallthick-gap,
(depth/2)-wallthick-gap,case_z+floorthick/2-(lip)/2])
cube_fillet_inside([width,depth,lip+floorthick],
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[fillet,fillet,fillet,fillet,fillet],
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet],
bottom=[0,0,0,0], $fn=90);
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-floorthick-1])
cube_fillet_inside([width-wallthick+tol,depth-wallthick+tol,lip+floorthick],
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
top=[fillet,fillet,fillet,fillet,fillet],
vertical=[corner_fillet-1,corner_fillet-1,corner_fillet-1,corner_fillet-1],
top=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet],
bottom=[0,0,0,0], $fn=90);
}
}
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -256,23 +285,18 @@ module case_top(case_design) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size = accessory_data[a[0]][i+8];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if (class == "add1" && face == "top") {
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,
parametric,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,size,data,[false,mask[1],mask[2],mask[3]]);
}
}
}
}
// 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,37 +307,95 @@ 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")) {
translate([pcbhole_x,pcbhole_y,top_height+1]) cylinder(d=6.5, h=top_height);
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_rear" && top_rear_left_enable == true &&
top_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,top_height+5]) cylinder(d=top_standoff[4]-.2, h=top_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "left_front" && top_front_left_enable == true &&
top_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,top_height+5]) cylinder(d=top_standoff[4]-.2, h=top_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_rear" && top_rear_right_enable == true &&
top_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,top_height+5]) cylinder(d=top_standoff[4]-.2, h=top_height);
}
if (class == "pcbhole" && id == pcb_id && pcbhole_pos == "right_front" && top_front_right_enable == true &&
top_standoff[6] != "blind") {
translate([pcbhole_x,pcbhole_y,top_height+5]) cylinder(d=top_standoff[4]-.2, h=top_height);
}
}
}
// extended standoff holes
if(case_ext_standoffs == true) {
if(ext_top_standoffs == true) {
// right-rear standoff
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
translate([width-(2*(wallthick+gap))-(c_fillet/2),(c_fillet/2),top_height+1])
cylinder(d=6.5, h=top_height);
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) &&
ext_top_rear_right_enable == true && ext_top_standoff[6] != "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+5]) cylinder(d=ext_top_standoff[4]-.2, h=top_height);
}
// right-front standoff
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10) || width-pcb_loc_x-pcb_width >= 10) {
translate([width-(c_fillet/2)-(2*(wallthick+gap)),
depth-(c_fillet/2)-(2*(wallthick+gap)),top_height+1]) cylinder(d=6.5, h=top_height);
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)) &&
ext_top_front_right_enable == true && ext_top_standoff[6] != "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+5])
cylinder(d=ext_top_standoff[4]-.2, h=top_height);
}
// left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
translate([(c_fillet/2),(c_fillet/2),top_height+1]) cylinder(d=6.5, h=top_height);
if((pcb_loc_x >= 10 || pcb_loc_y >= 10) && ext_top_rear_left_enable == true && ext_top_standoff[6] != "blind") {
translate([(corner_fillet/2)+ext_top_standoff_support_size/4,
(corner_fillet/2)+ext_top_standoff_support_size/4,top_height+5]) cylinder(d=ext_top_standoff[4]-.2, h=top_height);
}
// left-front standoff
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
translate([+(c_fillet/2),depth-(c_fillet/2)-(2*(wallthick+gap)),
top_height+1]) cylinder(d=6.5, h=top_height+1);
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_top_front_left_enable == true && ext_top_standoff[6] != "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+5])
cylinder(d=ext_top_standoff[4]-.2, h=top_height);
}
}
// top cover pattern
if(top_cover_pattern != "solid") {
if(top_cover_pattern == "hex_5mm") {
translate([1,0,case_z-2]) vent_hex((width)/3.75,(depth)/6,floorthick+4,5,1.5,"horizontal");
}
if(top_cover_pattern == "hex_8mm") {
translate([1,2,case_z-2]) vent_hex((width)/5.5,(depth)/9.5,floorthick+4,8,1.5,"horizontal");
}
if(top_cover_pattern == "linear_vertical") {
translate([0,-gap,case_z-2]) vent(wallthick,depth-2*wallthick-gap,floorthick+4,1,1,(width-2*wallthick-gap)/4,"horizontal");
}
if(top_cover_pattern == "linear_horizontal") {
translate([-gap,-gap,case_z-2]) vent(width-2*wallthick-gap,wallthick,floorthick+4,1,(depth-2*wallthick-gap)/3,1,"horizontal");
}
if(top_cover_pattern == "astroid") {
for(c=[3:12:depth-8]) {
for(r=[4:12:width-8]) {
translate([r,c,case_z-4]) linear_extrude(floorthick+5) import("./dxf/astroid_8mm.dxf");
}
}
}
}
// rear io shield opening for standard form motherboards
if(rear_io_shield == true) {
if(sbc_model == "mini-stx_thin") {
translate([6.2+pcb_loc_x,-4.5,-4.15+bottom_height-pcb_z+pcb_loc_z]) cube([123.95, 10+pcb_loc_y, 25]);
}
if(sbc_model == "mini-stx") {
translate([6.2+pcb_loc_x,-4.5,-4.15+bottom_height-pcb_z+pcb_loc_z]) cube([123.95, 10+pcb_loc_y, 40]);
}
if(sbc_model == "mini-itx_thin") {
translate([-2.62+pcb_loc_x,-4.5,-1.75+bottom_height-pcb_z+pcb_loc_z]) cube([158.75, 10+pcb_loc_y, 25]);
}
if(sbc_model != "mini-stx_thin" && sbc_model != "mini-stx" && sbc_model != "mini-itx_thin") {
translate([-2.62+pcb_loc_x,-4.5,-1.75+bottom_height-pcb_z+pcb_loc_z]) cube([158.75, 10+pcb_loc_y, 44]);
}
}
}
// pcb standoffs
if(sbc_top_standoffs == true) {
for (i=[1:11:len(sbc_data[s[0]])-2]) {
class = sbc_data[s[0]][i+1];
@@ -324,160 +406,166 @@ module case_top(case_design) {
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 &&
(pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" || pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
if (pcbhole_pos == "left_rear") {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_rear_left,
top_standoff[2],
if (pcbhole_pos == "left_rear" && top_rear_left_enable == true) {
top_support = top_sidewall_support == true ? top_rear_left_support : "none";
pcb_standoff = [top_standoff[0],
top_standoff[1],
top_height+top_rear_left_adjust-pcb_loc_z,
top_standoff[3],
top_standoff[4],
top_standoff[5],
top_standoff[6],
top_standoff[7],
top_standoff[8],
top_support,
top_standoff[9],
top_standoff[10]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
top_standoff[10],
top_standoff[11],
top_standoff[12]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(pcb_standoff,[false,10,2,"default"]);
}
if (pcbhole_pos == "left_front") {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_front_left,
top_standoff[2],
if (pcbhole_pos == "left_front" && top_front_left_enable == true) {
top_support = top_sidewall_support == true ? top_front_left_support : "none";
pcb_standoff = [top_standoff[0],
top_standoff[1],
top_height+top_front_left_adjust-pcb_loc_z,
top_standoff[3],
top_standoff[4],
top_standoff[5],
top_standoff[6],
top_standoff[7],
top_standoff[8],
top_support,
top_standoff[9],
top_standoff[10]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
top_standoff[10],
top_standoff[11],
top_standoff[12]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(pcb_standoff,[false,10,2,"default"]);
}
if (pcbhole_pos == "right_rear") {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_rear_right,
top_standoff[2],
if (pcbhole_pos == "right_rear" && top_rear_right_enable == true) {
top_support = top_sidewall_support == true ? top_rear_right_support : "none";
pcb_standoff = [top_standoff[0],
top_standoff[1],
top_height+top_rear_right_adjust-pcb_loc_z,
top_standoff[3],
top_standoff[4],
top_standoff[5],
top_standoff[6],
top_standoff[7],
top_standoff[8],
top_support,
top_standoff[9],
top_standoff[10]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
top_standoff[10],
top_standoff[11],
top_standoff[12]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(pcb_standoff,[false,10,2,"default"]);
}
if (pcbhole_pos == "right_front") {
normal_standoff = [top_standoff[0],
top_height+pcb_loc_z+top_front_right,
top_standoff[2],
if (pcbhole_pos == "right_front" && top_front_right_enable == true) {
top_support = top_sidewall_support == true ? top_front_right_support : "none";
pcb_standoff = [top_standoff[0],
top_standoff[1],
top_height+top_front_right_adjust-pcb_loc_z,
top_standoff[3],
top_standoff[4],
top_standoff[5],
top_standoff[6],
top_standoff[7],
top_standoff[8],
top_support,
top_standoff[9],
top_standoff[10]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(normal_standoff);
top_standoff[10],
top_standoff[11],
top_standoff[12]];
translate([pcbhole_x,pcbhole_y,case_z]) standoff(pcb_standoff,[false,10,2,"default"]);
}
}
}
}
// extended standoffs
if(case_ext_standoffs == true) {
// right-rear standoff
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
translate([width-(2*(wallthick+gap))-(c_fillet/2),(c_fillet/2),case_z])
standoff(top_ext_standoff);
if(ext_top_standoffs == true) {
// extended right-rear standoff
if((width-pcb_loc_x-pcb_width-(gap+2*wallthick) >= 10 || pcb_loc_y >= 10) && ext_top_rear_right_enable == true) {
extended_standoff = [ext_top_standoff[0],
ext_top_standoff[1],
top_height+ext_top_rear_right_adjust,
ext_top_standoff[3],
ext_top_standoff[4],
ext_top_standoff[5],
ext_top_standoff[6],
ext_top_standoff[7],
ext_top_rear_right_support,
ext_top_standoff[9],
ext_top_standoff[10],
ext_top_standoff[11],
ext_top_standoff[12]];
translate([width-ext_top_standoff_support_size/4-(2*(wallthick+gap))-(corner_fillet/2),
(corner_fillet/2)+ext_top_standoff_support_size/4,case_z]) standoff(extended_standoff,[false,10,2,"default"]);
}
// right-front standoff
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10)
|| width-pcb_loc_x-pcb_width >= 10) {
translate([width-(c_fillet/2)-(2*(wallthick+gap)),
depth-(c_fillet/2)-(2*(wallthick+gap)),case_z]) standoff(top_ext_standoff);
// extended right-front standoff
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)) &&
ext_top_front_right_enable == true) {
extended_standoff = [ext_top_standoff[0],
ext_top_standoff[1],
top_height+ext_top_front_right_adjust,
ext_top_standoff[3],
ext_top_standoff[4],
ext_top_standoff[5],
ext_top_standoff[6],
ext_top_standoff[7],
ext_top_front_right_support,
ext_top_standoff[9],
ext_top_standoff[10],
ext_top_standoff[11],
ext_top_standoff[12]];
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)),case_z])
standoff(extended_standoff,[false,10,2,"default"]);
}
// left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
translate([(c_fillet/2),(c_fillet/2),case_z]) standoff(top_ext_standoff);
// extended left-rear standoff
if((pcb_loc_x >= 10 || pcb_loc_y >= 10) && ext_top_rear_left_enable == true) {
extended_standoff = [ext_top_standoff[0],
ext_top_standoff[1],
top_height+ext_top_rear_left_adjust,
ext_top_standoff[3],
ext_top_standoff[4],
ext_top_standoff[5],
ext_top_standoff[6],
ext_top_standoff[7],
ext_top_rear_left_support,
ext_top_standoff[9],
ext_top_standoff[10],
ext_top_standoff[11],
ext_top_standoff[12]];
translate([(corner_fillet/2)+ext_top_standoff_support_size/4,
(corner_fillet/2)+ext_top_standoff_support_size/4,case_z]) standoff(extended_standoff,[false,10,2,"default"]);
}
// left-front standoff
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
translate([(c_fillet/2),depth-(c_fillet/2)-(2*(wallthick+gap)),
case_z]) standoff(top_ext_standoff);
}
}
// standoff sidewall support
if(sidewall_support == true && 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];
id = sbc_data[s[0]][i+3];
pcbhole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
pcbhole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
pcbhole_z = sbc_data[s[0]][i+6];
pcbhole_size = sbc_data[s[0]][i+9][0];
pcb_side_pos = sbc_data[s[0]][i+10][2];
pcbhole_pos = sbc_data[s[0]][i+10][4];
ex_stand = 0;
if (class == "pcbhole" && id == pcb_id && (pcbhole_pos == "left_rear" || pcbhole_pos == "left_front" ||
pcbhole_pos == "right_rear" || pcbhole_pos == "right_front")) {
ex_stand = pcbhole_pos == "left_rear" ? top_rear_left :
pcbhole_pos == "left_front" ? top_front_left :
pcbhole_pos == "right_rear" ? top_rear_right :
pcbhole_pos == "right_front" ? top_front_right : 0;
if(pcb_side_pos == "rear") {
translate([pcbhole_x-1, pcbhole_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_side_pos == "front") {
translate([pcbhole_x-1, pcbhole_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([pcbhole_x-(top_standoff[0]/2)-2.4+adj,pcbhole_y-1,case_z-top_height-ex_stand])
cube([gap+1.6,2,top_height+ex_stand]);
}
if(pcb_side_pos == "right") {
translate([pcbhole_x+(top_standoff[0]/2)-.6+adj,pcbhole_y-1,case_z-top_height-ex_stand])
cube([gap+1.6,2,top_height+ex_stand]);
}
}
}
}
// extended standoff sidewall support
if(case_ext_standoffs == true && sidewall_support == true) {
// right-rear standoff
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
translate([width-(2*(wallthick+gap))-(c_fillet/2)+(top_ext_standoff[0]/2)-.6,
(c_fillet/2)-1,bottom_height]) cube([gap+adj+2,2,top_height]);
}
// right-front standoff
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10)
|| width-pcb_loc_x-pcb_width >= 10) {
translate([width-(2*(wallthick+gap))-(c_fillet/2)+(top_ext_standoff[0]/2)-.6,
depth-(c_fillet/2)-(2*(wallthick+gap))-1,bottom_height])
cube([gap+adj+2,2,top_height]);
}
// left-rear standoff
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
translate([(c_fillet/2)-(wallthick+gap)-(top_ext_standoff[0]/2)+.6,(c_fillet/2)-1,
bottom_height]) cube([gap+adj+2,2,top_height]);
}
// left-front standoff
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
translate([(c_fillet/2)-(wallthick+gap)-(top_ext_standoff[0]/2)+.6,
depth-(c_fillet/2)-(2*(wallthick+gap))-1, bottom_height])
cube([gap+adj+2,2,top_height]);
// 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)) &&
ext_top_front_left_enable == true) {
extended_standoff = [ext_top_standoff[0],
ext_top_standoff[1],
top_height+ext_top_front_left_adjust,
ext_top_standoff[3],
ext_top_standoff[4],
ext_top_standoff[5],
ext_top_standoff[6],
ext_top_standoff[7],
ext_top_front_left_support,
ext_top_standoff[9],
ext_top_standoff[10],
ext_top_standoff[11],
ext_top_standoff[12]];
translate([(corner_fillet/2)+ext_top_standoff_support_size/4,
depth-ext_top_standoff_support_size/4-(corner_fillet/2)-(2*(wallthick+gap)), case_z])
standoff(extended_standoff,[false,10,2,"default"]);
}
}
}
// subtractive accessories
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -486,68 +574,42 @@ module case_top(case_design) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size_x = accessory_data[a[0]][i+8][0];
size_y = accessory_data[a[0]][i+8][1];
size_z = accessory_data[a[0]][i+8][2];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if ((class == "sub" && face == "top") || class == "suball") {
if(accessory_highlight == false) {
parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,
parametric,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric,[size_x,size_y,size_z],data,mask);
}
else {
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,
parametric,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric,[size_x,size_y,size_z],data,mask);
}
}
// create openings for additive
if (class == "add2" && face == "top" && type == "standoff") {
parametric_move_sub("round",loc_x,loc_y,loc_z,face,rotation,parametric,
6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
if((class == "add1" || class == "add2" || class == "model") && mask[0] == true) {
if(accessory_highlight == false) {
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
0,0,0,data_1,data_2,data_3,data_4);
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,mask);
}
else {
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
0,0,0,data_1,data_2,data_3,data_4);
#parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,[size_x,size_y,size_z],data,mask);
}
}
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+26,face,rotation,
parametric,26.5,wallthick+gap+4,14.5,data_1,data_2,data_3,[.1,.1,.1,.1]);
}
if ((class == "add1" || class == "add2") && face == "top" && type == "button") {
if(data_3 == "recess") {
parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
parametric,size_x-1,size_y,size_z,data_1,data_2,data_3,0);
}
if(data_3 == "cutout") {
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
parametric,size_x+2,size_y+1,size_z+2*adj,data_1,data_2,data_3,[.1,.1,.1,.1]);
}
}
if (class == "model" && face == "bottom" && type == "hk_boom" &&
rotation[0] == 90 && rotation[1] == 0 && rotation[2] == 0) {
parametric_move_sub("round",loc_x+11,loc_y-4,loc_z,face,[0,0,0],
parametric,5,size_y,80,data_1,data_2,data_3,data_4);
parametric_move_sub("slot",loc_x+37.5,loc_y-4.75,loc_z,face,[0,0,0],
parametric,6,14,80,data_1,data_2,data_3,data_4);
}
}
}
// sbc openings
if(sbc_highlight == true) {
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj])
sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
}
else {
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj])
sbc(sbc_model, cooling, fan_size, gpio_opening, uart_opening, true);
}
// indents
if(indents == true) {
@@ -570,14 +632,14 @@ module case_top(case_design) {
translate(([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,
bottom_height+(top_height/2)]) )
cube_negative_fillet([width,depth,top_height], radius=-1,
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
top=[fillet,fillet,fillet,fillet,fillet],
vertical=[corner_fillet,corner_fillet,corner_fillet,corner_fillet],
top=[edge_fillet,edge_fillet,edge_fillet,edge_fillet,edge_fillet],
bottom=[0,0,0,0], $fn=90);
}
}
// additive accessories
if(accessory_name != "none") {
for (i=[1:15:len(accessory_data[a[0]])-1]) {
for (i=[1:11:len(accessory_data[a[0]])-1]) {
class = accessory_data[a[0]][i];
type = accessory_data[a[0]][i+1];
loc_x = accessory_data[a[0]][i+2];
@@ -586,17 +648,12 @@ module case_top(case_design) {
face = accessory_data[a[0]][i+5];
rotation = accessory_data[a[0]][i+6];
parametric = accessory_data[a[0]][i+7];
size_x = accessory_data[a[0]][i+8];
size_y = accessory_data[a[0]][i+9];
size_z = accessory_data[a[0]][i+10];
data_1 = accessory_data[a[0]][i+11];
data_2 = accessory_data[a[0]][i+12];
data_3 = accessory_data[a[0]][i+13];
data_4 = accessory_data[a[0]][i+14];
size = accessory_data[a[0]][i+8];
data = accessory_data[a[0]][i+9];
mask = accessory_data[a[0]][i+10];
if (class == "add2" && face == "top") {
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,size,data,[false,mask[1],mask[2],mask[3]]);
}
}
}

View File

@@ -32,104 +32,104 @@ module indent(loc_x, loc_y, loc_z, rotation, side, class, type, wallthick, gap,
// hdmi indent
if(class == "video" && type == "hdmi_a" && side == "top" && rotation == 0) {
place(loc_x+2.375,-(wallthick+gap)+wallthick/2,loc_z+3.75,12,10,rotation,side)
rotate([90,0,0]) slot(12,10,wallthick);
rotate([90,0,0]) long_slot(12,10,wallthick);
}
if(class == "video" && type == "hdmi_a" && side == "top" && rotation == 90) {
place(-gap-wallthick/2,loc_y,loc_z+3.75,12,10,rotation,side)
rotate([90,0,0]) slot(12,10,wallthick);
rotate([90,0,0]) long_slot(12,10,wallthick);
}
if(class == "video" && type == "hdmi_a" && side == "top" && rotation == 180) {
place(loc_x,depth-(wallthick+gap)-10-wallthick/2,loc_z+3.75,12,10,rotation,side)
rotate([90,0,0]) slot(12,10,wallthick);
rotate([90,0,0]) long_slot(12,10,wallthick);
}
if(class == "video" && type == "hdmi_a" && side == "top" && rotation == 270) {
place(width-(wallthick+gap)-10-wallthick/2,loc_y+2.375,loc_z+3.75,12,10,rotation,side)
rotate([90,0,0]) slot(12,10,wallthick);
rotate([90,0,0]) long_slot(12,10,wallthick);
}
if(class == "video" && type == "hdmi_a" && side == "bottom" && rotation == 0) {
place(loc_x,-(wallthick+gap)+wallthick/2,loc_z-pcb_z-3.75,12,10,rotation,side)
rotate([90,0,0]) slot(12,10,wallthick);
rotate([90,0,0]) long_slot(12,10,wallthick);
}
if(class == "video" && type == "hdmi_a" && side == "bottom" && rotation == 90) {
place(width-(wallthick+gap)-10-wallthick/2,loc_y,loc_z-5.25,12,10,rotation,side)
rotate([90,0,0]) slot(12,10,wallthick);
rotate([90,0,0]) long_slot(12,10,wallthick);
}
if(class == "video" && type == "hdmi_a" && side == "bottom" && rotation == 180) {
place(loc_x+2.375,depth-(wallthick+gap)-10-wallthick/2,loc_z-pcb_z-3.75,12,10,rotation,side)
rotate([90,0,0]) slot(12,10,wallthick);
rotate([90,0,0]) long_slot(12,10,wallthick);
}
if(class == "video" && type == "hdmi_a" && side == "bottom" && rotation == 270) {
place(-gap-wallthick/2,loc_y+1.75,loc_z-pcb_z-3.75,12,10,rotation,side)
rotate([90,0,0]) slot(12,10,wallthick);
rotate([90,0,0]) long_slot(12,10,wallthick);
}
// hdmi micro indent
if(class == "video" && type == "hdmi_micro" && rotation == 0 && side == "top") {
place(loc_x-.5,-(wallthick+gap)+wallthick/2,loc_z+1.5,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_micro" && rotation == 90 && side == "top") {
place(-gap-wallthick/2,loc_y+1.5,loc_z+1.5,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_micro" && rotation == 180 && side == "top") {
place(loc_x+1,depth-(wallthick+gap)-8-wallthick/2,loc_z+1.5,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_micro" && rotation == 270 && side == "top") {
place(width-(wallthick+gap)-8-wallthick/2,loc_y-.75,loc_z+1.5,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_micro" && rotation == 0 && side == "bottom") {
place(loc_x+1.5,-(wallthick+gap)+wallthick/2,loc_z-3,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_micro" && rotation == 90 && side == "bottom") {
place(width-(wallthick+gap)-8-wallthick/2,loc_y+1.25,loc_z-3,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_micro" && rotation == 180 && side == "bottom") {
place(loc_x-1,depth-(wallthick+gap)-8-wallthick/2,loc_z-3,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_micro" && rotation == 270 && side == "bottom") {
place(-gap-wallthick/2,loc_y-.5,loc_z-3,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
// hdmi mini indent
if(class == "video" && type == "hdmi_mini" && rotation == 0 && side == "top") {
place(loc_x+.5,loc_y-gap-wallthick/2+1,loc_z+1.5,6,10,rotation,side)
rotate([90,0,0]) slot(6,10,wallthick);
rotate([90,0,0]) long_slot(6,10,wallthick);
}
if(class == "video" && type == "hdmi_mini" && rotation == 90 && side == "top") {
place(loc_x-wallthick/2,loc_y+3.5,loc_z+1.5,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_mini" && rotation == 180 && side == "top") {
place(loc_x+4.5,loc_y-wallthick/2,loc_z+1.5,6,10,rotation,side)
rotate([90,0,0]) slot(6,10,wallthick);
rotate([90,0,0]) long_slot(6,10,wallthick);
}
if(class == "video" && type == "hdmi_mini" && rotation == 270 && side == "top") {
place(loc_x+wallthick/2,loc_y+1.5,loc_z+1.5,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_mini" && rotation == 0 && side == "bottom") {
place(loc_x+4.5,loc_y-gap-wallthick/2+1,loc_z-3,6,10,rotation,side)
rotate([90,0,0]) slot(6,10,wallthick);
rotate([90,0,0]) long_slot(6,10,wallthick);
}
if(class == "video" && type == "hdmi_mini" && rotation == 90 && side == "bottom") {
place(loc_x+wallthick/2,loc_y+3.5,loc_z-3,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "video" && type == "hdmi_mini" && rotation == 180 && side == "bottom") {
place(loc_x+.5,loc_y-wallthick/2,loc_z-3,6,10,rotation,side)
rotate([90,0,0]) slot(6,10,wallthick);
rotate([90,0,0]) long_slot(6,10,wallthick);
}
if(class == "video" && type == "hdmi_mini" && rotation == 270 && side == "bottom") {
place(loc_x-wallthick/2,loc_y+1.5,loc_z-3,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
// power plug indent
if(class == "power" && type == "pwr5.5_7.5x11.5" && rotation == 0 && side == "top") {
@@ -167,70 +167,70 @@ module indent(loc_x, loc_y, loc_z, rotation, side, class, type, wallthick, gap,
// micro usb indent
if(class == "usb2" && type == "micro" && rotation == 0 && side == "top") {
place(loc_x-.5,-(wallthick+gap)+wallthick/2,loc_z+1.9,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usb2" && type == "micro" && rotation == 90 && side == "top") {
place(-gap-wallthick/2,loc_y+1.5,loc_z+1.9,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usb2" && type == "micro" && rotation == 180 && side == "top") {
place(loc_x+1.5,depth-(wallthick+gap)-8-wallthick/2,loc_z+1.9,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usb2" && type == "micro" && rotation == 270 && side == "top") {
place(width-(wallthick+gap)-8-wallthick/2,loc_y-.5,loc_z+1.9,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usb2" && type == "micro" && rotation == 0 && side == "bottom") {
place(loc_x+1.5,-(wallthick+gap)+wallthick/2,loc_z-3.25,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usb2" && type == "micro" && rotation == 90 && side == "bottom") {
place(width-(wallthick+gap)-8-wallthick/2,loc_y+1.5,loc_z-3.25,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usb2" && type == "micro" && rotation == 180 && side == "bottom") {
place(loc_x-.5,depth-(wallthick+gap)-8-wallthick/2,loc_z-3.25,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usb2" && type == "micro" && rotation == 270 && side == "bottom") {
place(-gap-wallthick/2,loc_y-.5,loc_z-3.25,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
// single horizontal usbc indent
if(class == "usbc" && type == "single_horizontal" && rotation == 0 && side == "top") {
place(loc_x+.5,-(wallthick+gap)+wallthick/2,loc_z+1.75,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usbc" && type == "single_horizontal" && rotation == 90 && side == "top") {
place(-gap-wallthick/2,loc_y+2.5,loc_z+1.75,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usbc" && type == "single_horizontal" && rotation == 180 && side == "top") {
place(loc_x+2.5,depth-(wallthick+gap)-8-wallthick/2,loc_z+2,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usbc" && type == "single_horizontal" && rotation == 270 && side == "top") {
place(width-(wallthick+gap)-8-wallthick/2,loc_y+.5,loc_z+1.75,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usbc" && type == "single_horizontal" && rotation == 0 && side == "bottom") {
place(loc_x+2.75,-(wallthick+gap)+wallthick/2,loc_z-3.25,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usbc" && type == "single_horizontal" && rotation == 90 && side == "bottom") {
place(width-(wallthick+gap)-8-wallthick/2,loc_y+2.5,loc_z-3.25,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick-(wallthick+gap)+wallthick/2);
rotate([90,0,0]) long_slot(6,8,wallthick-(wallthick+gap)+wallthick/2);
}
if(class == "usbc" && type == "single_horizontal" && rotation == 180 && side == "bottom") {
place(loc_x+.5,depth-(wallthick+gap)-8-wallthick/2,loc_z-3.25,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
if(class == "usbc" && type == "single_horizontal" && rotation == 270 && side == "bottom") {
place(-gap-wallthick/2,loc_y+.5,loc_z-3.25,6,8,rotation,side)
rotate([90,0,0]) slot(6,8,wallthick);
rotate([90,0,0]) long_slot(6,8,wallthick);
}
// audio jack indent
if(class == "audio" && type == "jack_3.5" && rotation == 0 && side == "top") {
@@ -265,4 +265,4 @@ module indent(loc_x, loc_y, loc_z, rotation, side, class, type, wallthick, gap,
place(-gap-wallthick/2,loc_y+3.15,loc_z-3.5,8,8,rotation,side)
rotate([90,0,0]) cylinder(d=10, h=wallthick);
}
}
}

View File

@@ -20,170 +20,139 @@
DESCRIPTION: places parametric additive objects
TODO: none
USAGE: parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric[], size_x, size_y, size_z, data_1, data_2, data_3, data_4)
USAGE: parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric[], size[], data[], mask[])
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
parametric[] =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
data[3] =
type = component type
loc_x = x location placement
loc_y = y location placement
loc_z = z location placement
face = "top", "bottom", "left", "right", "front", "rear"
rotation[] = object rotation
parametric[] = parametric movement array
size[] = size array x,y,z
data[] = data filed
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric, size_x, size_y, size_z, data_1, data_2, data_3, data_4) {
module parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric, size, data, mask) {
// absolute no parametrics
if(parametric[1] == false && parametric[2] == false && parametric[3] == false) {
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask);
}
// x axis accessory parametrics
if(parametric[1] == true && parametric[2] == false && parametric[3] == false) {
if(parametric[0] == "case") {
add(type,loc_x+case_offset_x,loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+case_offset_x, loc_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
add(type,loc_x+pcb_loc_x,loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+pcb_loc_x, loc_y, loc_z, face, rotation, size, data, mask);
}
}
// y axis accessory parametrics
if(parametric[1] == false && parametric[2] == true && parametric[3] == false) {
if(parametric[0] == "case") {
add(type,loc_x,loc_y+case_offset_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y+case_offset_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
add(type,loc_x,loc_y+pcb_loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y+pcb_loc_y, loc_z, face, rotation, size, data, mask);
}
}
// z axis accessory parametrics
if(parametric[1] == false && parametric[2] == false && parametric[3] == true) {
if(parametric[0] == "case" && face == "top") {
add(type,loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face == "bottom") {
add(type,loc_x,loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face != "bottom" && face != "top") {
add(type,loc_x,loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
add(type,loc_x,loc_y,loc_z+pcb_loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y, loc_z+pcb_loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "top") {
add(type,loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "bottom") {
add(type,loc_x,loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
}
// xy axis accessory parametrics
if(parametric[1] == true && parametric[2] == true && parametric[3] == false) {
if(parametric[0] == "case") {
add(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+case_offset_x, loc_y+case_offset_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
add(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+pcb_loc_x, loc_y+pcb_loc_y, loc_z, face, rotation, size, data, mask);
}
}
// xz axis accessory parametrics
if(parametric[1] == true && parametric[2] == false && parametric[3] == true) {
if(parametric[0] == "case" && face == "top") {
add(type,loc_x+case_offset_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+case_offset_x, loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face == "bottom") {
add(type,loc_x+case_offset_x,loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+case_offset_x, loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face != "bottom" && face != "top") {
add(type,loc_x+case_offset_x,loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+case_offset_x, loc_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
add(type,loc_x+pcb_loc_x,loc_y,loc_z+pcb_loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+pcb_loc_x, loc_y, loc_z+pcb_loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "top") {
add(type,loc_x+pcb_loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+pcb_loc_x, loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "bottom") {
add(type,loc_x+pcb_loc_x,loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+pcb_loc_x, loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
}
// yz axis accessory parametrics
if(parametric[1] == false && parametric[2] == true && parametric[3] == true) {
if(parametric[0] == "case" && face == "top") {
add(type,loc_x,loc_y+case_offset_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y+case_offset_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face == "bottom") {
add(type,loc_x,loc_y+case_offset_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y+case_offset_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face != "bottom" && face != "top") {
add(type,loc_x,loc_y+case_offset_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y+case_offset_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
add(type,loc_x,loc_y+pcb_loc_y,loc_z+pcb_loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y+pcb_loc_y, loc_z+pcb_loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "top") {
add(type,loc_x,loc_y+pcb_loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x,loc_y+pcb_loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "bottom") {
add(type,loc_x,loc_y+pcb_loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x, loc_y+pcb_loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
}
// xyz axis accessory parametrics
if(parametric[1] == true && parametric[2] == true && parametric[3] == true) {
if(parametric[0] == "case" && face == "top") {
add(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+case_offset_x, loc_y+case_offset_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face == "bottom") {
add(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+case_offset_x, loc_y+case_offset_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face != "bottom" && face != "top") {
add(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+case_offset_x, loc_y+case_offset_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
add(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+pcb_loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+pcb_loc_x, loc_y+pcb_loc_y, loc_z+pcb_loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "top") {
add(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+pcb_loc_x, loc_y+pcb_loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "bottom") {
add(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
add(type, loc_x+pcb_loc_x, loc_y+pcb_loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
}
}
@@ -194,170 +163,138 @@ module parametric_move_add(type, loc_x, loc_y, loc_z, face, rotation, parametric
DESCRIPTION: places parametric subtractive objects
TODO: none
USAGE: parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric[], size_x, size_y, size_z, data_1, data_2, data_3, data_4)
USAGE: parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric[], size[], data[], mask[])
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
parametric[] =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
data[3] =
type = component type
loc_x = x location placement
loc_y = y location placement
loc_z = z location placement
face = "top", "bottom", "left", "right", "front", "rear"
rotation[] = object rotation
parametric[] = parametric movement array
size[] = size array x,y,z
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric, size_x, size_y, size_z, data_1, data_2, data_3, data_4) {
module parametric_move_sub(type, loc_x, loc_y, loc_z, face, rotation, parametric, size, data, mask) {
// absolute no parametrics
if(parametric[1] == false && parametric[2] == false && parametric[3] == false) {
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask);
}
// x axis accessory parametrics
if(parametric[1] == true && parametric[2] == false && parametric[3] == false) {
if(parametric[0] == "case") {
sub(type,loc_x+case_offset_x,loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+case_offset_x, loc_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
sub(type,loc_x+pcb_loc_x,loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+pcb_loc_x, loc_y, loc_z, face, rotation, size, data, mask);
}
}
// y axis accessory parametrics
if(parametric[1] == false && parametric[2] == true && parametric[3] == false) {
if(parametric[0] == "case") {
sub(type,loc_x,loc_y+case_offset_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y+case_offset_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
sub(type,loc_x,loc_y+pcb_loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y+pcb_loc_y, loc_z, face, rotation, size, data, mask);
}
}
// z axis accessory parametrics
if(parametric[1] == false && parametric[2] == false && parametric[3] == true) {
if(parametric[0] == "case" && face == "top") {
sub(type,loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face == "bottom") {
sub(type,loc_x,loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face != "bottom" && face != "top") {
sub(type,loc_x,loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
sub(type,loc_x,loc_y,loc_z+pcb_loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y, loc_z+pcb_loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "top") {
sub(type,loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "bottom") {
sub(type,loc_x,loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
}
// xy axis accessory parametrics
if(parametric[1] == true && parametric[2] == true && parametric[3] == false) {
if(parametric[0] == "case") {
sub(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+case_offset_x, loc_y+case_offset_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
sub(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+pcb_loc_x, loc_y+pcb_loc_y,loc_z, face, rotation, size, data, mask);
}
}
// xz axis accessory parametrics
if(parametric[1] == true && parametric[2] == false && parametric[3] == true) {
if(parametric[0] == "case" && face == "top") {
sub(type,loc_x+case_offset_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+case_offset_x, loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face == "bottom") {
sub(type,loc_x+case_offset_x,loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+case_offset_x, loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face != "bottom" && face != "top") {
sub(type,loc_x+case_offset_x,loc_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+case_offset_x, loc_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
sub(type,loc_x+pcb_loc_x,loc_y,loc_z+pcb_loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+pcb_loc_x, loc_y, loc_z+pcb_loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "top") {
sub(type,loc_x+pcb_loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+pcb_loc_x, loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "bottom") {
sub(type,loc_x+pcb_loc_x,loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+pcb_loc_x, loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
}
// yz axis accessory parametrics
if(parametric[1] == false && parametric[2] == true && parametric[3] == true) {
if(parametric[0] == "case" && face == "top") {
sub(type,loc_x,loc_y+case_offset_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y+case_offset_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face == "bottom") {
sub(type,loc_x,loc_y+case_offset_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y+case_offset_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face != "bottom" && face != "top") {
sub(type,loc_x,loc_y+case_offset_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y+case_offset_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
sub(type,loc_x,loc_y+pcb_loc_y,loc_z+pcb_loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y+pcb_loc_y, loc_z+pcb_loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "top") {
sub(type,loc_x,loc_y+pcb_loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y+pcb_loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "bottom") {
sub(type,loc_x,loc_y+pcb_loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x, loc_y+pcb_loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
}
// xyz axis accessory parametrics
if(parametric[1] == true && parametric[2] == true && parametric[3] == true) {
if(parametric[0] == "case" && face == "top") {
sub(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+case_offset_x, loc_y+case_offset_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face == "bottom") {
sub(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+case_offset_x, loc_y+case_offset_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "case" && face != "bottom" && face != "top") {
sub(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+case_offset_x, loc_y+case_offset_y, loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc") {
sub(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+pcb_loc_z,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+pcb_loc_x, loc_y+pcb_loc_y, loc_z+pcb_loc_z, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "top") {
sub(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+case_offset_tz+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+pcb_loc_x, loc_y+pcb_loc_y, loc_z+case_offset_tz+case_offset_bz, face, rotation, size, data, mask);
}
if(parametric[0] == "sbc-case_z" && face == "bottom") {
sub(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+case_offset_bz,
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
sub(type, loc_x+pcb_loc_x, loc_y+pcb_loc_y, loc_z+case_offset_bz, face, rotation, size, data, mask);
}
}
}

View File

@@ -20,27 +20,48 @@
DESCRIPTION: places subtractive objects
TODO: none
USAGE: sub(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, data_1, data_2, data_3, data_4)
USAGE: sub(type, loc_x, loc_y, loc_z, face, rotation, size[], data[], mask[])
type =
loc_x =
loc_y =
loc_z =
face =
rotation =
size[0] = size_x
size[1] = size_y
size[2] = size_z
data[0] =
data[1] =
data[2] =
type = component type
loc_x = x location placement
loc_y = y location placement
loc_z = z location placement
face = "top", "bottom", "left", "right", "front", "rear"
rotation[] = object rotation
parametric[] = parametric movement array
size[] = size array x,y,z
data[] = data variable on type
mask[0] = true enables component mask
mask[1] = mask length
mask[2] = mask setback
mask[3] = mstyle "default"
*/
module sub(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, data_1, data_2, data_3, data_4) {
module sub(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) {
size_x = size[0];
size_y = size[1];
size_z = size[2];
enablemask = mask[0];
mlen = mask[1];
msetback = mask[2];
mstyle = mask[3];
if(type == "art") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data[0],data[1],data[2]);
}
if(type == "fan_mask") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_mask(size_x, size_z, data[0]);
}
if(type == "hd_holes") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data[0],data[1],data[2],data[3]);
}
if(type == "knockout") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) knockout(size_x,size_y,data[0],size_z,data[1],data[2]);
}
if(type == "rectangle") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data_4);
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data[0]);
}
if(type == "round") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) cylinder(d=size_x,h=size_z);
@@ -48,55 +69,16 @@ module sub(type, loc_x, loc_y, loc_z, face, rotation, size_x, size_y, size_z, da
if(type == "slot") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) slot(size_x,size_y,size_z);
}
if(type == "text") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data_3, size=data_1);
}
if(type == "art") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data_1,data_2,data_3);
}
if(type == "button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data_3,[size_x,size_y,size_z],data_4,data_1);
}
if(type == "hd_holes") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"none","none",data_2);
}
if(type == "hd_vertleft_holes") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"vertical","left",data_2);
}
if(type == "hd_vertright_holes") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"vertical","right",data_2);
}
if(type == "hk_fan_top") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_fan_top();
}
if(type == "knockout") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) knockout(size_x,size_y,data_1,size_z,data_2,data_3);
}
if(type == "fan") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_mask(size_x, size_z, data_1);
}
if(type == "vent") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent(size_x,size_y,size_z,data_4,data_1,data_2,data_3);
}
if(type == "vent_hex") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_hex(size_x,size_y,size_z,data_1,data_2,data_3);
}
if(type == "microusb") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) microusb_open();
}
if(type == "sphere") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) sphere(d=size_x);
}
if(type == "keyhole") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data_4, true);
if(type == "text") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data_2, size=data[0]);
}
if(type == "h3_port_extender") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender(data_3, true);
if(type == "vent") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent(size_x,size_y,size_z,data[3],data[0],data[1],data[2]);
}
if(type == "hk_pwr_button") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_pwr_button(true);
}
if(type == "dsub") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data_4, true);
if(type == "vent_hex") {
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_hex(size_x,size_y,size_z,data[0],data[1],data[2]);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -20,10 +20,14 @@
*/
use <./SBC_Model_Framework/sbc_models_library.scad>
include <./mod/add.scad>;
include <./mod/case_adapter.scad>;
include <./mod/case_bottom.scad>;
include <./mod/case_side.scad>;
include <./mod/case_top.scad>;
include <./mod/case_folded.scad>;
include <./mod/parametric_move.scad>;
include <./mod/indent.scad>;
include <./mod/fillets.scad>;
@@ -32,19 +36,18 @@ include <./mod/sub.scad>;
include <./lib/access_panel.scad>;
include <./lib/art.scad>;
include <./lib/battery.scad>;
include <./lib/button.scad>;
include <./lib/batteries.scad>;
include <./lib/buttons.scad>;
include <./lib/cable_holder.scad>;
include <./lib/component.scad>;
include <./lib/custom.scad>;
include <./lib/fan.scad>;
include <./lib/dsub.scad>;
include <./lib/fans.scad>;
include <./lib/fastener.scad>;
include <./lib/feet.scad>;
include <./lib/hd.scad>;
include <./lib/holder.scad>;
include <./lib/keyhole.scad>;
include <./lib/oem_adafruit.scad>;
include <./lib/oem_hk.scad>;
include <./lib/pcb_pad.scad>;
include <./lib/shape.scad>;
include <./lib/standoff.scad>;
include <./lib/vent.scad>;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.