more cleanup and documentation
This commit is contained in:
@@ -15,7 +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
|
||||
|
||||
access_port(size, orientation)
|
||||
access_cover(size, orientation)
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
NAME: access_port
|
||||
DESCRIPTION: creates opening and structure for access openings
|
||||
TODO: none
|
||||
@@ -29,7 +34,7 @@
|
||||
*/
|
||||
|
||||
module access_port(size, orientation) {
|
||||
|
||||
|
||||
floorthick = size[2];
|
||||
adj = .01;
|
||||
$fn = 90;
|
||||
@@ -97,7 +102,7 @@ module access_port(size, orientation) {
|
||||
*/
|
||||
|
||||
module access_cover(size, orientation) {
|
||||
|
||||
|
||||
floorthick = size[2];
|
||||
adj = .01;
|
||||
$fn = 90;
|
||||
|
||||
@@ -1,14 +1,40 @@
|
||||
/*
|
||||
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
|
||||
|
||||
battery(type)
|
||||
battery_clip(bat_dia = 18.4)
|
||||
batt_holder(tolerance)
|
||||
module batt_holder(tolerance)
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
NAME: battery
|
||||
DESCRIPTION: creates 18650 and 21700 batteries
|
||||
TODO: none
|
||||
|
||||
USAGE: battery(type)
|
||||
|
||||
type = "18650", "18650_convex", "21700"
|
||||
*/
|
||||
|
||||
module battery(type) {
|
||||
|
||||
adj = .01;
|
||||
|
||||
if(type == "18650") {
|
||||
difference() {
|
||||
cylinder(d=18.4, h=65);
|
||||
@@ -42,6 +68,15 @@ module battery(type) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
NAME: battery_clip
|
||||
DESCRIPTION: creates 18650 and 21700 batteries
|
||||
TODO: none
|
||||
|
||||
USAGE: battery_clip(bat_dia = 18.4)
|
||||
*/
|
||||
|
||||
module battery_clip(bat_dia = 18.4) {
|
||||
|
||||
mat = .38;
|
||||
@@ -73,6 +108,15 @@ module battery_clip(bat_dia = 18.4) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
NAME: battery_holder
|
||||
DESCRIPTION: creates cr2032 friction fit coinstyle holder
|
||||
TODO: none
|
||||
|
||||
USAGE: batt_holder(tolerance)
|
||||
*/
|
||||
|
||||
module batt_holder(tolerance) {
|
||||
|
||||
$fn = 90;
|
||||
|
||||
@@ -1,13 +1,40 @@
|
||||
/*
|
||||
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
|
||||
|
||||
button(style, diameter, height)
|
||||
button_assembly(style, diameter, height
|
||||
button_assembly(style, diameter, height)
|
||||
button_plunger(style, diameter, height)
|
||||
button_top(style, diameter, height)
|
||||
button_clip(style)
|
||||
|
||||
*/
|
||||
|
||||
/* buttons */
|
||||
/*
|
||||
NAME: button
|
||||
DESCRIPTION: creates different button bodys and styles
|
||||
TODO: none
|
||||
|
||||
USAGE: button(style, diameter, height)
|
||||
|
||||
style = "recess", "cutout"
|
||||
diameter = diameter of button body
|
||||
height = height above button
|
||||
*/
|
||||
|
||||
module button(style, size, radius, pad) {
|
||||
|
||||
diameter = size[0];
|
||||
@@ -34,7 +61,7 @@ module button(style, size, radius, 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*adjust], [.1,.1,.1,.1]);
|
||||
translate([-size[0]+2,-3-size[1]/2,0]) slab_r([size[0]+2,size[1]+6,size[2]-2*adjust], [.1,.1,.1,.1]);
|
||||
difference() {
|
||||
translate([-size[0]+3,-size[1]/2,-adjust])
|
||||
slab_r([size[0],size[1],size[2]], [radius[0],radius[1],radius[2],radius[3]]);
|
||||
@@ -49,7 +76,18 @@ module button(style, size, radius, pad) {
|
||||
}
|
||||
|
||||
|
||||
/* button plunger,top,clip */
|
||||
/*
|
||||
NAME: button_assembly
|
||||
DESCRIPTION: creates button assembly of plunger,top,clip
|
||||
TODO: none
|
||||
|
||||
USAGE: button_assembly(style, diameter, height)
|
||||
|
||||
style = "recess", "cutout"
|
||||
diameter = diameter of button body
|
||||
height = height above button
|
||||
*/
|
||||
|
||||
module button_assembly(style, diameter, height) {
|
||||
|
||||
adjust = .01;
|
||||
@@ -63,7 +101,18 @@ $fn = 90;
|
||||
}
|
||||
|
||||
|
||||
/* button plunger */
|
||||
/*
|
||||
NAME: button_plunger
|
||||
DESCRIPTION: creates button plunger
|
||||
TODO: none
|
||||
|
||||
USAGE: button_plunger(style, diameter, height)
|
||||
|
||||
style = "recess", "cutout"
|
||||
diameter = diameter of button body
|
||||
height = height above button
|
||||
*/
|
||||
|
||||
module button_plunger(style, diameter, height) {
|
||||
|
||||
adjust = .01;
|
||||
@@ -81,7 +130,18 @@ $fn = 90;
|
||||
}
|
||||
|
||||
|
||||
/* button top */
|
||||
/*
|
||||
NAME: button_top
|
||||
DESCRIPTION: creates button top
|
||||
TODO: none
|
||||
|
||||
USAGE: button_top(style, diameter, height)
|
||||
|
||||
style = "recess", "cutout"
|
||||
diameter = diameter of button body
|
||||
height = height above button
|
||||
*/
|
||||
|
||||
module button_top(style, diameter, height) {
|
||||
|
||||
adjust = .01;
|
||||
@@ -96,7 +156,16 @@ $fn = 90;
|
||||
}
|
||||
|
||||
|
||||
/* button c-clip */
|
||||
/*
|
||||
NAME: button_top
|
||||
DESCRIPTION: creates button c-clip
|
||||
TODO: none
|
||||
|
||||
USAGE: button_clip(style)
|
||||
|
||||
style = "recess", "cutout"
|
||||
*/
|
||||
|
||||
module button_clip(style) {
|
||||
|
||||
adjust = .01;
|
||||
|
||||
@@ -1,6 +1,25 @@
|
||||
/*
|
||||
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
|
||||
|
||||
cableholder_spacer()
|
||||
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: cableholder_spacer
|
||||
DESCRIPTION: creates 18650 and 21700 batteries
|
||||
TODO: none
|
||||
|
||||
USAGE: cableholder_spacer()
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
/*
|
||||
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()
|
||||
@@ -17,7 +32,14 @@
|
||||
|
||||
*/
|
||||
|
||||
// hdmi a female
|
||||
/*
|
||||
NAME: hdmi_a
|
||||
DESCRIPTION: hdmi-a female model
|
||||
TODO: none
|
||||
|
||||
USAGE: hdmi_a()
|
||||
*/
|
||||
|
||||
module hdmi_a() {
|
||||
size_x = 14.5;
|
||||
size_y = 11.5;
|
||||
|
||||
@@ -1,13 +1,38 @@
|
||||
/*
|
||||
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
|
||||
|
||||
h3_port_extender(style, mask = false)
|
||||
h3_port_extender_holder(part,offset)
|
||||
h3_port_extender_holder(part, offset)
|
||||
|
||||
*/
|
||||
|
||||
// @mctom's odroid-h3 gpio port extender
|
||||
/*
|
||||
NAME: h3_port_extender
|
||||
DESCRIPTION: @mctom's odroid-h3 gpio port extender
|
||||
TODO: none
|
||||
|
||||
USAGE: h3_port_extender(style, mask = false)
|
||||
|
||||
style = "header", "remote"
|
||||
mask = true or false, mask for openings
|
||||
*/
|
||||
|
||||
module h3_port_extender(style, mask = false) {
|
||||
|
||||
|
||||
adjust=.01;
|
||||
$fn = 90;
|
||||
|
||||
@@ -48,15 +73,21 @@ module h3_port_extender(style, mask = false) {
|
||||
|
||||
|
||||
/*
|
||||
// h3_port_extender_holder(part, offset)
|
||||
// part = "both","top","bottom"
|
||||
// offset = projection from inside wall in mm
|
||||
// holder for the @mctom's remote h3 port extender
|
||||
NAME: h3_port_extender
|
||||
DESCRIPTION: holder for the @mctom's remote h3 port extender
|
||||
TODO: none
|
||||
|
||||
USAGE: h3_port_extender_holder(part, offset)
|
||||
|
||||
part = "top","bottom","both"
|
||||
mask = true or false, mask for openings
|
||||
*/
|
||||
|
||||
module h3_port_extender_holder(part,offset=2) {
|
||||
|
||||
adjust = .01;
|
||||
size = [16-offset,40,5.5];
|
||||
adjust = .01;
|
||||
|
||||
if(part == "bottom" || part == "both") {
|
||||
difference() {
|
||||
translate([-10+offset,-3.5,2]) cube(size);
|
||||
|
||||
383
lib/fan.scad
383
lib/fan.scad
@@ -1,169 +1,219 @@
|
||||
/*
|
||||
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
|
||||
|
||||
fan_cover(size, thick)
|
||||
fan_mask(size, thick, style)
|
||||
|
||||
*/
|
||||
|
||||
/* fan cover */
|
||||
/*
|
||||
NAME: fan_cover
|
||||
DESCRIPTION: creates fan covers for fan openings
|
||||
TODO: none
|
||||
|
||||
USAGE: fan_cover(size, thick)
|
||||
|
||||
size = size of fan
|
||||
thick = thickness of cover
|
||||
*/
|
||||
|
||||
module fan_cover(size, thick) {
|
||||
difference() {
|
||||
color("grey",1) slab([size,size,thick],3);
|
||||
color("grey",1) fan_mask(size, thick, 2);
|
||||
color("grey", 1) slab([size, size, thick], 3);
|
||||
color("grey", 1) fan_mask(size, thick, 2);
|
||||
}
|
||||
}
|
||||
|
||||
/* fan mask to create opening */
|
||||
|
||||
/*
|
||||
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) {
|
||||
|
||||
$fn=90;
|
||||
|
||||
if(style == 1) {
|
||||
translate ([size/2,size/2,-1]) cylinder(h=thick+2, d=size-2);
|
||||
if(size == 40) {
|
||||
// mount holes
|
||||
translate ([size-4,size-4,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([size-4,4,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([4,size-4,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([4,4,-1]) cylinder(h=thick+2, d=3);
|
||||
}
|
||||
if(size == 60) {
|
||||
// mount holes
|
||||
translate ([size-5,size-5,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([size-5,5,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([5,size-5,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([5,5,-1]) cylinder(h=thick+2, d=3);
|
||||
}
|
||||
if(size >= 80) {
|
||||
// mount holes
|
||||
translate ([size-3.75,size-3.75,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([size-3.75,3.75,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([3.75,size-3.75,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([3.75,3.75,-1]) cylinder(h=thick+2, d=3);
|
||||
}
|
||||
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 == 2 && size == 40) {
|
||||
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-6);
|
||||
}
|
||||
difference() {
|
||||
translate ([size/2,size/2,-1]) cylinder(h=thick+2, d=size-10);
|
||||
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-22);
|
||||
}
|
||||
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-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-38);
|
||||
}
|
||||
// mount holes
|
||||
translate ([size-4,size-4,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([size-4,4,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([4,size-4,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([4,4,-1]) cylinder(h=thick+2, d=3);
|
||||
}
|
||||
translate([6.5,5,-2]) rotate([0,0,45]) cube([size,2,thick+4]);
|
||||
translate([4.5,size-6,-2]) rotate([0,0,-45]) cube([size,2,thick+4]);
|
||||
}
|
||||
}
|
||||
if(style == 2 && size == 60) {
|
||||
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-6);
|
||||
}
|
||||
difference() {
|
||||
translate ([size/2,size/2,-1]) cylinder(h=thick+2, d=size-10);
|
||||
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-22);
|
||||
}
|
||||
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-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-38);
|
||||
}
|
||||
difference() {
|
||||
translate ([size/2,size/2,-1]) cylinder(h=thick+2, d=size-42);
|
||||
translate ([size/2,size/2,-2]) cylinder(h=thick+4, d=size-46);
|
||||
}
|
||||
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-54);
|
||||
}
|
||||
// mount holes
|
||||
translate ([size-5,size-5,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([size-5,5,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([5,size-5,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([5,5,-1]) cylinder(h=thick+2, d=3);
|
||||
}
|
||||
translate([9.5,8,-2]) rotate([0,0,45]) cube([size,2,thick+4]);
|
||||
translate([8.5,size-10,-2]) rotate([0,0,-45]) cube([size,2,thick+4]);
|
||||
}
|
||||
}
|
||||
if(style == 2 && size >= 80) {
|
||||
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-14);
|
||||
translate ([size/2,size/2,-2]) cylinder(h=thick+4, d=size-20);
|
||||
}
|
||||
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-32);
|
||||
}
|
||||
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-44);
|
||||
}
|
||||
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-56);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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-79);
|
||||
}
|
||||
if(size == 92) {
|
||||
if(style == 1 && size == 30) {
|
||||
|
||||
union() {
|
||||
difference() {
|
||||
union () {
|
||||
difference() {
|
||||
translate ([size/2,size/2,-1]) cylinder(h=thick+2, d=size-86);
|
||||
translate ([size/2,size/2,-2]) cylinder(h=thick+4, d=size-92);
|
||||
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);
|
||||
}
|
||||
// mount holes
|
||||
translate ([size-3.75,size-3.75,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([size-3.75,3.75,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([3.75,size-3.75,-1]) cylinder(h=thick+2, d=3);
|
||||
translate ([3.75,3.75,-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]);
|
||||
}
|
||||
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 == 3) {
|
||||
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 :
|
||||
@@ -171,7 +221,7 @@ module fan_mask(size, thick, style) {
|
||||
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;
|
||||
|
||||
@@ -196,13 +246,40 @@ module fan_mask(size, thick, style) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
translate([0, 0, -1]) union() {
|
||||
cylinder(d=bar_size*2+0.1, thick+6); // Add a circle to prevent any tiny holes around cross bar
|
||||
rotate([0, 0, 45]) cube([size, bar_size, 12], center=true);
|
||||
rotate([0, 0, 45]) cube([bar_size, size, 12], center=true);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,78 @@
|
||||
/*
|
||||
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
|
||||
|
||||
m_insert(type="M3", icolor = "#ebdc8b")
|
||||
screw(screw_type)
|
||||
|
||||
*/
|
||||
|
||||
module m_insert(type="M3", icolor = "#ebdc8b") { //#f4e6c3, #ebdc8b
|
||||
/*
|
||||
NAME: fan_cover
|
||||
DESCRIPTION: creates fan covers for fan openings
|
||||
TODO: none
|
||||
|
||||
USAGE: m_insert(type="M3", icolor = "#ebdc8b")
|
||||
|
||||
type = "M3"
|
||||
icolor = color of insert
|
||||
*/
|
||||
|
||||
module m_insert(type="M3", icolor = "#ebdc8b") { //#f4e6c3, #ebdc8b
|
||||
|
||||
odiam = type == "M3" ? 4.2 : 3.5;
|
||||
idiam = type == "M3" ? 3 : 2.5;
|
||||
iheight = 4;
|
||||
|
||||
|
||||
difference() {
|
||||
color(icolor,.6) cylinder(d=odiam, h=iheight);
|
||||
color(icolor,.6) translate([0,0,-1]) cylinder(d=idiam, h=iheight+2);
|
||||
}
|
||||
for(bearing = [0:10:360]) {
|
||||
color(icolor) translate([-.25+(odiam/2)*cos(bearing),-.25+(odiam/2)*sin(bearing),iheight-1.5])
|
||||
rotate([0,0,0]) cube([.5,.5,1.5]);
|
||||
color(icolor) translate([-.25+(odiam/2)*cos(bearing), -.25+(odiam/2)*sin(bearing), iheight-1.5])
|
||||
cube([.5, .5, 1.5]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// General purpose screw
|
||||
// screw(screw[d, l, style])
|
||||
// d - thread diameter
|
||||
// l - thread length
|
||||
// style - screw head style
|
||||
//
|
||||
// Styles:
|
||||
// 0 - Mushroom head, 5mm diameter
|
||||
/*
|
||||
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];
|
||||
|
||||
// Head
|
||||
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]);
|
||||
}
|
||||
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]);
|
||||
}
|
||||
// Thread
|
||||
rotate([180,0,0]) cylinder(d=d, h=l);
|
||||
}
|
||||
rotate([180,0,0]) cylinder(d=d, h=l);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,36 @@
|
||||
/*
|
||||
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
|
||||
|
||||
feet (height)
|
||||
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: feet
|
||||
DESCRIPTION: creates simple case feet
|
||||
TODO: none
|
||||
|
||||
USAGE: feet (diameter, height)
|
||||
|
||||
diameter = size of fan
|
||||
height = thickness of cover
|
||||
|
||||
*/
|
||||
|
||||
/* case feet */
|
||||
module feet (diameter,height) {
|
||||
|
||||
module feet (diameter, height) {
|
||||
|
||||
difference (){
|
||||
cylinder (d=diameter,h=height);
|
||||
translate([0,0,-1]) cylinder (d=3, h=height+2,$fn=90);
|
||||
translate ([0,0,-1]) cylinder(r=3.35,h=height-3,$fn=6);
|
||||
translate ([0,0,-1]) cylinder(r=3.35,h=height-3,$fn=6);
|
||||
}
|
||||
}
|
||||
|
||||
432
lib/hd.scad
432
lib/hd.scad
@@ -1,21 +1,50 @@
|
||||
/*
|
||||
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
|
||||
|
||||
hd_mount(hd,orientation,position,side)
|
||||
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
|
||||
|
||||
hd_mount(hd, orientation, position, side)
|
||||
hd25_tab(side)
|
||||
hd25_vtab(side)
|
||||
hd35_tab(side)
|
||||
hd35_vtab(side)
|
||||
hd_bottom_holes(hd,orientation,position,side,thick)
|
||||
hd_bottom_holes(hd, orientation, position, side, thick)
|
||||
hd25(height)
|
||||
hd35()
|
||||
hdd35_25holder(length)
|
||||
|
||||
*/
|
||||
|
||||
module hd_mount(hd,orientation,position,side) {
|
||||
/*
|
||||
NAME: hd_mount
|
||||
DESCRIPTION: creates 2.5" and 3.5" hard drive mounts
|
||||
TODO: none
|
||||
|
||||
adjust = .01;
|
||||
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;
|
||||
|
||||
if(hd == 2.5) {
|
||||
if(orientation == "portrait") {
|
||||
if(position == "vertical") {
|
||||
@@ -100,6 +129,15 @@ module hd_mount(hd,orientation,position,side) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
NAME: hd25_tab
|
||||
DESCRIPTION: creates 2.5" hard drive tabs for horizontal mounting
|
||||
TODO: none
|
||||
|
||||
USAGE: hd25_tab(side)
|
||||
|
||||
side = "left", "right"
|
||||
*/
|
||||
|
||||
module hd25_tab(side) {
|
||||
|
||||
@@ -110,31 +148,32 @@ module hd25_tab(side) {
|
||||
fillet = 2;
|
||||
hole = 3.6;
|
||||
length = 3;
|
||||
|
||||
adjust = .01;
|
||||
|
||||
adj = .01;
|
||||
$fn = 90;
|
||||
|
||||
if(side == "left") {
|
||||
difference() {
|
||||
union() {
|
||||
translate([0,-depth/2,0]) rotate([0,-90,0])
|
||||
slab_r([l_width,depth,height], [fillet,fillet,fillet,fillet]);
|
||||
translate([-height,-depth/2,0]) cube([height,depth,height]);
|
||||
translate([adjust,-5.5,depth])
|
||||
translate([adj,-5.5,depth])
|
||||
rotate([90,0,0])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
translate([adjust,7.5,depth])
|
||||
translate([adj,7.5,depth])
|
||||
rotate([90,0,0])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
}
|
||||
translate([4.07,0,-adjust]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-height-adjust,(width/2)-(length/2)-depth/2,3]) rotate([90,0,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([-height-adjust,(width/2)-(length/2)-depth/2,21]) rotate([90,0,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([4.07,0,-adj]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-height-adj,(width/2)-(length/2)-depth/2,3]) rotate([90,0,90]) slot(hole,length,height+(2*adj));
|
||||
translate([-height-adj,(width/2)-(length/2)-depth/2,21]) rotate([90,0,90]) slot(hole,length,height+(2*adj));
|
||||
}
|
||||
}
|
||||
if(side == "right") {
|
||||
@@ -143,27 +182,37 @@ module hd25_tab(side) {
|
||||
translate([height,-depth/2,0]) rotate([0,-90,0])
|
||||
slab_r([l_width,depth,height], [fillet,fillet,fillet,fillet]);
|
||||
translate([0,-depth/2,0]) cube([height,depth,height]);
|
||||
translate([adjust,-7.5,depth])
|
||||
translate([adj,-7.5,depth])
|
||||
rotate([90,0,180])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
translate([adjust,5.5,depth])
|
||||
translate([adj,5.5,depth])
|
||||
rotate([90,0,180])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
}
|
||||
translate([-4.07,0,-adjust]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-adjust,(width/2)-(length/2)-depth/2,3]) rotate([90,0,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([-adjust,(width/2)-(length/2)-depth/2,21]) rotate([90,0,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([-4.07,0,-adj]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-adj,(width/2)-(length/2)-depth/2,3]) rotate([90,0,90]) slot(hole,length,height+(2*adj));
|
||||
translate([-adj,(width/2)-(length/2)-depth/2,21]) rotate([90,0,90]) slot(hole,length,height+(2*adj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
NAME: hd25_vtab
|
||||
DESCRIPTION: creates 2.5" hard drive tabs for vertical mounting
|
||||
TODO: none
|
||||
|
||||
USAGE: hd25_vtab(side)
|
||||
|
||||
side = "left", "right"
|
||||
*/
|
||||
|
||||
module hd25_vtab(side) {
|
||||
|
||||
width = 15;
|
||||
@@ -173,30 +222,31 @@ module hd25_vtab(side) {
|
||||
fillet = 2;
|
||||
hole = 3.6;
|
||||
length = 3;
|
||||
|
||||
adjust = .01;
|
||||
|
||||
adj = .01;
|
||||
$fn = 90;
|
||||
|
||||
if(side == "left") {
|
||||
difference() {
|
||||
union() {
|
||||
translate([0,-depth/2,0]) rotate([0,-90,0])
|
||||
slab_r([l_width,depth,height], [fillet,fillet,fillet,fillet]);
|
||||
translate([-height,-depth/2,0]) cube([height,depth,height]);
|
||||
translate([adjust,-5.5,depth])
|
||||
translate([adj,-5.5,depth])
|
||||
rotate([90,0,0])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height-5],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
translate([adjust,7.5,depth])
|
||||
translate([adj,7.5,depth])
|
||||
rotate([90,0,0])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height-5],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
}
|
||||
translate([3,0,-adjust]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-height-adjust,1.5+(width/2)-(length/2)-depth/2,5.57]) rotate([90,90,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([3,0,-adj]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-height-adj,1.5+(width/2)-(length/2)-depth/2,5.57]) rotate([90,90,90]) slot(hole,length,height+(2*adj));
|
||||
}
|
||||
}
|
||||
if(side == "right") {
|
||||
@@ -205,26 +255,36 @@ module hd25_vtab(side) {
|
||||
translate([height,-depth/2,0]) rotate([0,-90,0])
|
||||
slab_r([l_width,depth,height], [fillet,fillet,fillet,fillet]);
|
||||
translate([0,-depth/2,0]) cube([height,depth,height]);
|
||||
translate([adjust,-7.5,depth])
|
||||
translate([adj,-7.5,depth])
|
||||
rotate([90,0,180])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height-5],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
translate([adjust,5.5,depth])
|
||||
translate([adj,5.5,depth])
|
||||
rotate([90,0,180])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height-5],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
}
|
||||
translate([-3,0,-adjust]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-adjust,1.5+(width/2)-(length/2)-depth/2,5.57]) rotate([90,90,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([-3,0,-adj]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-adj,1.5+(width/2)-(length/2)-depth/2,5.57]) rotate([90,90,90]) slot(hole,length,height+(2*adj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
NAME: hd35_tab
|
||||
DESCRIPTION: creates 3.5" hard drive tabs for horizontal mounting
|
||||
TODO: none
|
||||
|
||||
USAGE: hd35_tab(side)
|
||||
|
||||
side = "left", "right"
|
||||
*/
|
||||
|
||||
module hd35_tab(side) {
|
||||
|
||||
width = 15;
|
||||
@@ -234,9 +294,10 @@ module hd35_tab(side) {
|
||||
fillet = 2;
|
||||
hole = 3.6;
|
||||
length = 3;
|
||||
|
||||
adjust = .01;
|
||||
$fn = 90;
|
||||
|
||||
adj = .01;
|
||||
$fn = 90;
|
||||
|
||||
if(side == "left") {
|
||||
difference() {
|
||||
union() {
|
||||
@@ -244,13 +305,13 @@ module hd35_tab(side) {
|
||||
slab_r([l_width,depth,height], [fillet,fillet,fillet,fillet]);
|
||||
translate([-height,-depth/2,0]) cube([height,depth,height]);
|
||||
|
||||
translate([adjust,-5.5,depth])
|
||||
translate([adj,-5.5,depth])
|
||||
rotate([90,0,0])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height+20],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
translate([adjust,7.5,depth])
|
||||
translate([adj,7.5,depth])
|
||||
rotate([90,0,0])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height+20],
|
||||
@@ -258,9 +319,9 @@ module hd35_tab(side) {
|
||||
[-height,-depth]]);
|
||||
|
||||
}
|
||||
translate([3.18,0,-adjust]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-height-adjust,(width/2)-(length/2)-depth/2,6.35]) rotate([90,0,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([-height-adjust,(width/2)-(length/2)-depth/2,38.35]) rotate([90,0,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([3.18,0,-adj]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-height-adj,(width/2)-(length/2)-depth/2,6.35]) rotate([90,0,90]) slot(hole,length,height+(2*adj));
|
||||
translate([-height-adj,(width/2)-(length/2)-depth/2,38.35]) rotate([90,0,90]) slot(hole,length,height+(2*adj));
|
||||
}
|
||||
}
|
||||
if(side == "right") {
|
||||
@@ -270,13 +331,13 @@ module hd35_tab(side) {
|
||||
slab_r([l_width,depth,height], [fillet,fillet,fillet,fillet]);
|
||||
translate([0,-depth/2,0]) cube([height,depth,height]);
|
||||
|
||||
translate([adjust,-7.5,depth])
|
||||
translate([adj,-7.5,depth])
|
||||
rotate([90,0,180])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height+20],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
translate([adjust,5.5,depth])
|
||||
translate([adj,5.5,depth])
|
||||
rotate([90,0,180])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height+20],
|
||||
@@ -284,15 +345,26 @@ module hd35_tab(side) {
|
||||
[-height,-depth]]);
|
||||
|
||||
}
|
||||
translate([-3.18,0,-adjust]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-adjust,(width/2)-(length/2)-depth/2,6.35]) rotate([90,0,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([-adjust,(width/2)-(length/2)-depth/2,38.35]) rotate([90,0,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([-3.18,0,-adj]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-adj,(width/2)-(length/2)-depth/2,6.35]) rotate([90,0,90]) slot(hole,length,height+(2*adj));
|
||||
translate([-adj,(width/2)-(length/2)-depth/2,38.35]) rotate([90,0,90]) slot(hole,length,height+(2*adj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
NAME: hd35_vtab
|
||||
DESCRIPTION: creates 3.5" hard drive tabs for vertical mounting
|
||||
TODO: none
|
||||
|
||||
USAGE: hd35_vtab(side)
|
||||
|
||||
side = "left", "right"
|
||||
*/
|
||||
|
||||
module hd35_vtab(side) {
|
||||
|
||||
|
||||
width = 15;
|
||||
l_width = 16;
|
||||
depth = 15;
|
||||
@@ -300,8 +372,8 @@ module hd35_vtab(side) {
|
||||
fillet = 2;
|
||||
hole = 3.6;
|
||||
length = 3;
|
||||
|
||||
adjust = .01;
|
||||
|
||||
adj = .01;
|
||||
$fn = 90;
|
||||
if(side == "left") {
|
||||
difference() {
|
||||
@@ -309,21 +381,21 @@ module hd35_vtab(side) {
|
||||
translate([0,-depth/2,0]) rotate([0,-90,0])
|
||||
slab_r([l_width,depth,height], [fillet,fillet,fillet,fillet]);
|
||||
translate([-height,-depth/2,0]) cube([height,depth,height]);
|
||||
translate([adjust,-5.5,depth])
|
||||
translate([adj,-5.5,depth])
|
||||
rotate([90,0,0])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height-5],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
translate([adjust,7.5,depth])
|
||||
translate([adj,7.5,depth])
|
||||
rotate([90,0,0])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height-5],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
}
|
||||
translate([3,0,-adjust]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-height-adjust,1.5+(width/2)-(length/2)-depth/2,5.57]) rotate([90,90,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([3,0,-adj]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-height-adj,1.5+(width/2)-(length/2)-depth/2,5.57]) rotate([90,90,90]) slot(hole,length,height+(2*adj));
|
||||
}
|
||||
}
|
||||
if(side == "right") {
|
||||
@@ -332,49 +404,64 @@ module hd35_vtab(side) {
|
||||
translate([height,-depth/2,0]) rotate([0,-90,0])
|
||||
slab_r([l_width,depth,height], [fillet,fillet,fillet,fillet]);
|
||||
translate([0,-depth/2,0]) cube([height,depth,height]);
|
||||
translate([adjust,-7.5,depth])
|
||||
translate([adj,-7.5,depth])
|
||||
rotate([90,0,180])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height-5],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
translate([adjust,5.5,depth])
|
||||
translate([adj,5.5,depth])
|
||||
rotate([90,0,180])
|
||||
linear_extrude(height = 2)
|
||||
polygon(points = [ [-height,height-5],
|
||||
[-depth+4,-depth],
|
||||
[-height,-depth]]);
|
||||
}
|
||||
translate([-3,0,-adjust]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-adjust,1.5+(width/2)-(length/2)-depth/2,5.57]) rotate([90,90,90]) slot(hole,length,height+(2*adjust));
|
||||
translate([-3,0,-adj]) rotate([0,0,0]) cylinder(d=hole, h=3);
|
||||
translate([-adj,1.5+(width/2)-(length/2)-depth/2,5.57]) rotate([90,90,90]) slot(hole,length,height+(2*adj));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module hd_bottom_holes(hd,orientation,position,side,thick) {
|
||||
/*
|
||||
NAME: hd_bottom_holes
|
||||
DESCRIPTION: creates 2.5" and 3.5" hard drive hole mask for mounting
|
||||
TODO: none
|
||||
|
||||
adjust = .01;
|
||||
USAGE: hd_bottom_holes(hd, orientation, position, side, thick)
|
||||
|
||||
hd = 2.5, 3.5
|
||||
orientation = "portrait", "landscape"
|
||||
position = "vertical", "horizontal"
|
||||
side = "left", "right"
|
||||
thick = floor thickness
|
||||
*/
|
||||
|
||||
module hd_bottom_holes(hd, orientation, position, side, thick) {
|
||||
|
||||
adj = .01;
|
||||
$fn = 90;
|
||||
|
||||
if(hd == 2.5) {
|
||||
if(orientation == "portrait") {
|
||||
if(position == "vertical") {
|
||||
if(side == "left") {
|
||||
translate([-3,14,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([-3,90.6,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
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 {
|
||||
// portrait 2.5" bottom screw holes
|
||||
translate([3,14,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([3,90.6,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
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 {
|
||||
// portrait 2.5" bottom screw holes
|
||||
translate([4.07,14,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([4.07,90.6,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([65.79,90.6,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([65.79,14,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
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));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -392,10 +479,10 @@ module hd_bottom_holes(hd,orientation,position,side,thick) {
|
||||
}
|
||||
else {
|
||||
// landscape 2.5" bottom screw holes
|
||||
translate([9.4,4.07,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([86,4.07,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([86,65.79,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([9.4,65.79,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,96 +503,122 @@ module hd_bottom_holes(hd,orientation,position,side,thick) {
|
||||
}
|
||||
else {
|
||||
// portrait 3.5" bottom screw holes
|
||||
translate([3.18,41.28,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([3.18,85.73,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([3.18,117.48,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([98.43,41.28,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([98.43,85.73,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([98.43,117.48,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
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));
|
||||
}
|
||||
}
|
||||
if(orientation == "landscape") {
|
||||
// landscape 3.5" bottom screw holes
|
||||
translate([29.52,3.18,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([61.27,3.18,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([105.72,3.18,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([29.52,98.43,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([61.27,98.43,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
translate([105.72,98.43,0]) cylinder(d=3.6,h=thick+(adjust*2));
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* hard drive 2.5", height=drive height */
|
||||
/*
|
||||
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;
|
||||
|
||||
adjust = .01;
|
||||
|
||||
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,-adjust]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([86,4.07,-adjust]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([86,65.79,-adjust]) cylinder(d=3,h=4);
|
||||
color("Black",.6) translate([9.4,65.79,-adjust]) cylinder(d=3,h=4);
|
||||
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,-adjust,3]) rotate([-90,0,0]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([86,-adjust,3]) rotate([-90,0,0]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([86,hd25_y+adjust,3]) rotate([90,0,0]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([9.4,hd25_y+adjust,3]) rotate([90,0,0]) cylinder(d=3,h=3);
|
||||
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+adjust,32,5+adjust]);
|
||||
color("LightSlateGray",.6) translate([hd25_x-5,11,-1]) cube([5+adj,32,5+adj]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* hard drive 3.5" */
|
||||
/*
|
||||
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;
|
||||
|
||||
adjust = .01;
|
||||
|
||||
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,-adjust]) cylinder(d=3,h=3+adjust);
|
||||
color("Black",.6) translate([61.27,3.18,-adjust]) cylinder(d=3,h=3+adjust);
|
||||
color("Black",.6) translate([105.72,3.18,-adjust]) cylinder(d=3,h=3+adjust);
|
||||
color("Black",.6) translate([29.52,98.43,-adjust]) cylinder(d=3,h=3+adjust);
|
||||
color("Black",.6) translate([61.27,98.43,-adjust]) cylinder(d=3,h=3+adjust);
|
||||
color("Black",.6) translate([105.72,98.43,-adjust]) cylinder(d=3,h=3+adjust);
|
||||
|
||||
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,-adjust,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([76.6,-adjust,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([118.5,-adjust,6.35]) rotate([-90,0,0]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([118.5,hd35_y+adjust,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([76.6,hd35_y+adjust,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
|
||||
color("Black",.6) translate([16.9,hd35_y+adjust,6.35]) rotate([90,0,0]) cylinder(d=3,h=3);
|
||||
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+adjust,32,5+adjust]);
|
||||
color("LightSlateGray",.6) translate([hd35_x-5,11,-1]) cube([5+adj,32,5+adj]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 3.5" hdd to 2.5" hdd holder */
|
||||
module hdd35_25holder(length,width=101.6) {
|
||||
/*
|
||||
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
|
||||
@@ -517,76 +630,77 @@ module hdd35_25holder(length,width=101.6) {
|
||||
hd25_xloc = 2; // or (hd35_x-hd25_x)/2
|
||||
hd25_yloc = (hd35_y-hd25_y)/2;
|
||||
hd25_zloc = 9.5;
|
||||
adjust = .1;
|
||||
adj = .1;
|
||||
$fn=90;
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
difference() {
|
||||
translate([(hd35_x/2),(hd35_y/2),(hd35_z/2)])
|
||||
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])
|
||||
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([-adjust,5,wallthick+2]) cube([wallthick+(adjust*2),hd35_y-10,10]);
|
||||
translate([hd35_x-wallthick-adjust,5,wallthick+2]) cube([wallthick+(adjust*2),hd35_y-10,10]);
|
||||
|
||||
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,-adjust]) cube([35,2,wallthick+(adjust*2)]);
|
||||
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-adjust]) cylinder(d=8,h=4);
|
||||
translate([86+hd25_xloc,4.07+hd25_yloc,floorthick-adjust]) cylinder(d=8,h=4);
|
||||
translate([86+hd25_xloc,65.79+hd25_yloc,floorthick-adjust]) cylinder(d=8,h=4);
|
||||
translate([9.4+hd25_xloc,65.79+hd25_yloc,floorthick-adjust]) cylinder(d=8,h=4);
|
||||
|
||||
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-adjust,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
|
||||
translate([76,wallthick-adjust,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
|
||||
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-adjust,7]) rotate([-90,0,0]) cylinder(d=10,h=3);
|
||||
translate([117.5,hd35_y-wallthick+adjust,7]) rotate([90,0,0]) cylinder(d=10,h=3);
|
||||
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+adjust,7]) rotate([90,0,0]) cylinder(d=10,h=3);
|
||||
translate([16,hd35_y-wallthick+adjust,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+adjust,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,-adjust]) cylinder(d=3,h=(floorthick*3)+(adjust*2));
|
||||
translate([86+hd25_xloc,4.07+hd25_yloc,-adjust]) cylinder(d=3,h=(floorthick*3)+(adjust*2));
|
||||
translate([86+hd25_xloc,65.79+hd25_yloc,-adjust]) cylinder(d=3,h=(floorthick*3)+(adjust*2));
|
||||
translate([9.4+hd25_xloc,65.79+hd25_yloc,-adjust]) cylinder(d=3,h=(floorthick*3)+(adjust*2));
|
||||
|
||||
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,-adjust]) cylinder(d1=6.5, d2=3, h=3);
|
||||
translate([86+hd25_xloc,4.07+hd25_yloc,-adjust]) cylinder(d1=6.5, d2=3, h=3);
|
||||
translate([86+hd25_xloc,65.79+hd25_yloc,-adjust]) cylinder(d1=6.5, d2=3, h=3);
|
||||
translate([9.4+hd25_xloc,65.79+hd25_yloc,-adjust]) cylinder(d1=6.5, d2=3, h=3);
|
||||
|
||||
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,-adjust,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
|
||||
translate([76,-adjust,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
|
||||
translate([117.5,-adjust,7]) rotate([-90,0,0]) cylinder(d=3.6,h=7);
|
||||
translate([117.5,hd35_y+adjust,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
|
||||
translate([76,hd35_y+adjust,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
|
||||
translate([16,hd35_y+adjust,7]) rotate([90,0,0]) cylinder(d=3.6,h=7);
|
||||
|
||||
// side nut trap
|
||||
translate([16,wallthick-adjust,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
|
||||
translate([76,wallthick-adjust,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
|
||||
translate([117.5,wallthick-adjust,7]) rotate([-90,0,0]) cylinder(r=3.30,h=5,$fn=6);
|
||||
translate([117.5,hd35_y-wallthick-adjust,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
|
||||
translate([76,hd35_y-wallthick-adjust,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
|
||||
translate([16,hd35_y-wallthick-adjust,7]) rotate([90,0,0]) cylinder(r=3.30,h=5,$fn=6);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,39 @@
|
||||
/*
|
||||
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
|
||||
|
||||
pcb_holder(size,wallthick)
|
||||
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
|
||||
|
||||
pcb_holder(size, wallthick)
|
||||
nut_holder(nut, style, dia_x, dia_y, height)
|
||||
vu_holder(vu_model,side,vesa,cheight)
|
||||
vu_holder(vu_model, side, vesa, cheight)
|
||||
|
||||
*/
|
||||
|
||||
// pcb bottom edge holder
|
||||
module pcb_holder(size,wallthick) {
|
||||
|
||||
/*
|
||||
NAME: pcb_holder
|
||||
DESCRIPTION: pcb bottom edge holder
|
||||
TODO: none
|
||||
|
||||
USAGE: pcb_holder(size, wallthick)
|
||||
|
||||
size = width of holder
|
||||
wallthick = holder wall thickness
|
||||
*/
|
||||
|
||||
module pcb_holder(size, wallthick) {
|
||||
|
||||
adjust=.01;
|
||||
$fn = 90;
|
||||
difference() {
|
||||
@@ -31,19 +56,25 @@ module pcb_holder(size,wallthick) {
|
||||
}
|
||||
translate([-.5,0,2]) cube([size[0]+1,size[2],5]);
|
||||
translate([6,-adjust-5-1.75,-adjust]) cube([size[0]-12,14,8]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 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) {
|
||||
|
||||
/*
|
||||
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
|
||||
@@ -51,7 +82,7 @@ nuts = [[2,4,1.6], // m2 size, diameter, height
|
||||
[4,7,3.2]]; // m4 size, diameter, height
|
||||
|
||||
$fn = 180;
|
||||
|
||||
|
||||
if( style == "default") {
|
||||
difference() {
|
||||
cylinder(d=dia_x, h=height);
|
||||
@@ -130,7 +161,21 @@ $fn = 180;
|
||||
}
|
||||
}
|
||||
|
||||
module vu_holder(vu_model,side,vesa,cheight) {
|
||||
|
||||
/*
|
||||
NAME: vu_holder
|
||||
DESCRIPTION: hk vu5,vu5a,vu7,vu7a display holder
|
||||
TODO: none
|
||||
|
||||
USAGE: vu_holder(vu_model, side, vesa, cheight)
|
||||
|
||||
vu_model = "vu5", "vu7"
|
||||
side = "left", "right"
|
||||
vesa = 75 for vu5, 100 for vu7
|
||||
cheight = case_z+90 for vu5, case_z+122 for vu7
|
||||
*/
|
||||
|
||||
module vu_holder(vu_model, side, vesa, cheight) {
|
||||
|
||||
//cheight = case_z+90;
|
||||
v_fillet = 3;
|
||||
|
||||
@@ -1,12 +1,35 @@
|
||||
/*
|
||||
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
|
||||
|
||||
keyhole(keysize, mask = false)
|
||||
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: keyhole
|
||||
DESCRIPTION: enclosed keyhole
|
||||
TODO: none
|
||||
|
||||
USAGE: keyhole(keysize, mask = false)
|
||||
|
||||
keysize[0] = size_x
|
||||
keysize[1] = size_y
|
||||
keysize[2] = size_z
|
||||
mask = true, false enable mask
|
||||
*/
|
||||
|
||||
// enclosed keyhole
|
||||
module keyhole(keysize, mask = false) {
|
||||
|
||||
|
||||
adjust=.01;
|
||||
$fn = 90;
|
||||
|
||||
@@ -25,22 +48,22 @@ module keyhole(keysize, mask = false) {
|
||||
difference() {
|
||||
translate([-keysize[2], -keysize[2], keysize[3]]) cube([keysize[2]*3, keysize[2]*3, 4.5]);
|
||||
translate([0, -10, 0]) rotate([0, 0, 135]) cube([20, 10, 10]);
|
||||
translate([keysize[2], keysize[2], -adjust]) cube([keysize[2]*3, keysize[2]*3, keysize[3]+5]);
|
||||
translate([keysize[2], keysize[2], -adjust]) cube([keysize[2]*3, keysize[2]*3, keysize[3]+5]);
|
||||
}
|
||||
difference() {
|
||||
translate([-keysize[2]+2, -keysize[2]+2, keysize[3]-adjust])
|
||||
cube([-4+keysize[2]*3, -4+keysize[2]*3, 3.5]);
|
||||
translate([2, -10, 0]) rotate([0, 0, 135]) cube([20, 10, 10]);
|
||||
translate([+keysize[2]-2, keysize[2]-2, -adjust])
|
||||
cube([keysize[2]*3, keysize[2]*3, keysize[3]+5]);
|
||||
cube([keysize[2]*3, keysize[2]*3, keysize[3]+5]);
|
||||
}
|
||||
}
|
||||
difference() {
|
||||
difference() {
|
||||
translate([-keysize[2], -keysize[2], 0]) cube([keysize[2]*3, keysize[2]*3, keysize[3]]);
|
||||
translate([0, -10, -adjust]) rotate([0, 0, 135]) cube([20, 10, 10]);
|
||||
}
|
||||
}
|
||||
}
|
||||
translate([keysize[2], keysize[2], -adjust]) cube([keysize[2]*3, keysize[2]*3, keysize[3]+2*adjust]);
|
||||
translate([keysize[2], keysize[2], -adjust]) cube([keysize[2]*3, keysize[2]*3, keysize[3]+2*adjust]);
|
||||
union() {
|
||||
translate([0, 0, -adjust]) cylinder(h=keysize[3]+2*adjust, d=keysize[0]);
|
||||
translate([-keysize[1]/2, 0, -adjust]) cube([keysize[1], keysize[2]+keysize[0]/2, keysize[3]+2*adjust]);
|
||||
|
||||
792
lib/oem_hk.scad
792
lib/oem_hk.scad
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,38 @@
|
||||
/*
|
||||
pcb_pad(pads = 1, style = "round")
|
||||
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"
|
||||
*/
|
||||
|
||||
// single row pcb pad
|
||||
module pcb_pad(pads = 1, style = "round") {
|
||||
|
||||
adjust = .01;
|
||||
$fn = 90;
|
||||
pad_size = 1.25;
|
||||
size_y = 2.54;
|
||||
size_x = 2.54 * (pads-1);
|
||||
size_x = 2.54 * (pads-1);
|
||||
union() {
|
||||
for (i=[0:2.54:size_x]) {
|
||||
if(style == "round") {
|
||||
|
||||
189
lib/shape.scad
189
lib/shape.scad
@@ -1,4 +1,19 @@
|
||||
/*
|
||||
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)
|
||||
@@ -9,7 +24,17 @@
|
||||
|
||||
*/
|
||||
|
||||
/* slab module */
|
||||
/*
|
||||
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];
|
||||
@@ -17,17 +42,27 @@ module slab(size, radius) {
|
||||
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([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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* multi-radius round slab */
|
||||
/*
|
||||
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];
|
||||
@@ -38,78 +73,114 @@ module slab_r(size, radius) {
|
||||
|
||||
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([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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* slot module */
|
||||
module slot(hole,length,depth) {
|
||||
|
||||
/*
|
||||
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);
|
||||
translate([length,0,0]) cylinder(d=hole,h=depth);
|
||||
}
|
||||
}
|
||||
|
||||
// knockout opening
|
||||
module knockout(width,depth,gap,thick,fillet,shape) {
|
||||
|
||||
adjust = .01;
|
||||
|
||||
/*
|
||||
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 punchout
|
||||
// slot knockout
|
||||
if(shape == "slot") {
|
||||
difference() {
|
||||
translate([0,0,0]) slot(depth,width,thick);
|
||||
translate([0,0,-adjust]) slot(depth-gap,width,thick+(2*adjust));
|
||||
slot(depth, width, thick);
|
||||
translate([gap/2, 0, -adj]) slot(depth-gap, width-gap, thick+(2*adj));
|
||||
// cross ties
|
||||
translate([-1,-(depth/2)-1,-adjust]) cube([2,depth+2,thick+(2*adjust)]);
|
||||
translate([(width/2)-1-(width/4)+4,-(depth/2)-1,-adjust]) cube([2,depth+2,thick+(2*adjust)]);
|
||||
translate([(width/2)-1+(width/4)-4,-(depth/2)-1,-adjust]) cube([2,depth+2,thick+(2*adjust)]);
|
||||
translate([width-1,-(depth/2)-1,-adjust]) cube([2,depth+2,thick+(2*adjust)]);
|
||||
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)-adjust])
|
||||
cube_fillet_inside([width-gap,depth-gap,thick+(3*adjust)],
|
||||
vertical=[fillet,fillet,fillet,fillet],
|
||||
top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||
// cross ties
|
||||
translate([-1,(depth/2)-1,-adjust]) cube([gap+2,2,thick+(2*adjust)]);
|
||||
translate([width-4,depth-gap-1,-adjust]) cube([2,gap+2,thick+(2*adjust)]);
|
||||
translate([2,depth-gap-1,-adjust]) cube([2,gap+2,thick+(2*adjust)]);
|
||||
translate([width-gap-1,(depth/2)-1,-adjust]) cube([gap+2,2,thick+(2*adjust)]);
|
||||
translate([width-4,-1,-adjust]) cube([2,gap+2,thick+(2*adjust)]);
|
||||
translate([2,-1,-adjust]) cube([2,gap+2,thick+(2*adjust)]);
|
||||
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),-adjust])
|
||||
cylinder(d=width-gap, h=thick+2*adjust);
|
||||
translate([(width/2), (width/2), -adj])
|
||||
cylinder(d=width-gap, h=thick+2*adj);
|
||||
// cross ties
|
||||
translate([-1,(depth/2)-1,-adjust]) cube([gap+2,2,thick+(2*adjust)]);
|
||||
translate([(width/2)-1,depth-gap-1,-adjust]) cube([2,gap+2,thick+(2*adjust)]);
|
||||
translate([width-gap-1,(depth/2)-1,-adjust]) cube([gap+2,2,thick+(2*adjust)]);
|
||||
translate([(width/2)-1,-1,-adjust]) cube([2,gap+2,thick+(2*adjust)]);
|
||||
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)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* hdmi opening */
|
||||
|
||||
/*
|
||||
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() {
|
||||
@@ -121,7 +192,7 @@ module hdmi_open(hdmi_style) {
|
||||
}
|
||||
}
|
||||
if(hdmi_style == "hdmi_micro") {
|
||||
union() {
|
||||
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);
|
||||
@@ -140,19 +211,27 @@ module hdmi_open(hdmi_style) {
|
||||
}
|
||||
if(hdmi_style=="dp_mini") {
|
||||
size_x = 9;
|
||||
size_y = 8;
|
||||
union() {
|
||||
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]);
|
||||
translate([10,-7,-5]) rotate([0,-45,0]) cube([size_x, size_y+2, 5.6]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* micro-usb opening */
|
||||
/*
|
||||
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])
|
||||
|
||||
@@ -1,20 +1,46 @@
|
||||
/*
|
||||
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
|
||||
|
||||
standoff(standoff[radius,height,holesize,supportsize,supportheight,sink,style,i_dia,i_depth])
|
||||
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: standoff
|
||||
DESCRIPTION: create standoffs
|
||||
TODO: none
|
||||
|
||||
USAGE: standoff(stand_off)
|
||||
|
||||
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]
|
||||
*/
|
||||
|
||||
/* standoff module
|
||||
standoff(standoff[radius,height,holesize,supportsize,supportheight,sink,style,reverse,insert_e,i_dia,i_depth])
|
||||
sink=0 none
|
||||
sink=1 countersink
|
||||
sink=2 recessed hole
|
||||
sink=3 nut holder
|
||||
sink=4 blind hole
|
||||
|
||||
style=0 hex shape
|
||||
style=1 cylinder
|
||||
*/
|
||||
module standoff(stand_off){
|
||||
|
||||
radius = stand_off[0];
|
||||
@@ -28,9 +54,9 @@ module standoff(stand_off){
|
||||
insert_e = stand_off[8];
|
||||
i_dia = stand_off[9];
|
||||
i_depth = stand_off[10];
|
||||
|
||||
|
||||
adjust = 0.1;
|
||||
|
||||
|
||||
difference (){
|
||||
union () {
|
||||
if(style == 0 && reverse == 0) {
|
||||
|
||||
@@ -1,12 +1,43 @@
|
||||
/*
|
||||
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
|
||||
|
||||
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);
|
||||
|
||||
*/
|
||||
|
||||
// vent opening
|
||||
module vent(width,length,height,gap,rows,columns,orientation) {
|
||||
/*
|
||||
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;
|
||||
adjust = .01;
|
||||
@@ -18,7 +49,7 @@ module vent(width,length,height,gap,rows,columns,orientation) {
|
||||
for (c=[0:width+(2*gap):(columns*(width+(2*gap)))-1]) {
|
||||
translate ([c,r,-1]) cube([width,length,height]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// horizontal orientation
|
||||
if(orientation == "horizontal") {
|
||||
@@ -30,7 +61,23 @@ module vent(width,length,height,gap,rows,columns,orientation) {
|
||||
}
|
||||
}
|
||||
|
||||
// Hex vent opening
|
||||
|
||||
/*
|
||||
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);
|
||||
@@ -53,14 +100,23 @@ module vent_hex(cells_x, cells_y, thickness, cell_size, cell_spacing, orientatio
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
NAME: vent_panel_hex
|
||||
DESCRIPTION: creates hex vent panel
|
||||
TODO: none
|
||||
|
||||
USAGE: vent_panel_hex(x, y, thick, cell_size=8, cell_spacing=3, border=3, borders="default")
|
||||
|
||||
x = #rows
|
||||
y = #columns
|
||||
thick = pattern thickness
|
||||
cell_size = size of hex
|
||||
cell_spacing = space between hex
|
||||
border = size of borber
|
||||
borders = "none", "default"
|
||||
|
||||
*/
|
||||
|
||||
/* hex vent panel */
|
||||
// borders:
|
||||
// y - specified size along y axis
|
||||
// x - specified size along x axis
|
||||
// none - both borders the size of cell_spacing, no mounting holes
|
||||
// anything else ("default") - all borders of specified size
|
||||
//
|
||||
module vent_panel_hex(x, y, thick, cell_size=8, cell_spacing=3, border=3, borders="default") {
|
||||
hole = 3.2;
|
||||
xb = (borders == "y" || borders == "none") ? cell_spacing : border;
|
||||
@@ -75,13 +131,13 @@ module vent_panel_hex(x, y, thick, cell_size=8, cell_spacing=3, border=3, border
|
||||
|
||||
difference() {
|
||||
color("grey",1) slab([x,y,thick],2);
|
||||
color("grey",1) translate([(x-csx)/2,(y-csy)/2,-1])
|
||||
color("grey",1) translate([(x-csx)/2,(y-csy)/2,-1])
|
||||
vent_hex(cells_x, cells_y, thick+3, cell_size, cell_spacing, "horizontal");
|
||||
if (borders != "none") {
|
||||
color("grey",1) translate([ hxb, hyb, -1]) cylinder(d=hole, h=thick+3);
|
||||
color("grey",1) translate([x - hxb, hyb, -1]) cylinder(d=hole, h=thick+3);
|
||||
color("grey",1) translate([ hxb, y - hyb, -1]) cylinder(d=hole, h=thick+3);
|
||||
color("grey",1) translate([x - hxb, y - hyb, -1]) cylinder(d=hole, h=thick+3);
|
||||
}
|
||||
if (borders != "none") {
|
||||
color("grey",1) translate([ hxb, hyb, -1]) cylinder(d=hole, h=thick+3);
|
||||
color("grey",1) translate([x - hxb, hyb, -1]) cylinder(d=hole, h=thick+3);
|
||||
color("grey",1) translate([ hxb, y - hyb, -1]) cylinder(d=hole, h=thick+3);
|
||||
color("grey",1) translate([x - hxb, y - hyb, -1]) cylinder(d=hole, h=thick+3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user