diff --git a/lib/battery.scad b/lib/batteries.scad similarity index 100% rename from lib/battery.scad rename to lib/batteries.scad diff --git a/lib/button.scad b/lib/buttons.scad similarity index 61% rename from lib/button.scad rename to lib/buttons.scad index bd8e595..9918277 100644 --- a/lib/button.scad +++ b/lib/buttons.scad @@ -24,54 +24,78 @@ */ /* - NAME: button + NAME: buttons DESCRIPTION: creates different button bodys and styles TODO: none - USAGE: button(style, diameter, height) + USAGE: buttons(style, diameter, height, 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); + } } } @@ -157,7 +181,7 @@ $fn = 90; /* - NAME: button_top + NAME: button_clip DESCRIPTION: creates button c-clip TODO: none diff --git a/lib/component.scad b/lib/component.scad deleted file mode 100644 index 0c98585..0000000 --- a/lib/component.scad +++ /dev/null @@ -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 - 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]); - } - } diff --git a/lib/fan.scad b/lib/fan.scad deleted file mode 100644 index d33e3cb..0000000 --- a/lib/fan.scad +++ /dev/null @@ -1,286 +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 - Code released under GPLv3: http://www.gnu.org/licenses/gpl.html - - fan_cover(size, thick) - fan_mask(size, thick, style) - -*/ - -/* - NAME: fan_cover - DESCRIPTION: creates fan covers for fan openings - TODO: none - - USAGE: fan_cover(size, thick, style) - - size = size of fan - thick = thickness of cover - style = fan mask style -*/ - -module fan_cover(size, thick, style) { - difference() { - color("grey", 1) slab([size, size, thick], 3); - color("grey", 1) fan_mask(size, thick, style); - } -} - - -/* - DESCRIPTION: creates heatsink masks for openings - TODO: - - USAGE: heatsink_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" -*/ - -module fan_mask(size, thick, style) { - - hole_pos = size == 30 ? 3 : - size == 40 ? 4 : - size == 50 || size == 60 || size == 70 ? 5 : - size >= 80 ? 3.75 : 3.75; - $fn = 90; - adj = .01; - - if(style == 0) { - - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-1); - // mount holes - translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); - translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); - 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) { - - union() { - difference() { - union () { - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-8); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-11); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-17); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-20); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-25); - } - // mount holes - translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); - translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); - 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); - } - translate([5, 4, -2]) rotate([0, 0, 45]) cube([size, 1.5, thick+4]); - translate([4, size-5, -2]) rotate([0, 0, -45]) cube([size, 1.5, thick+4]); - } - } - } - if(style == 1 && size == 40) { - - union() { - difference() { - union () { - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-8); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-11); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-17); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-20); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-25); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-28); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-35); - } - // mount holes - translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); - translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); - 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); - } - translate([6.5, 5.5, -2]) rotate([0, 0, 45]) cube([size, 1.5, thick+4]); - translate([5, size-6, -2]) rotate([0, 0, -45]) cube([size, 1.5, thick+4]); - } - } - } - if(style == 1 && (size == 50 || size == 60 || size == 70)) { - - union() { - difference() { - union () { - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-14); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-18); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-30); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-34); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-46); - } - if(size > 50) { - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-50); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-59); - } - } - // mount holes - translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); - translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); - 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); - } - translate([8.5, 7, -2]) rotate([0, 0, 45]) cube([size > 60 ? size+4 : size+1, 2, thick+4]); - translate([6.5, size-8, -2]) rotate([0, 0, -45]) cube([size > 60 ? size+4 : size+1, 2, thick+4]); - } - } - } - if(style == 1 && size >= 80) { - - union() { - difference() { - union () { - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-9); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-14); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-21); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-26); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-33); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-38); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-45); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-50); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-57); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-62); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-68); - } - if(size == 92) { - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-74); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-80); - } - difference() { - translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-85); - translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-91); - } - } - // mount holes - translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); - translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); - 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); - } - translate([6.5, 4.25, -2]) rotate([0, 0, 45]) cube([size*1.2, 3, thick+4]); - translate([4.25, size-6.5, -2]) rotate([0, 0, -45]) cube([size*1.2, 3, thick+4]); - } - } - } - if(style == 2) { - - inner = size == 30 ? 24 : - size == 40 ? 32 : - size == 50 ? 40 : - size == 60 ? 50 : - size == 70 ? 61.9 : - size == 80 ? 71.5 : - size * 0.8; // Use 80% as default - - rings = size <= 40 ? 4 : 6; - bar_size = size <= 40 ? 2 : 3; - - screw_offset = inner / 2; - center_point = size * 0.5; - base_ring_size = size * 0.95; - rings_spacing = size / rings; - - translate([size/2, size/2, -1]) - union() { - translate([screw_offset, screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true); - translate([-screw_offset, screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true); - translate([screw_offset, -screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true); - translate([-screw_offset, -screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true); - - difference() { - union() { - for(i=[inner:-rings_spacing:0]) { - difference() { - cylinder(d=base_ring_size - i, h=thick+2); - translate([0, 0, -1]) cylinder(d=base_ring_size - i - (rings_spacing/2), h=thick+4); - } - } - } - - translate([0, 0, 2]) - 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); - } - } - } - } - if(style == 3) { - - hex_pos = size == 30 ? [-11.75, -4.5, 0] : - size == 40 ? [-14, -11.25, 0] : - size == 50 ? [-16, -6.5, 0] : - size == 60 ? [-11, -1.5, 0] : - size == 70 ? [-13, -3.5, 0] : - size >= 80 ? [-8.25, -3.5, 0] : [-9, -4, 0]; - - union() { - difference () { - translate([1+(size-2)/2, 1+(size-2)/2, -1]) cylinder(h=thick+2, d=size-2); - union() { - difference() { - translate([1+(size-2)/2, 1+(size-2)/2, -1-adj]) cylinder(h=thick+3, d=size-2); - translate(hex_pos) vent_hex(15, 8, thick+4, 12, 2, "horizontal"); - } - } - } - } - // mount holes - translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); - translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); - 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); - } -} diff --git a/lib/oem_hk.scad b/lib/oem_hk.scad index b02cd11..f5e1d50 100644 --- a/lib/oem_hk.scad +++ b/lib/oem_hk.scad @@ -18,9 +18,9 @@ hk_uart(mask) hk_uart_holder(mask) hk_uart_strap () - hc4_oled(mask) - hc4_oled_holder(side, floorthick, mask) - hk35_lcd() + hk_hc4_oled(mask) + hk_hc4_oled_holder(side, floorthick, mask) + hk_35lcd(mask) hk_vu7c(gpio_ext, tabs) hk_vu8m(bracket) hk_vu8s() @@ -165,14 +165,14 @@ module hk_uart_strap() { /* - NAME: hc4_oled + NAME: hk_hc4_oled DESCRIPTION: hardkernel odroid-hc4 oled TODO: none - USAGE: hc4_oled_holder(mask) + USAGE: hk_hc4_oled(mask) */ -module hc4_oled(mask) { +module hk_hc4_oled(mask) { adj = .01; $fn=90; @@ -220,17 +220,17 @@ module hc4_oled(mask) { /* - NAME: hc4_oled_holder + NAME: hk_hc4_oled_holder DESCRIPTION: hardkernel odroid-hc4 oled holder TODO: none - USAGE: hc4_oled_holder(side, wallthick, mask) + USAGE: hk_hc4_oled_holder(side, wallthick, mask) side = "top", "bottom" wallthick = wall thickness */ -module hc4_oled_holder(side, wallthick, mask) { +module hk_hc4_oled_holder(side, wallthick, mask) { adj=.01; $fn = 90; @@ -297,36 +297,51 @@ module hc4_oled_holder(side, wallthick, mask) { /* - NAME: hk35_lcd + NAME: hk_35lcd DESCRIPTION: hardkernel 3.5 lcd TODO: none - USAGE: hk35_lcd() + USAGE: hk_35lcd(mask) + mask[0] = true enables component mask + mask[1] = mask length + mask[2] = mask setback + mask[3] = mstyle "default" + */ -module hk35_lcd() { +module hk_35lcd(mask) { + enablemask = mask[0]; + mlength = mask[1]; + msetback = mask[2]; + mstyle = mask[3]; adj = .01; $fn = 90; - difference() { - union() { - color("#008066") translate ([0,0,0]) slab([95,56,1.7],3.5); - color("black",1) translate([10.5,0,1.7]) cube([74.75,54.5,4]); - color("white",1) translate([8.5,0,5.7-adj]) cube([82.75,54.5,2]); - color("grey",1) translate([8.5,0,7.7-adj]) cube([82.75,54.5,.8]); - color("dimgrey",1) translate([15,2,8.5-adj]) cube([75.5,51,.25]); - } - translate([3.5,3.5,-adj]) cylinder(d=3,h=6); - translate([3.5,52.5,-adj]) cylinder(d=3,h=4); - } - translate([3,8.75,1.70-adj]) momentary45x15(); - translate([3,19.75,1.70-adj]) momentary45x15(); - translate([3,30.75,1.70-adj]) momentary45x15(); - translate([3,41.75,1.70-adj]) momentary45x15(); - color("black") translate([7.375,.8,-9+adj]) cube([51.5,5,9]); - translate([92.5,4,adj]) rotate([0,180,0]) header(5); - } + if(enablemask == true && mstyle == "default") { + translate([14.5, 1.5, 8.5-adj-msetback]) cube([76.5, 52, mlength]); + } + if(enablemask == false) { + + difference() { + union() { + color("#008066") slab([95, 56, 1.7], 3.5); + color("black", 1) translate([10.5, 0, 1.7]) cube([74.75, 54.5, 4]); + color("white", 1) translate([8.5, 0, 5.7-adj]) cube([82.75, 54.5, 2]); + color("grey", 1) translate([8.5, 0, 7.7-adj]) cube([82.75, 54.5, .8]); + color("dimgrey", 1) translate([15, 2, 8.5-adj]) cube([75.5, 51, .25]); + } + translate([3.5, 3.5, -adj]) cylinder(d=3, h=6); + translate([3.5, 52.5, -adj]) cylinder(d=3, h=4); + } + button("momentary_4.5x4.5x4.5", 3, 8.75, 1.70-adj, "top", 0, [0,0,0], [0], 0, false, [false,10,2,"default"]); + button("momentary_4.5x4.5x4.5", 3, 19.75, 1.70-adj, "top", 0, [0,0,0], [0], 0, false, [false,10,2,"default"]); + button("momentary_4.5x4.5x4.5", 3, 30.75, 1.70-adj, "top", 0, [0,0,0], [0], 0, false, [false,10,2,"default"]); + button("momentary_4.5x4.5x4.5", 3, 41.75, 1.70-adj, "top", 0, [0,0,0], [0], 0, false, [false,10,2,"default"]); + header("open", 7.375, .8, 0, "bottom", 0, [20, 2, 6.75], ["thruhole", "black", "female", 2.54,"#fee5a6"], 0, false, [false,10,2,"default"]); + header("open", 92.5, 4, 0, "bottom", 0, [1, 5, 6.75], ["thruhole", "black", "male", 2.54,"#fee5a6"], 0, false, [false,10,2,"default"]); + } +} /* NAME: hk_vu7c @@ -730,12 +745,12 @@ module hk_netcard(mask) { ic("generic", 79, 25, 0, "bottom", 0, [6, 6, .8], ["dimgrey"], 1, false, [false, 0, 0, "none"]); ic("generic", 56.5, 41, 0, "bottom", 0, [5, 9.75, .8], ["dimgrey"], 1, false, [false, 0, 0, "none"]); for (i=[34.65:.5:48.5]) { - color("gold") translate([98,i,1]) cube([2,.25,.25]); - color("gold") translate([98,i,-.24]) cube([2,.25,.25]); + color("#fee5a6") translate([98,i,1]) cube([2,.25,.25]); + color("#fee5a6") translate([98,i,-.24]) cube([2,.25,.25]); } for (i=[51:.5:53]) { - color("gold") translate([98,i,1]) cube([2,.25,.25]); - color("gold") translate([98,i,-.24]) cube([2,.25,.25]); + color("#fee5a6") translate([98,i,1]) cube([2,.25,.25]); + color("#fee5a6") translate([98,i,-.24]) cube([2,.25,.25]); } } } diff --git a/lib/pcb_pad.scad b/lib/pcb_pad.scad deleted file mode 100644 index 912c866..0000000 --- a/lib/pcb_pad.scad +++ /dev/null @@ -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 - 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); - } - } - } - } -} diff --git a/lib/shape.scad b/lib/shape.scad deleted file mode 100644 index 658a4a1..0000000 --- a/lib/shape.scad +++ /dev/null @@ -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 - 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); - } -} diff --git a/lib/vent.scad b/lib/vent.scad index d2bbe1e..ce4daaf 100644 --- a/lib/vent.scad +++ b/lib/vent.scad @@ -18,6 +18,8 @@ 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); + fan_cover(size, thick) + fan_mask(size, thick, style) */ @@ -62,44 +64,6 @@ module vent(width, length, height, gap, rows, columns, orientation) { } -/* - 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 DESCRIPTION: creates hex vent panel @@ -141,3 +105,269 @@ module vent_panel_hex(x, y, thick, cell_size=8, cell_spacing=3, border=3, border } } } + + +/* + NAME: fan_cover + DESCRIPTION: creates fan covers for fan openings + TODO: none + + USAGE: fan_cover(size, thick, style) + + size = size of fan + thick = thickness of cover + style = fan mask style +*/ + +module fan_cover(size, thick, style) { + difference() { + color("grey", 1) slab([size, size, thick], 3); + color("grey", 1) fan_mask(size, thick, style); + } +} + + +/* + DESCRIPTION: creates heatsink masks for openings + TODO: + + USAGE: heatsink_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" +*/ + +module fan_mask(size, thick, style) { + + hole_pos = size == 30 ? 3 : + size == 40 ? 4 : + size == 50 || size == 60 || size == 70 ? 5 : + size >= 80 ? 3.75 : 3.75; + $fn = 90; + adj = .01; + + if(style == 0) { + + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-1); + // mount holes + translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); + translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); + 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) { + + union() { + difference() { + union () { + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-8); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-11); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-17); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-20); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-25); + } + // mount holes + translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); + translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); + 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); + } + translate([5, 4, -2]) rotate([0, 0, 45]) cube([size, 1.5, thick+4]); + translate([4, size-5, -2]) rotate([0, 0, -45]) cube([size, 1.5, thick+4]); + } + } + } + if(style == 1 && size == 40) { + + union() { + difference() { + union () { + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-8); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-11); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-17); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-20); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-25); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-28); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-35); + } + // mount holes + translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); + translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); + 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); + } + translate([6.5, 5.5, -2]) rotate([0, 0, 45]) cube([size, 1.5, thick+4]); + translate([5, size-6, -2]) rotate([0, 0, -45]) cube([size, 1.5, thick+4]); + } + } + } + if(style == 1 && (size == 50 || size == 60 || size == 70)) { + + union() { + difference() { + union () { + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-14); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-18); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-30); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-34); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-46); + } + if(size > 50) { + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-50); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-59); + } + } + // mount holes + translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); + translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); + 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); + } + translate([8.5, 7, -2]) rotate([0, 0, 45]) cube([size > 60 ? size+4 : size+1, 2, thick+4]); + translate([6.5, size-8, -2]) rotate([0, 0, -45]) cube([size > 60 ? size+4 : size+1, 2, thick+4]); + } + } + } + if(style == 1 && size >= 80) { + + union() { + difference() { + union () { + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-9); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-14); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-21); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-26); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-33); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-38); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-45); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-50); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-57); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-62); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-68); + } + if(size == 92) { + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-74); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-80); + } + difference() { + translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-85); + translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-91); + } + } + // mount holes + translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); + translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); + 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); + } + translate([6.5, 4.25, -2]) rotate([0, 0, 45]) cube([size*1.2, 3, thick+4]); + translate([4.25, size-6.5, -2]) rotate([0, 0, -45]) cube([size*1.2, 3, thick+4]); + } + } + } + if(style == 2) { + + inner = size == 30 ? 24 : + size == 40 ? 32 : + size == 50 ? 40 : + size == 60 ? 50 : + size == 70 ? 61.9 : + size == 80 ? 71.5 : + size * 0.8; // Use 80% as default + + rings = size <= 40 ? 4 : 6; + bar_size = size <= 40 ? 2 : 3; + + screw_offset = inner / 2; + center_point = size * 0.5; + base_ring_size = size * 0.95; + rings_spacing = size / rings; + + translate([size/2, size/2, -1]) + union() { + translate([screw_offset, screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true); + translate([-screw_offset, screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true); + translate([screw_offset, -screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true); + translate([-screw_offset, -screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true); + + difference() { + union() { + for(i=[inner:-rings_spacing:0]) { + difference() { + cylinder(d=base_ring_size - i, h=thick+2); + translate([0, 0, -1]) cylinder(d=base_ring_size - i - (rings_spacing/2), h=thick+4); + } + } + } + + translate([0, 0, 2]) + 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); + } + } + } + } + if(style == 3) { + + hex_pos = size == 30 ? [-11.75, -4.5, 0] : + size == 40 ? [-14, -11.25, 0] : + size == 50 ? [-16, -6.5, 0] : + size == 60 ? [-11, -1.5, 0] : + size == 70 ? [-13, -3.5, 0] : + size >= 80 ? [-8.25, -3.5, 0] : [-9, -4, 0]; + + union() { + difference () { + translate([1+(size-2)/2, 1+(size-2)/2, -1]) cylinder(h=thick+2, d=size-2); + union() { + difference() { + translate([1+(size-2)/2, 1+(size-2)/2, -1-adj]) cylinder(h=thick+3, d=size-2); + translate(hex_pos) vent_hex(15, 8, thick+4, 12, 2, "horizontal"); + } + } + } + } + // mount holes + translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3); + translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3); + 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); + } +} diff --git a/mod/add.scad b/mod/add.scad index d3d18fc..28a0dd8 100644 --- a/mod/add.scad +++ b/mod/add.scad @@ -67,7 +67,7 @@ module add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) { translate([loc_x,loc_y,loc_z]) rotate(rotation) stl_model(data[0],data[1]); } if(type == "button") { - translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data[1],[size_x,size_y,size_z],data[2],data[0]); + translate([loc_x,loc_y,loc_z]) rotate(rotation) buttons(data[1],[size_x,size_y,size_z],data[2],data[0]); } if(type == "button_top") { translate([loc_x,loc_y,loc_z]) rotate(rotation) button_assembly(data[0],size_x,size_z); @@ -106,16 +106,16 @@ module add(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) { 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(); + translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_hc4_oled(); } if(type == "hc4_oled_holder") { - translate([loc_x,loc_y,loc_z]) rotate(rotation) hc4_oled_holder(face,size_z); + translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_hc4_oled_holder(face,size_z); } if(type == "h2_netcard") { - translate([loc_x,loc_y,loc_z]) rotate(rotation) h2_netcard(); + translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_netcard(); } if(type == "hk_lcd35") { - translate([loc_x,loc_y,loc_z]) rotate(rotation) hk35_lcd(); + translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_35lcd(); } if(type == "hk_m1s_ups") { translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_m1s_ups(); diff --git a/mod/sub.scad b/mod/sub.scad index 2934c89..64f4169 100644 --- a/mod/sub.scad +++ b/mod/sub.scad @@ -64,7 +64,7 @@ module sub(type, loc_x, loc_y, loc_z, face, rotation, size, data, mask) { translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data[0],data[1],data[2]); } if(type == "button") { - translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data[1],[size_x,size_y,size_z],data[2],data[0]); + translate([loc_x,loc_y,loc_z]) rotate(rotation) buttons(data[1],[size_x,size_y,size_z],data[2],data[0]); } if(type == "hd_holes") { translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data[0],data[2],"none","none",data[1]); diff --git a/sbc_case_builder_accessories.cfg b/sbc_case_builder_accessories.cfg index f2851c6..37d611d 100644 --- a/sbc_case_builder_accessories.cfg +++ b/sbc_case_builder_accessories.cfg @@ -453,7 +453,46 @@ accessory_data = [ "platter","button_top",-20,0,0,"top",[0,0,0],["case",false,false,false],[10,0,32],["recess"],[true,10,2,"default"], // button top "platter","button_top",-30,0,0,"top",[0,0,0],["case",false,false,false],[10,0,32],["recess"],[true,10,2,"default"], // button top "platter","access_cover",-110,30,0,"bottom",[0,0,0],["case",false,false,false],[100,80,2],["landscape"],[true,10,2,"default"]], // access port cover + + ["h3_shell_router", + "sub","vent",-3.5,30,40,"top",[0,0,90],["case",false,false,false],[2,10,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "sub","vent",111.5,30,40,"top",[0,0,90],["case",true,false,false],[2,10,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "sub","vent",-3.5,30,4,"bottom",[0,0,90],["case",false,false,false],[2,10,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "sub","vent",111.5,30,4,"bottom",[0,0,90],["case",true,false,false],[2,10,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "add1","access_port",10,30,-0.01,"bottom",[0,0,0],["sbc",true,true,false],[100,80,2],["landscape"],[true,10,2,"default"], // access port + "add2","batt_holder",98,40,65.25,"top",[180,0,-18],["sbc",true,true,true],[10,10,0],[0],[true,10,2,"default"], // add battery holder + "add2","button",12.34,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,32],["recess"],[true,10,2,"default"], // button + "add2","button",23.77,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,32],["recess"],[true,10,2,"default"], // button + "model","button_top",12.34,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,32],["recess"],[true,10,2,"default"], // button top + "model","button_top",23.77,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,32],["recess"],[true,10,2,"default"], // button top + "model","access_cover",10,30,-0.01,"bottom",[0,0,0],["sbc",true,true,false],[100,80,2],["landscape"],[true,10,2,"default"], // access port cover + "model","hk_netcard",0,0,19,"bottom",[0,0,0],["sbc",true,true,true],[0,0,0],["portrait"],[true,10,2,"default"], // h2 network card + "platter","button_top",-20,0,0,"top",[0,0,0],["case",false,false,false],[10,0,32],["recess"],[true,10,2,"default"], // button top + "platter","button_top",-30,0,0,"top",[0,0,0],["case",false,false,false],[10,0,32],["recess"],[true,10,2,"default"], // button top + "platter","access_cover",-110,30,0,"bottom",[0,0,0],["case",false,false,false],[100,80,2],["landscape"],[true,10,2,"default"]], // access port cover + ["h2_shell_router-ssd", + "sub","vent",111.5,30,40,"top",[0,0,90],["case",true,false,false],[2,15,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "sub","vent",-3.5,30,4,"bottom",[0,0,90],["case",false,false,false],[2,10,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "sub","vent",-3.5,30,40,"top",[0,0,90],["case",false,false,false],[2,10,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "sub","vent",111.5,30,4,"bottom",[0,0,90],["case",true,false,false],[2,10,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "sub","round",111,44,6.07,"bottom",[0,90,0],["case",true,false,false],[3,0,3],[0],[true,10,2,"default"], // sub hd side screw hole + "sub","round",111,120.6,6.07,"bottom",[0,90,0],["case",true,false,false],[3,0,3],[0],[true,10,2,"default"], // sub hd side screw hole + "add1","access_port",10,30,-0.01,"bottom",[0,0,0],["sbc",true,true,false],[100,80,2],["landscape"],[true,10,2,"default"], // access port + "add2","batt_holder",98,40,75.25,"top",[180,0,-18],["sbc",true,true,true],[10,10,0],[0],[true,10,2,"default"], // add battery holder + "add2","button",12.34,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,42],["recess"],[true,10,2,"default"], // button + "add2","button",23.77,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,42],["recess"],[true,10,2,"default"], // button + "model","button_top",12.34,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,42],["recess"],[true,10,2,"default"], // button top + "model","button_top",23.77,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,42],["recess"],[true,10,2,"default"], // button top + "model","access_cover",10,30,-0.01,"bottom",[0,0,0],["sbc",true,true,false],[100,80,2],["landscape"],[true,10,2,"default"], // access port cover + "model","hk_netcard",0,0,19,"bottom",[0,0,0],["sbc",true,true,true],[0,0,0],["portrait"],[true,10,2,"default"], // h2 network card + "add2","hd_vertleft",102,10,1.99,"bottom",[0,0,0],["case",true,true,false],[0,0,0],[2.5,3,"portrait"],[true,10,2,"default"], // add hd holder + "sub","hd_vertleft_holes",102,10,-.01,"bottom",[0,0,0],["case",true,true,false],[0,0,0],[2.5,3,"portrait"],[true,10,2,"default"], // sub hd bottom holes + "model","hd25",102,110,2,"bottom",[90,0,-90],["case",true,true,false],[0,0,0],[7],[true,10,2,"default"], // model 2.5 hd + "platter","button_top",-20,0,0,"top",[0,0,0],["case",false,false,false],[10,0,42],["recess"],[true,10,2,"default"], // button top + "platter","button_top",-30,0,0,"top",[0,0,0],["case",false,false,false],[10,0,42],["recess"],[true,10,2,"default"], // button top + "platter","access_cover",-110,30,0,"bottom",[0,0,0],["case",false,false,false],[100,80,2],["landscape"],[true,10,2,"default"]], // access port cover + ["h3_lowboy", "sub","rectangle",94.5,-4,32,"top",[0,0,0],["sbc-case_z",true,true,true],[14,24.5,22],[[.25,.25,.25,.25]],[true,10,2,"default"], // sub rectangle "sub","rectangle",68,-4,32,"top",[0,0,0],["sbc-case_z",true,true,true],[19.5,21.5,22],[[.25,.25,.25,.25]],[true,10,2,"default"], // sub rectangle @@ -490,7 +529,7 @@ accessory_data = [ "model","button_top",12.34,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,11],["recess"],[true,10,2,"default"], // button top "model","button_top",23.77,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,11],["recess"],[true,10,2,"default"], // button top "model","access_cover",10,30,-0.01,"bottom",[0,0,0],["sbc",true,true,false],[100,80,2],["landscape"],[true,10,2,"default"], // access port cover - "model","h2_netcard",0,0,19,"bottom",[0,0,0],["sbc",true,true,true],[0,0,0],["portrait"],[true,10,2,"default"], // h2 network card + "model","hk_netcard",0,0,19,"bottom",[0,0,0],["sbc",true,true,true],[0,0,0],["portrait"],[true,10,2,"default"], // h2 network card "platter","button_top",-20,0,0,"top",[0,0,0],["case",false,false,false],[10,0,11],["recess"],[true,10,2,"default"], // button top "platter","button_top",-30,0,0,"top",[0,0,0],["case",false,false,false],[10,0,11],["recess"],[true,10,2,"default"], // button top "platter","access_cover",-110,30,0,"bottom",[0,0,0],["case",false,false,false],[100,80,2],["landscape"],[true,10,2,"default"]], // access port cover @@ -537,6 +576,22 @@ accessory_data = [ "sub","hd_vertleft_holes",98,10,-.01,"bottom",[0,0,0],["case",true,true,false],[0,0,0],[2.5,3,"portrait"],[true,10,2,"default"], // sub hd bottom holes "model","hd25",98,110,2,"bottom",[90,0,-90],["case",true,true,false],[0,0,0],[7],[true,10,2,"default"]], // model 2.5 hd + ["h3_tray_router", + "suball","vent",-6.5,30,45,"top",[0,0,90],["case",false,false,false],[2,10,7],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "suball","vent",111.5,30,45,"top",[0,0,90],["case",true,false,false],[2,10,7],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "suball","vent",-6.5,30,6,"top",[0,0,90],["case",false,false,false],[2,10,7],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "suball","vent",111.5,30,6,"top",[0,0,90],["case",true,false,false],[2,10,7],[1,17,"vertical",1],[true,10,2,"default"], // vent opening + "add1","access_port",10,30,-0.01,"bottom",[0,0,0],["sbc",true,true,false],[100,80,2],["landscape"],[true,10,2,"default"], // access port + "add2","button",12.34,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,32],["recess"],[true,10,2,"default"], // button + "add2","button",23.77,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,32],["recess"],[true,10,2,"default"], // button + "model","button_top",12.34,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,32],["recess"],[true,10,2,"default"], // button top + "model","button_top",23.77,106.43,55.25,"top",[0,0,0],["sbc-case_z",true,true,true],[10,0,32],["recess"],[true,10,2,"default"], // button top + "model","access_cover",10,30,-0.01,"bottom",[0,0,0],["sbc",true,true,false],[100,80,2],["landscape"],[true,10,2,"default"], // access port cover + "model","hk_netcard",0,0,19,"bottom",[0,0,0],["sbc",true,true,true],[0,0,0],["portrait"],[true,10,2,"default"], // h2 network card + "platter","access_cover",-110,30,0,"bottom",[0,0,0],["case",false,false,false],[100,80,2],["landscape"],[true,10,2,"default"], // access port cover + "platter","button_top",-20,0,0,"top",[0,0,0],["case",false,false,false],[10,0,44],["recess"],[true,10,2,"default"], // button top + "platter","button_top",-30,0,0,"top",[0,0,0],["case",false,false,false],[10,0,44],["recess"],[true,10,2,"default"]], // button top + ["h3_ultimate", "sub","vent",-3.5,30,58,"top",[0,0,90],["case",false,false,false],[2,12,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening "sub","vent",111.5,30,58,"top",[0,0,90],["case",true,false,false],[2,12,4],[1,17,"vertical",1],[true,10,2,"default"], // vent opening diff --git a/sbc_case_builder_library.scad b/sbc_case_builder_library.scad index fca60d6..ca66a65 100644 --- a/sbc_case_builder_library.scad +++ b/sbc_case_builder_library.scad @@ -35,12 +35,10 @@ 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/fastener.scad>; include <./lib/feet.scad>; include <./lib/hd.scad>; @@ -48,7 +46,5 @@ 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>;