initial work for integrating sbc model framework v2
This commit is contained in:
104
lib/access_panel.scad
Normal file
104
lib/access_panel.scad
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
access_port(size[],orientation)
|
||||||
|
access_cover(size[],orientation)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* access port and support */
|
||||||
|
module access_port(size,orientation) {
|
||||||
|
|
||||||
|
floorthick = size[2];
|
||||||
|
adjust = .01;
|
||||||
|
$fn = 90;
|
||||||
|
if(orientation == "portrait") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([0,0,0]) cube([size[0],size[1],size[2]]);
|
||||||
|
// access panel support
|
||||||
|
translate([(size[0]/2)+.25,size[1]-6.5,0]) cylinder(d=9,h=floorthick+(adjust*2)+5);
|
||||||
|
translate([(size[0]/2)-10,size[1]-11,floorthick-adjust]) cube([20,9.5,floorthick]);
|
||||||
|
translate([1,0,floorthick-adjust]) cube([size[0]-2,5,4.5]);
|
||||||
|
}
|
||||||
|
// access opening
|
||||||
|
translate([.5,6,-adjust]) cube([size[0]-1.15,size[1]-17,floorthick+(adjust*2)]);
|
||||||
|
translate([(size[0]/2)-5,size[1]-12,-adjust]) slab([10.5,5.5,floorthick],5.5);
|
||||||
|
translate([(size[0]/2)+.25,size[1]-6.5,floorthick+2])
|
||||||
|
cylinder(r=3.2,h=floorthick+(adjust*2)+5,$fn=6);
|
||||||
|
translate([(size[0]/2)+.25,size[1]-6.5,-adjust])
|
||||||
|
cylinder(d=3.2,h=floorthick+(adjust*2)+5);
|
||||||
|
translate([4,2+adjust,floorthick]) cube([7.75,3,2.75]);
|
||||||
|
translate([size[0]-13,2+adjust,floorthick]) cube([7.75,3,2.75]);
|
||||||
|
if(size[0] > 100) {
|
||||||
|
translate([(size[0]/2),2+adjust,floorthick]) cube([7.75,3,2.75]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(orientation == "landscape") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([0,-1,0]) cube([size[0],size[1],size[2]]);
|
||||||
|
// access panel support
|
||||||
|
translate([size[0]-6.5,(size[1]/2)-.5,0]) cylinder(d=9,h=floorthick+(adjust*2)+5);
|
||||||
|
translate([size[0]-11,(size[1]/2)-10.5,floorthick-adjust]) cube([9.5,20,floorthick]);
|
||||||
|
translate([0,0,floorthick-adjust]) cube([5,size[1]-2,4.5]);
|
||||||
|
}
|
||||||
|
// access opening
|
||||||
|
translate([6,-.5,-adjust]) cube([size[0]-17,size[1]-1.15,floorthick+(adjust*3)]);
|
||||||
|
translate([size[0]-12,(size[1]/2)-6,-adjust]) slab([5.5,10.5,floorthick],5.5);
|
||||||
|
translate([size[0]-6.5,(size[1]/2)-.5,floorthick+2]) rotate([0,0,30])
|
||||||
|
cylinder(r=3.2,h=floorthick+(adjust*2)+5,$fn=6);
|
||||||
|
translate([size[0]-6.5,(size[1]/2)-.5,-adjust])
|
||||||
|
cylinder(d=3.2,h=floorthick+(adjust*2)+5);
|
||||||
|
translate([2+adjust,3,floorthick]) cube([3,8.25,2.75]);
|
||||||
|
translate([2+adjust,size[1]-13,floorthick]) cube([3,8.25,2.75]);
|
||||||
|
if(size[1] > 100) {
|
||||||
|
translate([2+adjust,(size[1]/2)-(7.75/2)-1.25,floorthick]) cube([3,7.75,2.5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* access cover and support */
|
||||||
|
module access_cover(size,orientation) {
|
||||||
|
|
||||||
|
floorthick = size[2];
|
||||||
|
adjust = .01;
|
||||||
|
$fn = 90;
|
||||||
|
if(orientation == "portrait") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([1,6.25,0]) cube([size[0]-2.15,size[1]-17.5,floorthick]);
|
||||||
|
translate([(size[0]/2)-4.75,size[1]-12.25,0]) slab([10,5,floorthick], 5);
|
||||||
|
translate([1,6.25,floorthick-adjust]) cube([size[0]-2.15,6,floorthick]);
|
||||||
|
translate([4.25,3,floorthick]) cube([7.25,4,2]);
|
||||||
|
translate([size[0]-12.75,3,floorthick]) cube([7.25,4,2]);
|
||||||
|
if(size[0] > 100) {
|
||||||
|
translate([(size[0]/2)+.25,3,floorthick]) cube([7.25,4,2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
translate([(size[0]/2)+.25,size[1]-6.5,-floorthick-adjust])
|
||||||
|
cylinder(d=3.2,h=(floorthick*2)+(adjust*2));
|
||||||
|
translate([(size[0]/2)+.25,size[1]-6.5,-floorthick-adjust+floorthick])
|
||||||
|
cylinder(d1=6, d2=3.2, h=floorthick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(orientation == "landscape") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([6.25,0,0]) cube([size[0]-17.75,size[1]-2,floorthick]);
|
||||||
|
translate([size[0]-12.25,(size[1]/2)-5.75,0]) slab([5,10,floorthick], 5);
|
||||||
|
translate([6.25,0,floorthick-adjust]) cube([6,size[1]-2.15,floorthick]);
|
||||||
|
translate([3.5+adjust,3.25,floorthick]) cube([4,7.25,2]);
|
||||||
|
translate([3.5+adjust,size[1]-12.75,floorthick]) cube([4,7.25,2]);
|
||||||
|
if(size[1] > 100) {
|
||||||
|
translate([3.5+adjust,(size[1]/2)-(7.75/2)-1,floorthick]) cube([4,7.25,2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
translate([size[0]-6.5,(size[1]/2)-.75,-floorthick-adjust])
|
||||||
|
cylinder(d=3.2,h=(floorthick*2)+(adjust*2));
|
||||||
|
translate([size[0]-6.5,(size[1]/2)-.75,-floorthick-adjust+floorthick])
|
||||||
|
cylinder(d1=6, d2=3.2, h=floorthick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
lib/art.scad
Normal file
12
lib/art.scad
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
art(scale_d1,type,size_z)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* art work module */
|
||||||
|
module art(scale_d1,size_z,type) {
|
||||||
|
|
||||||
|
linear_extrude(height = size_z) import(file = type, scale=scale_d1);
|
||||||
|
|
||||||
|
}
|
||||||
86
lib/battery.scad
Normal file
86
lib/battery.scad
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
battery(type)
|
||||||
|
battery_clip(bat_dia = 18.4)
|
||||||
|
batt_holder(tolerance)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
module battery(type) {
|
||||||
|
|
||||||
|
adj = .01;
|
||||||
|
if(type == "18650") {
|
||||||
|
difference() {
|
||||||
|
cylinder(d=18.4, h=65);
|
||||||
|
translate([0,0,65-4]) difference() {
|
||||||
|
cylinder(d=18.5, h=2);
|
||||||
|
cylinder(d=17.5, h=3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(type == "18650_convex") {
|
||||||
|
difference() {
|
||||||
|
cylinder(d=18.4, h=68);
|
||||||
|
translate([0,0,65-4]) difference() {
|
||||||
|
cylinder(d=18.5, h=2);
|
||||||
|
cylinder(d=17.5, h=3);
|
||||||
|
}
|
||||||
|
translate([0,0,65-adj]) difference() {
|
||||||
|
cylinder(d=18.5, h=3+2*adj);
|
||||||
|
cylinder(d=14.4, h=3+2*adj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(type == "21700") {
|
||||||
|
difference() {
|
||||||
|
cylinder(d=21, h=70);
|
||||||
|
translate([0,0,70-4]) difference() {
|
||||||
|
cylinder(d=21.1, h=2);
|
||||||
|
cylinder(d=20.1, h=3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module battery_clip(bat_dia = 18.4) {
|
||||||
|
|
||||||
|
mat = .38;
|
||||||
|
width = 9.5;
|
||||||
|
tab = 8.9;
|
||||||
|
bat_holder = bat_dia+2*mat;
|
||||||
|
adj = .1;
|
||||||
|
|
||||||
|
translate([-5.5,0,10.5]) {
|
||||||
|
difference() {
|
||||||
|
translate([0,width,0]) rotate([90,0,0]) cylinder(d=bat_holder, h=9.5);
|
||||||
|
translate([0,width+adj,0]) rotate([90,0,0]) cylinder(d=bat_dia, h=10.5);
|
||||||
|
translate([mat/2-11.1/2,-adj,mat-1.3-bat_dia/2]) cube([11.1-mat,width+2*adj,3]);
|
||||||
|
translate([0,width+adj,0]) rotate([90,-45,0]) cube([bat_dia,bat_dia,bat_holder]);
|
||||||
|
}
|
||||||
|
difference() {
|
||||||
|
translate([-11.1/2,0,-1.3-bat_dia/2]) cube([11.1,width,3]);
|
||||||
|
translate([mat-11.1/2,-adj,mat/2-1.3-bat_dia/2]) cube([11.1-2*mat,width+2*adj,3]);
|
||||||
|
}
|
||||||
|
difference() {
|
||||||
|
translate([-(tab/2),-3.5,-1-bat_dia/2]) rotate([-5,0,0]) cube([tab,3.5,10]);
|
||||||
|
translate([-(tab/2)-adj,-3.5+mat,mat-1-bat_dia/2]) rotate([-5,0,0]) cube([tab+2*adj,3.5+mat,10]);
|
||||||
|
}
|
||||||
|
translate([0,-2.225,0]) rotate([85,0,0]) cylinder(d=tab, h=mat);
|
||||||
|
difference() {
|
||||||
|
translate([0,-2.75,0]) sphere(d=3);
|
||||||
|
translate([-5,-2.75,-5]) rotate([85,0,0]) cube([tab,10,10]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module batt_holder(tolerance) {
|
||||||
|
|
||||||
|
$fn = 90;
|
||||||
|
difference () {
|
||||||
|
cylinder(d=25.5,h=6);
|
||||||
|
translate ([0,0,-1]) cylinder(d=20.4+tolerance,h=8);
|
||||||
|
cube([14,26,13], true);
|
||||||
|
}
|
||||||
|
cylinder(r=12.75, h=2);
|
||||||
|
}
|
||||||
|
|
||||||
112
lib/button.scad
Normal file
112
lib/button.scad
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
/*
|
||||||
|
button(style, diameter, height)
|
||||||
|
button_assembly(style, diameter, height
|
||||||
|
button_plunger(style, diameter, height)
|
||||||
|
button_top(style, diameter, height)
|
||||||
|
button_clip(style)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* buttons */
|
||||||
|
module button(style, size, radius, pad) {
|
||||||
|
|
||||||
|
diameter = size[0];
|
||||||
|
height = size[2];
|
||||||
|
gap = 1.5;
|
||||||
|
adjust = .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(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]);
|
||||||
|
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]]);
|
||||||
|
translate([-size[0]+3+(gap/2),-size[1]/2+(gap/2),-1]) slab_r([size[0]-gap,size[1]-gap,1+size[2]+2*adjust],
|
||||||
|
[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*adjust]);
|
||||||
|
}
|
||||||
|
translate([0,0,2]) sphere(d=3);
|
||||||
|
}
|
||||||
|
translate([0,0,-pad+adjust]) cylinder(d=3, h=pad);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* button plunger,top,clip */
|
||||||
|
module button_assembly(style, diameter, height) {
|
||||||
|
|
||||||
|
adjust = .01;
|
||||||
|
$fn = 90;
|
||||||
|
|
||||||
|
if(style == "recess") {
|
||||||
|
button_plunger(style, diameter, height);
|
||||||
|
button_top(style, diameter, height);
|
||||||
|
translate([0,0,-height]) button_clip(style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* button plunger */
|
||||||
|
module button_plunger(style, diameter, height) {
|
||||||
|
|
||||||
|
adjust = .01;
|
||||||
|
$fn = 90;
|
||||||
|
|
||||||
|
if(style == "recess") {
|
||||||
|
difference() {
|
||||||
|
translate([-1.5,-1,-(height)-2]) cube([3,2,height+1]);
|
||||||
|
translate([-1.5-adjust,-1.5,-height]) cube([.5,3,1]);
|
||||||
|
translate([1+adjust,-1.5,-height]) cube([.5,3,1]);
|
||||||
|
translate([-1.5-adjust,-1.5,-4]) cube([.5,3,4]);
|
||||||
|
translate([1+adjust,-1.5,-4]) cube([.5,3,4]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* button top */
|
||||||
|
module button_top(style, diameter, height) {
|
||||||
|
|
||||||
|
adjust = .01;
|
||||||
|
$fn = 90;
|
||||||
|
|
||||||
|
if(style == "recess") {
|
||||||
|
difference() {
|
||||||
|
translate([0,0,-3]) cylinder(d=5, h=2.75);
|
||||||
|
translate([-1.25,-1.25,-3-adjust]) cube([2.5,2.5,2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* button c-clip */
|
||||||
|
module button_clip(style) {
|
||||||
|
|
||||||
|
adjust = .01;
|
||||||
|
$fn = 90;
|
||||||
|
|
||||||
|
if(style == "recess") {
|
||||||
|
difference() {
|
||||||
|
cylinder(d=8.5, h=.8);
|
||||||
|
translate([-1.5,-1.75,-adjust]) cube([2.75,3.5,1]);
|
||||||
|
translate([-.75,-.75,-adjust]) cube([5,1.25,1.25]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
lib/cable_holder.scad
Normal file
19
lib/cable_holder.scad
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
cableholder_spacer()
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
module cableholder_spacer() {
|
||||||
|
|
||||||
|
size = [9.4,16,6];
|
||||||
|
$fn = 90;
|
||||||
|
translate([0,size[2]/2,-5]) rotate([90,0,0])
|
||||||
|
difference() {
|
||||||
|
translate([size[0]/2,size[0]/2,0]) rotate([0,0,90]) slot(size[0],size[1],size[2]);
|
||||||
|
translate([-1,5,3]) rotate([0,90,0]) cylinder(d=3.2, h=12);
|
||||||
|
translate([-1,7.5,-1]) cube([2,20,9]);
|
||||||
|
translate([5,9.5,-1]) rotate([0,0,90]) slot(4.5,11,9);
|
||||||
|
translate([3,20,-1]) rotate([0,0,45]) cube([2,6,9]);
|
||||||
|
}
|
||||||
|
}
|
||||||
313
lib/component.scad
Normal file
313
lib/component.scad
Normal file
@@ -0,0 +1,313 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// hdmi a female
|
||||||
|
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) {
|
||||||
|
|
||||||
|
adjust = .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+adjust]) 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() {
|
||||||
|
|
||||||
|
adjust = .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-adjust]) cube([size_x,size_y,.1]);
|
||||||
|
color("black") translate([2.25,2.25,3.1-adjust]) 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) {
|
||||||
|
|
||||||
|
adjust = .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() {
|
||||||
|
|
||||||
|
adjust = .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+adjust);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// can capacitor
|
||||||
|
module capacitor(diameter, height) {
|
||||||
|
adjust = .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) {
|
||||||
|
|
||||||
|
adjust=.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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
80
lib/custom.scad
Normal file
80
lib/custom.scad
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
h3_port_extender(style, mask = false)
|
||||||
|
h3_port_extender_holder(part,offset)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// @mctom's odroid-h3 gpio port extender
|
||||||
|
module h3_port_extender(style, mask = false) {
|
||||||
|
|
||||||
|
adjust=.01;
|
||||||
|
$fn = 90;
|
||||||
|
|
||||||
|
if(style == "header") {
|
||||||
|
if(mask == true) {
|
||||||
|
translate([-20, 6.25, 15]) cube([12, 7.5, 14.75]);
|
||||||
|
translate([-20, 15.875, 15]) cube([12, 7.5, 14.75]);
|
||||||
|
translate([-20, 25.375, 15]) cube([12, 7.5, 14.75]);
|
||||||
|
translate([-20, 17, 32.2]) rotate([0, 90, 0]) cylinder(d=3.5, h=12);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// gpio 24 pin front position
|
||||||
|
color("silver") translate([1.6, 188.5, 84]) rotate([90, 0, 270]) import("stl/h3_port_extender.stl");
|
||||||
|
// color("dimgrey") translate([-3, 15.75, 0.25]) rotate([90, 180, 180]) import("stl/header_f_2x12_90.stl");
|
||||||
|
translate([0, 2, 8.25]) rotate([0, 180, 0]) header_f(12,8);
|
||||||
|
translate([-2.54, 2, 8.25]) rotate([0, 180, 0]) header_f(12,8);
|
||||||
|
color("dimgrey") translate([-2.5, 0, 29.5]) rotate([270, 0, 90]) import("stl/header_2x2_90.stl");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(style == "remote") {
|
||||||
|
if(mask == true) {
|
||||||
|
translate([-19, 6.25, 15]) cube([12,7.5,14.75]);
|
||||||
|
translate([-19, 15.875, 15]) cube([12,7.5,14.75]);
|
||||||
|
translate([-19, 25.375, 15]) cube([12,7.5,14.75]);
|
||||||
|
translate([-19, 17, 32.2]) rotate([0,90,0]) cylinder(d=2.5, h=12);
|
||||||
|
translate([-19, 17, 4.6]) rotate([0,90,0]) cylinder(d=2.5, h=12);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// gpio 24 pin front position
|
||||||
|
color("silver") translate([1.6, 188.5, 84]) rotate([90, 0, 270]) import("stl/h3_port_extender.stl");
|
||||||
|
color("dimgrey") translate([-2.5, 0, 29.5]) rotate([270, 0, 90]) import("stl/header_2x2_90.stl");
|
||||||
|
color("dimgrey")translate([9,-.5,12.75]) rotate([0,270,90]) import("stl/header_encl_2x5_90.stl");
|
||||||
|
translate([2, 2, 14.08]) rotate([0, 90, 0]) header(12);
|
||||||
|
translate([2, 2, 11.54]) rotate([0, 90, 0]) header(12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
// 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
|
||||||
|
*/
|
||||||
|
module h3_port_extender_holder(part,offset=2) {
|
||||||
|
|
||||||
|
adjust = .01;
|
||||||
|
size = [16-offset,40,5.5];
|
||||||
|
if(part == "bottom" || part == "both") {
|
||||||
|
difference() {
|
||||||
|
translate([-10+offset,-3.5,2]) cube(size);
|
||||||
|
translate([-.25,-.25,-adjust]) cube([2.5, 33.25, 12]);
|
||||||
|
translate([2, 2, -adjust]) cube([10, 28, 12]);
|
||||||
|
translate([-12,(33.25/2)+.25,4.5]) rotate([0,90,0]) cylinder(d=2.7, h=20, $fn=60);
|
||||||
|
// translate([-7,-1.,-adjust]) cylinder(d=4.25, h=20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(part == "top" || part == "both") {
|
||||||
|
difference() {
|
||||||
|
translate([-10+offset,-3.5,29.5]) cube(size);
|
||||||
|
translate([-.25,-.25,28]) cube([2.5, 33.25, 12]);
|
||||||
|
translate([1.5, 2, 27.5-adjust]) cube([10, 28.5, 12]);
|
||||||
|
translate([-12, -4, 28]) cube([20, 13, 10]);
|
||||||
|
translate([1.35, 20, 25.5]) cube([10, 13, 5]);
|
||||||
|
translate([-12,(33.25/2)+.25,32]) rotate([0,90,0]) cylinder(d=2.7, h=20, $fn=60);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
208
lib/fan.scad
Normal file
208
lib/fan.scad
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
fan_cover(size, thick)
|
||||||
|
fan_mask(size, thick, style)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* fan cover */
|
||||||
|
module fan_cover(size, thick) {
|
||||||
|
difference() {
|
||||||
|
color("grey",1) slab([size,size,thick],3);
|
||||||
|
color("grey",1) fan_mask(size, thick, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fan mask to create opening */
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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([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) {
|
||||||
|
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, -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
48
lib/fastener.scad
Normal file
48
lib/fastener.scad
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
m_insert(type="M3", icolor = "#ebdc8b")
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// General purpose screw
|
||||||
|
// screw(screw[d, l, style])
|
||||||
|
// d - thread diameter
|
||||||
|
// l - thread length
|
||||||
|
// style - screw head style
|
||||||
|
//
|
||||||
|
// Styles:
|
||||||
|
// 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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Thread
|
||||||
|
rotate([180,0,0]) cylinder(d=d, h=l);
|
||||||
|
}
|
||||||
15
lib/feet.scad
Normal file
15
lib/feet.scad
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
feet (height)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* case feet */
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
592
lib/hd.scad
Normal file
592
lib/hd.scad
Normal file
@@ -0,0 +1,592 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
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)
|
||||||
|
hd25(height)
|
||||||
|
hd35()
|
||||||
|
hdd35_25holder(length)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
module hd_mount(hd,orientation,position,side) {
|
||||||
|
|
||||||
|
adjust = .01;
|
||||||
|
$fn = 90;
|
||||||
|
if(hd == 2.5) {
|
||||||
|
if(orientation == "portrait") {
|
||||||
|
if(position == "vertical") {
|
||||||
|
if(side == "left") {
|
||||||
|
translate([0,14,0]) rotate([0,0,0]) hd25_vtab("right");
|
||||||
|
translate([0,90.6,0]) rotate([0,0,0]) hd25_vtab("right");
|
||||||
|
}
|
||||||
|
else { // right
|
||||||
|
translate([0,14,0]) rotate([0,0,0]) hd25_vtab("left");
|
||||||
|
translate([0,90.6,0]) rotate([0,0,0]) hd25_vtab("left");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([-.5,14,0]) hd25_tab("left");
|
||||||
|
translate([-.5,90.6,0]) hd25_tab("left");
|
||||||
|
translate([70.35,14,0]) hd25_tab("right");
|
||||||
|
translate([70.35,90.6,0]) hd25_tab("right");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(orientation == "landscape") {
|
||||||
|
if(position == "vertical") {
|
||||||
|
if(side == "left") {
|
||||||
|
translate([9.4,0,0]) rotate([0,0,90]) hd25_vtab("right");
|
||||||
|
translate([86,0,0]) rotate([0,0,90]) hd25_vtab("right");
|
||||||
|
}
|
||||||
|
else { // right
|
||||||
|
translate([9.4,0,0]) rotate([0,0,90]) hd25_vtab("left");
|
||||||
|
translate([86,0,0]) rotate([0,0,90]) hd25_vtab("left");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([9.4,4.07-4.5,0]) rotate([0,0,90]) hd25_tab("left");
|
||||||
|
translate([86,4.07-4.5,0]) rotate([0,0,90]) hd25_tab("left");
|
||||||
|
translate([86,65.79+4.5,0]) rotate([0,0,90]) hd25_tab("right");
|
||||||
|
translate([9.4,65.79+4.5,0]) rotate([0,0,90]) hd25_tab("right");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(hd == 3.5) {
|
||||||
|
if(orientation == "portrait") {
|
||||||
|
if(position == "vertical") {
|
||||||
|
if(side == "left") {
|
||||||
|
translate([0,41.28,0]) rotate([0,0,0]) hd35_vtab("right");
|
||||||
|
translate([0,41.28+44.45,0]) rotate([0,0,0]) hd35_vtab("right");
|
||||||
|
translate([0,41.28+76.20,0]) rotate([0,0,0]) hd35_vtab("right");
|
||||||
|
}
|
||||||
|
else { // right
|
||||||
|
translate([0,41.28,0]) rotate([0,0,0]) hd35_vtab("left");
|
||||||
|
translate([0,41.28+44.45,0]) rotate([0,0,0]) hd35_vtab("left");
|
||||||
|
translate([0,41.28+76.20,0]) rotate([0,0,0]) hd35_vtab("left");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([-.5,28.5,0]) hd35_tab("left");
|
||||||
|
translate([-.5,69.75,0]) hd35_tab("left");
|
||||||
|
translate([-.5,130.1,0]) hd35_tab("left");
|
||||||
|
translate([101.6+.5,28.5,0]) hd35_tab("right");
|
||||||
|
translate([101.6+.5,69.75,0]) hd35_tab("right");
|
||||||
|
translate([101.6+.5,130.1,0]) hd35_tab("right");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(orientation == "landscape") {
|
||||||
|
if(position == "vertical") {
|
||||||
|
if(side == "left") {
|
||||||
|
translate([9.4,0,0]) rotate([0,0,90]) hd35_vtab("right");
|
||||||
|
translate([86,0,0]) rotate([0,0,90]) hd35_vtab("right");
|
||||||
|
}
|
||||||
|
else { // right
|
||||||
|
translate([9.4,0,0]) rotate([0,0,90]) hd35_vtab("left");
|
||||||
|
translate([86,0,0]) rotate([0,0,90]) hd35_vtab("left");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([16.9,-.5,0]) rotate([0,0,90]) hd35_tab("left");
|
||||||
|
translate([76.6,-.5,0]) rotate([0,0,90]) hd35_tab("left");
|
||||||
|
translate([118.5,-.5,0]) rotate([0,0,90]) hd35_tab("left");
|
||||||
|
translate([16.9,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
|
||||||
|
translate([76.6,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
|
||||||
|
translate([118.5,101.6-.5,0]) rotate([0,0,90]) hd35_tab("right");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module hd25_tab(side) {
|
||||||
|
|
||||||
|
width = 15;
|
||||||
|
l_width = 26;
|
||||||
|
depth = 15;
|
||||||
|
height = 4;
|
||||||
|
fillet = 2;
|
||||||
|
hole = 3.6;
|
||||||
|
length = 3;
|
||||||
|
|
||||||
|
adjust = .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])
|
||||||
|
rotate([90,0,0])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-height,-depth]]);
|
||||||
|
translate([adjust,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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(side == "right") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
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])
|
||||||
|
rotate([90,0,180])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-height,-depth]]);
|
||||||
|
translate([adjust,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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module hd25_vtab(side) {
|
||||||
|
|
||||||
|
width = 15;
|
||||||
|
l_width = 16;
|
||||||
|
depth = 15;
|
||||||
|
height = 4;
|
||||||
|
fillet = 2;
|
||||||
|
hole = 3.6;
|
||||||
|
length = 3;
|
||||||
|
|
||||||
|
adjust = .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])
|
||||||
|
rotate([90,0,0])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height-5],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-height,-depth]]);
|
||||||
|
translate([adjust,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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(side == "right") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
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])
|
||||||
|
rotate([90,0,180])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height-5],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-height,-depth]]);
|
||||||
|
translate([adjust,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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module hd35_tab(side) {
|
||||||
|
|
||||||
|
width = 15;
|
||||||
|
l_width = 46;
|
||||||
|
depth = 15;
|
||||||
|
height = 4;
|
||||||
|
fillet = 2;
|
||||||
|
hole = 3.6;
|
||||||
|
length = 3;
|
||||||
|
|
||||||
|
adjust = .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])
|
||||||
|
rotate([90,0,0])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height+20],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-height,-depth]]);
|
||||||
|
translate([adjust,7.5,depth])
|
||||||
|
rotate([90,0,0])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height+20],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(side == "right") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
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])
|
||||||
|
rotate([90,0,180])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height+20],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-height,-depth]]);
|
||||||
|
translate([adjust,5.5,depth])
|
||||||
|
rotate([90,0,180])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height+20],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module hd35_vtab(side) {
|
||||||
|
|
||||||
|
width = 15;
|
||||||
|
l_width = 16;
|
||||||
|
depth = 15;
|
||||||
|
height = 4;
|
||||||
|
fillet = 2;
|
||||||
|
hole = 3.6;
|
||||||
|
length = 3;
|
||||||
|
|
||||||
|
adjust = .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])
|
||||||
|
rotate([90,0,0])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height-5],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-height,-depth]]);
|
||||||
|
translate([adjust,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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(side == "right") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
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])
|
||||||
|
rotate([90,0,180])
|
||||||
|
linear_extrude(height = 2)
|
||||||
|
polygon(points = [ [-height,height-5],
|
||||||
|
[-depth+4,-depth],
|
||||||
|
[-height,-depth]]);
|
||||||
|
translate([adjust,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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module hd_bottom_holes(hd,orientation,position,side,thick) {
|
||||||
|
|
||||||
|
adjust = .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));
|
||||||
|
}
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(orientation == "landscape") {
|
||||||
|
if(position == "vertical") {
|
||||||
|
if(side == "left") {
|
||||||
|
translate([9.4,-3,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
translate([86,-3,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo(side);
|
||||||
|
translate([9.4,3,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
translate([86,3,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(hd == 3.5) {
|
||||||
|
if(orientation == "portrait") {
|
||||||
|
if(position == "vertical") {
|
||||||
|
if(side == "left") {
|
||||||
|
translate([-6,28.5,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
translate([-6,70.5,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
translate([-6,28.5+101.6,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// portrait 3.5" bottom screw holes
|
||||||
|
translate([6,28.5,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
translate([6,70.5,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
translate([6,28.5+101.6,0]) cylinder(d=3.6,h=thick+5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* hard drive 2.5", height=drive height */
|
||||||
|
module hd25(height) {
|
||||||
|
|
||||||
|
hd25_x = 100;
|
||||||
|
hd25_y = 69.85;
|
||||||
|
hd25_z = height;
|
||||||
|
|
||||||
|
adjust = .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);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
// connector opening
|
||||||
|
color("LightSlateGray",.6) translate([hd25_x-5,11,-1]) cube([5+adjust,32,5+adjust]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* hard drive 3.5" */
|
||||||
|
module hd35() {
|
||||||
|
|
||||||
|
hd35_x = 147;
|
||||||
|
hd35_y = 101.6;
|
||||||
|
hd35_z = 26.1;
|
||||||
|
|
||||||
|
adjust = .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);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
// connector opening
|
||||||
|
color("LightSlateGray",.6) translate([hd35_x-5,11,-1]) cube([5+adjust,32,5+adjust]);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 3.5" hdd to 2.5" hdd holder */
|
||||||
|
module hdd35_25holder(length,width=101.6) {
|
||||||
|
wallthick = 3;
|
||||||
|
floorthick = 2;
|
||||||
|
hd35_x = length; // 145mm for 3.5" drive
|
||||||
|
hd35_y = width;
|
||||||
|
hd35_z = 12;
|
||||||
|
hd25_x = 100;
|
||||||
|
hd25_y = 69.85;
|
||||||
|
hd25_z = 9.5;
|
||||||
|
hd25_xloc = 2; // or (hd35_x-hd25_x)/2
|
||||||
|
hd25_yloc = (hd35_y-hd25_y)/2;
|
||||||
|
hd25_zloc = 9.5;
|
||||||
|
adjust = .1;
|
||||||
|
$fn=90;
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
difference() {
|
||||||
|
translate([(hd35_x/2),(hd35_y/2),(hd35_z/2)])
|
||||||
|
cube_fillet_inside([hd35_x,hd35_y,hd35_z],
|
||||||
|
vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||||
|
translate([(hd35_x/2),(hd35_y/2),(hd35_z/2)+floorthick])
|
||||||
|
cube_fillet_inside([hd35_x-(wallthick*2),hd35_y-(wallthick*2),hd35_z],
|
||||||
|
vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||||
|
|
||||||
|
// end trim
|
||||||
|
translate([-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]);
|
||||||
|
|
||||||
|
// 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)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
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([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);
|
||||||
|
|
||||||
|
// 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]);
|
||||||
|
|
||||||
|
}
|
||||||
|
// 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));
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
364
lib/holder.scad
Normal file
364
lib/holder.scad
Normal file
@@ -0,0 +1,364 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
pcb_holder(size,wallthick)
|
||||||
|
nut_holder(nut, style, dia_x, dia_y, height)
|
||||||
|
vu_holder(vu_model,side,vesa,cheight)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// pcb bottom edge holder
|
||||||
|
module pcb_holder(size,wallthick) {
|
||||||
|
|
||||||
|
adjust=.01;
|
||||||
|
$fn = 90;
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([-1.85,-1.75,0]) cube([size[0]+3.5,5,6]);
|
||||||
|
translate([size[0]+1.65,-5.75,1])
|
||||||
|
rotate([0,-90,0])
|
||||||
|
linear_extrude(height = size[0]+3.5)
|
||||||
|
polygon(points = [ [-wallthick/2,-wallthick/2],
|
||||||
|
[2,wallthick],
|
||||||
|
[4,4],
|
||||||
|
[-wallthick/2,4]]);
|
||||||
|
translate([-1.85,4,1])
|
||||||
|
rotate([0,-90,180])
|
||||||
|
linear_extrude(height = size[0]+3.5)
|
||||||
|
polygon(points = [ [-wallthick/2,-wallthick/2],
|
||||||
|
[2,wallthick],
|
||||||
|
[2,2],
|
||||||
|
[-wallthick/2,2]]);
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
|
||||||
|
|
||||||
|
nuts = [[2,4,1.6], // m2 size, diameter, height
|
||||||
|
[2.5,5,2], // m2.5 size, diameter, height
|
||||||
|
[3,5.5,2.4], // m3 size, diameter, height
|
||||||
|
[4,7,3.2]]; // m4 size, diameter, height
|
||||||
|
|
||||||
|
$fn = 180;
|
||||||
|
|
||||||
|
if( style == "default") {
|
||||||
|
difference() {
|
||||||
|
cylinder(d=dia_x, h=height);
|
||||||
|
if(nut == "m2") {
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
|
||||||
|
translate([0, 0, 2]) cylinder(d=nuts[0][1]*2/sqrt(3), h=height, $fn=6);
|
||||||
|
}
|
||||||
|
if(nut == "m2.5") {
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.25, h=height+2);
|
||||||
|
translate([0, 0, 2]) cylinder(d=nuts[1][1]*2/sqrt(3), h=height, $fn=6);
|
||||||
|
}
|
||||||
|
if(nut == "m3") {
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
|
||||||
|
translate([0, 0, 2]) cylinder(d=nuts[2][1]*2/sqrt(3), h=height, $fn=6);
|
||||||
|
}
|
||||||
|
if(nut == "m4") {
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
|
||||||
|
translate([0, 0, 2]) cylinder(d=nuts[3][1]*2/sqrt(3), h=height, $fn=6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( style == "sloped") {
|
||||||
|
difference() {
|
||||||
|
cylinder(d2=dia_x, d1=dia_y, h=height);
|
||||||
|
if(nut == "m2") {
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
|
||||||
|
translate([0, 0, 2]) cylinder(d=nuts[0][1]*2/sqrt(3), h=height, $fn=6);
|
||||||
|
}
|
||||||
|
if(nut == "m2.5") {
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.25, h=height+2);
|
||||||
|
translate([0, 0, 2]) cylinder(d=nuts[1][1]*2/sqrt(3), h=height, $fn=6);
|
||||||
|
}
|
||||||
|
if(nut == "m3") {
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
|
||||||
|
translate([0, 0, 2]) cylinder(d=nuts[2][1]*2/sqrt(3), h=height, $fn=6);
|
||||||
|
}
|
||||||
|
if(nut == "m4") {
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
|
||||||
|
translate([0, 0, 2]) cylinder(d=nuts[3][1]*2/sqrt(3), h=height, $fn=6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if( style == "trap") {
|
||||||
|
if(nut == "m2") {
|
||||||
|
difference() {
|
||||||
|
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[0][0]+.25, h=height+2);
|
||||||
|
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[0][1]*2/sqrt(3), h=nuts[0][2], $fn=6);
|
||||||
|
translate([-nuts[0][1]/2, 0, 2]) cube([nuts[0][1], dia_x, nuts[0][2]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(nut == "m2.5") {
|
||||||
|
difference() {
|
||||||
|
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[1][0]+.325, h=height+2);
|
||||||
|
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[1][1]*2/sqrt(3), h=nuts[1][2], $fn=6);
|
||||||
|
translate([-nuts[1][1]/2, 0, 2]) cube([nuts[1][1], dia_x, nuts[1][2]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(nut == "m3") {
|
||||||
|
difference() {
|
||||||
|
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[2][0]+.5, h=height+2);
|
||||||
|
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[2][1]*2/sqrt(3), h=nuts[2][2], $fn=6);
|
||||||
|
translate([-nuts[2][1]/2, 0, 2]) cube([nuts[2][1], dia_x, nuts[2][2]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(nut == "m4") {
|
||||||
|
difference() {
|
||||||
|
translate([-dia_x/2, -dia_y/2, 0]) cube([dia_x, dia_y, height]);
|
||||||
|
translate([0, 0, -1]) cylinder(d=nuts[3][0]+.5, h=height+2);
|
||||||
|
translate([0, 0, 2]) rotate([0,0,30]) cylinder(d=nuts[3][1]*2/sqrt(3), h=nuts[3][2], $fn=6);
|
||||||
|
translate([-nuts[3][1]/2, 0, 2]) cube([nuts[3][1], dia_x, nuts[3][2]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module vu_holder(vu_model,side,vesa,cheight) {
|
||||||
|
|
||||||
|
//cheight = case_z+90;
|
||||||
|
v_fillet = 3;
|
||||||
|
|
||||||
|
vu5_case_x_offset = 6.5; // for uniform front vu5=6.5, vu7=20
|
||||||
|
vu5_pcb_width = 121;
|
||||||
|
vu5_pcb_height = 93.31;
|
||||||
|
vu5_width = vu5_pcb_width + vu5_case_x_offset;
|
||||||
|
vu5_height = vu5_pcb_height + 9.75;
|
||||||
|
|
||||||
|
vu7_case_x_offset = 20; // for uniform front vu5=6.5, vu7=20
|
||||||
|
vu7_pcb_width = 172.90;
|
||||||
|
vu7_pcb_height = 124.27;
|
||||||
|
vu7_width = vu7_pcb_width + vu7_case_x_offset;
|
||||||
|
vu7_height = vu7_pcb_height + 9.75;
|
||||||
|
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
if(side == "right") {
|
||||||
|
translate([width-wallthick-gap,-(2*wallthick)-gap,0])
|
||||||
|
cube([sidethick,depth+2*wallthick,cheight]);
|
||||||
|
// right tabs for vu5 attachment
|
||||||
|
if(case_style == "vu5") {
|
||||||
|
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-39,
|
||||||
|
case_z+80]) rotate([90-vu_rotation[0],180,0])
|
||||||
|
slab_r([((width-vesa)/2)+4.5,10,sidethick], [.1,.1,3,3]);
|
||||||
|
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-26,
|
||||||
|
case_z+31.5]) rotate([90-vu_rotation[0],180,0])
|
||||||
|
slab_r([((width-vesa)/2)+4.5,10,sidethick], [.1,.1,3,3]);
|
||||||
|
|
||||||
|
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-41.85-adj,
|
||||||
|
case_z+79.25]) rotate([90-vu_rotation[0],180,0])
|
||||||
|
difference() {
|
||||||
|
cube([sidethick,10,sidethick]);
|
||||||
|
translate([0,-adj,sidethick]) rotate([0,45,0])
|
||||||
|
cube([2*sidethick,10+(2*adj),sidethick]);
|
||||||
|
}
|
||||||
|
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-28.85-adj,
|
||||||
|
case_z+30.75]) rotate([90-vu_rotation[0],180,0])
|
||||||
|
difference() {
|
||||||
|
cube([sidethick,10,sidethick]);
|
||||||
|
translate([0,-adj,sidethick]) rotate([0,45,0])
|
||||||
|
cube([2*sidethick,10+(2*adj),sidethick]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// right tabs for vu7 attachment
|
||||||
|
if(case_style == "vu7") {
|
||||||
|
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick-1,depth-49.40,
|
||||||
|
case_z+vu7_height-15]) rotate([90-vu_rotation[0],180,0])
|
||||||
|
slab_r([((width-vesa)/2)+12,10,sidethick], [.1,.1,3,3]);
|
||||||
|
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick-1,depth-23.60,
|
||||||
|
case_z+22.5]) rotate([90-vu_rotation[0],180,0])
|
||||||
|
slab_r([((width-vesa)/2)+12,10,sidethick], [.1,.1,3,3]);
|
||||||
|
|
||||||
|
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-52.25,
|
||||||
|
case_z+vu7_height-15.75]) rotate([90-vu_rotation[0],180,0])
|
||||||
|
difference() {
|
||||||
|
cube([sidethick,10,sidethick]);
|
||||||
|
translate([0,-adj,sidethick]) rotate([0,45,0])
|
||||||
|
cube([2*sidethick,10+(2*adj),sidethick]);
|
||||||
|
}
|
||||||
|
translate([(width/2)+((width-vesa)/2)+(vesa/2)-sidethick,depth-26.5,
|
||||||
|
case_z+21.8]) rotate([90-vu_rotation[0],180,0])
|
||||||
|
difference() {
|
||||||
|
cube([sidethick,10,sidethick]);
|
||||||
|
translate([0,-adj,sidethick]) rotate([0,45,0])
|
||||||
|
cube([2*sidethick,10+(2*adj),sidethick]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// top rail
|
||||||
|
translate([width-6.9-adj,-gap,case_z-floorthick-.5])
|
||||||
|
cube([4,depth-2*(wallthick+gap),2]);
|
||||||
|
}
|
||||||
|
if(side == "left") {
|
||||||
|
translate([-wallthick-gap-sidethick,-(2*wallthick)-gap,0])
|
||||||
|
cube([sidethick,depth+2*wallthick,cheight]);
|
||||||
|
// left tabs for vu5 attachment
|
||||||
|
if(case_style == "vu5") {
|
||||||
|
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-36.4,
|
||||||
|
case_z+70]) rotate([90+vu_rotation[0],0,0])
|
||||||
|
slab_r([((width-vesa)/2)+4,10, sidethick], [.1,.1,3,3]);
|
||||||
|
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-23.5,
|
||||||
|
case_z+22]) rotate([90+vu_rotation[0],0,0])
|
||||||
|
slab_r([((width-vesa)/2)+4,10,sidethick], [.1,.1,3,3]);
|
||||||
|
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-39.35+adj,
|
||||||
|
case_z+69.25]) rotate([90+vu_rotation[0],0,0])
|
||||||
|
difference() {
|
||||||
|
cube([sidethick,10,sidethick]);
|
||||||
|
translate([0,-adj,sidethick]) rotate([0,45,0])
|
||||||
|
cube([2*sidethick,10+(2*adj),2*sidethick]);
|
||||||
|
}
|
||||||
|
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-3.5-adj,depth-26.4+adj,
|
||||||
|
case_z+21.25]) rotate([90+vu_rotation[0],0,0])
|
||||||
|
difference() {
|
||||||
|
cube([sidethick,10,sidethick]);
|
||||||
|
translate([0,-adj,sidethick]) rotate([0,45,0])
|
||||||
|
cube([2*sidethick,10+(2*adj),2*sidethick]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// left tabs for vu7 attachment
|
||||||
|
if(case_style == "vu7") {
|
||||||
|
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-4.25-adj,depth-46.85,
|
||||||
|
case_z+vu7_height-24.5]) rotate([90+vu_rotation[0],0,0])
|
||||||
|
slab_r([((width-vesa)/2),10, sidethick], [.1,.1,3,3]);
|
||||||
|
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-4.25-adj,depth-21,
|
||||||
|
case_z+13]) rotate([90+vu_rotation[0],0,0])
|
||||||
|
slab_r([((width-vesa)/2),10,sidethick], [.1,.1,3,3]);
|
||||||
|
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-4-adj,depth-49.75+adj,
|
||||||
|
case_z+vu7_height-25.25]) rotate([90+vu_rotation[0],0,0])
|
||||||
|
difference() {
|
||||||
|
cube([sidethick,10,sidethick]);
|
||||||
|
translate([0,-adj,sidethick]) rotate([0,45,0])
|
||||||
|
cube([2*sidethick,10+(2*adj),2*sidethick]);
|
||||||
|
}
|
||||||
|
translate([-((width-vesa)/2)+(width/2)-(vesa/2)-4-adj,depth-23.75+adj,
|
||||||
|
case_z+12.25]) rotate([90+vu_rotation[0],0,0])
|
||||||
|
difference() {
|
||||||
|
cube([sidethick,10,sidethick]);
|
||||||
|
translate([0,-adj,sidethick]) rotate([0,45,0])
|
||||||
|
cube([2*sidethick,10+(2*adj),2*sidethick]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// top rail
|
||||||
|
translate([-wallthick-gap-adj,-gap,case_z-floorthick-.5])
|
||||||
|
cube([4,depth-2*(wallthick+gap),2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(side == "right") {
|
||||||
|
// vu5 shape and back cut
|
||||||
|
if(case_style == "vu5") {
|
||||||
|
translate([width+sidethick-2,-.6,case_z+sidethick+2.5])
|
||||||
|
rotate([0,-90,0])
|
||||||
|
linear_extrude(height = 2*sidethick)
|
||||||
|
polygon(points = [ [-sidethick,-sidethick-wallthick-5],
|
||||||
|
[cheight-bottom_height-top_height-3,-sidethick-wallthick-5],
|
||||||
|
[cheight-bottom_height-top_height-3,depth-53],
|
||||||
|
[-sidethick,depth-33]]);
|
||||||
|
|
||||||
|
translate([width-(sidethick/2),depth-8,case_z+(121/2)])
|
||||||
|
rotate([vu_rotation[0],0,0])
|
||||||
|
cube_fillet_inside([10,50,110],vertical=[v_fillet,v_fillet,v_fillet,v_fillet],
|
||||||
|
top=[0,0,0,0],bottom=[3,3,3,3], $fn=90);
|
||||||
|
// tab holes
|
||||||
|
translate([width/2+(vesa/2)-3,depth-37,
|
||||||
|
case_z+75]) rotate([90-vu_rotation[0],180,0]) cylinder(d=3, h=sidethick+1);
|
||||||
|
translate([width/2+(vesa/2)-3,depth-24,
|
||||||
|
case_z+26.75]) rotate([90-vu_rotation[0],180,0]) cylinder(d=3, h=sidethick+1);
|
||||||
|
}
|
||||||
|
// vu7 shape and back cut
|
||||||
|
if(case_style == "vu7") {
|
||||||
|
translate([width+sidethick-2,-.6,case_z+sidethick+2.5])
|
||||||
|
rotate([0,-90,0])
|
||||||
|
linear_extrude(height = 2*sidethick)
|
||||||
|
polygon(points = [ [-sidethick,-sidethick-wallthick-5],
|
||||||
|
[cheight-bottom_height-top_height-3,-sidethick-wallthick-5],
|
||||||
|
[cheight-bottom_height-top_height-3,depth-63],
|
||||||
|
[-sidethick,depth-33]]);
|
||||||
|
|
||||||
|
translate([width-(sidethick/2),depth-10.5,case_z+70.5])
|
||||||
|
rotate([vu_rotation[0],0,0])
|
||||||
|
cube_fillet_inside([10,50,130],vertical=[v_fillet,v_fillet,v_fillet,v_fillet],
|
||||||
|
top=[0,0,0,0],bottom=[3,3,3,3], $fn=90);
|
||||||
|
// tab holes
|
||||||
|
translate([width/2+(vesa/2)-10,depth-47,case_z+vu7_height-19.75])
|
||||||
|
rotate([90-vu_rotation[0],180,0]) cylinder(d=3, h=sidethick+4);
|
||||||
|
translate([width/2+(vesa/2)-10,depth-21.25,case_z+18])
|
||||||
|
rotate([90-vu_rotation[0],180,0]) cylinder(d=3, h=sidethick+4);
|
||||||
|
}
|
||||||
|
// bottom attachment holes
|
||||||
|
translate([width-wallthick-gap-adj-5,wallthick+gap+10,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0]) cylinder(d=3, h=sidethick+(2*adj)+10);
|
||||||
|
translate([width-wallthick-gap-adj-5,depth-wallthick-gap-10,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0]) cylinder(d=3, h=sidethick+(2*adj)+10);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(side == "left") {
|
||||||
|
// vu5 shape and back cut
|
||||||
|
if(case_style == "vu5") {
|
||||||
|
translate([-sidethick-adj,-.6,case_z+sidethick+2.5])
|
||||||
|
rotate([0,-90,0])
|
||||||
|
linear_extrude(height = 2*sidethick)
|
||||||
|
polygon(points = [ [-sidethick,-sidethick-wallthick-5],
|
||||||
|
[cheight-bottom_height-top_height-3,-sidethick-wallthick-5],
|
||||||
|
[cheight-bottom_height-top_height-3,depth-53],
|
||||||
|
[-sidethick,depth-33]]);
|
||||||
|
|
||||||
|
translate([-wallthick-gap-(sidethick/2),depth-8,case_z+(121/2)])
|
||||||
|
rotate([vu_rotation[0],0,0])
|
||||||
|
cube_fillet_inside([10,50,110],vertical=[v_fillet,v_fillet,v_fillet,v_fillet],
|
||||||
|
top=[0,0,0,0],bottom=[3,3,3,3], $fn=90);
|
||||||
|
// tab holes
|
||||||
|
translate([width/2-(vesa/2)-3,depth-36.75,case_z+75])
|
||||||
|
rotate([90+vu_rotation[0],0,0]) cylinder(d=3, h=sidethick+1);
|
||||||
|
translate([width/2-(vesa/2)-3,depth-24.25,case_z+26.75])
|
||||||
|
rotate([90+vu_rotation[0],0,0]) cylinder(d=3, h=sidethick+1);
|
||||||
|
}
|
||||||
|
// vu7 shape and back cut
|
||||||
|
if(case_style == "vu7") {
|
||||||
|
translate([-sidethick-adj,-.6,case_z+sidethick+2.5])
|
||||||
|
rotate([0,-90,0])
|
||||||
|
linear_extrude(height = 2*sidethick)
|
||||||
|
polygon(points = [ [-sidethick,-sidethick-wallthick-5],
|
||||||
|
[cheight-bottom_height-top_height-3,-sidethick-wallthick-5],
|
||||||
|
[cheight-bottom_height-top_height-3,depth-63],
|
||||||
|
[-sidethick,depth-33]]);
|
||||||
|
|
||||||
|
translate([-wallthick-gap-(sidethick/2),depth-10.5,case_z+70.5])
|
||||||
|
rotate([vu_rotation[0],0,0])
|
||||||
|
cube_fillet_inside([10,50,130],vertical=[v_fillet,v_fillet,v_fillet,v_fillet],
|
||||||
|
top=[0,0,0,0],bottom=[3,3,3,3], $fn=90);
|
||||||
|
// tab holes
|
||||||
|
translate([width/2-(vesa/2)-10,depth-48,case_z+vu7_height-19.75])
|
||||||
|
rotate([90+vu_rotation[0],0,0]) cylinder(d=3, h=sidethick+4);
|
||||||
|
translate([width/2-(vesa/2)-10,depth-22.25,case_z+18])
|
||||||
|
rotate([90+vu_rotation[0],0,0]) cylinder(d=3, h=sidethick+4);
|
||||||
|
}
|
||||||
|
// bottom attachment holes
|
||||||
|
translate([-sidethick-adj-6,wallthick+gap+10,((bottom_height+floorthick)/2)-1])
|
||||||
|
rotate([0,90,0]) cylinder(d=3, h=sidethick+(2*adj)+10);
|
||||||
|
if(depth >= 75) {
|
||||||
|
translate([-sidethick-adj-6,depth-wallthick-gap-10,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0]) cylinder(d=3, h=sidethick+(2*adj)+10);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([-sidethick-adj-6,wallthick+gap+40.5,((bottom_height+floorthick)/2)-1])
|
||||||
|
rotate([0,90,0]) cylinder(d=3, h=sidethick+(2*adj)+10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
51
lib/keyhole.scad
Normal file
51
lib/keyhole.scad
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
keyhole(keysize, mask = false)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// enclosed keyhole
|
||||||
|
module keyhole(keysize, mask = false) {
|
||||||
|
|
||||||
|
adjust=.01;
|
||||||
|
$fn = 90;
|
||||||
|
|
||||||
|
if(mask == true) {
|
||||||
|
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]);
|
||||||
|
translate([0, -keysize[1]/2, -adjust]) cube([keysize[2]+keysize[0]/2, keysize[1], keysize[3]+2*adjust]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([0, 0, -adjust])
|
||||||
|
difference() {
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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]);
|
||||||
|
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]);
|
||||||
|
translate([0, -keysize[1]/2, -adjust]) cube([keysize[2]+keysize[0]/2, keysize[1], keysize[3]+2*adjust]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1124
lib/oem_hk.scad
Normal file
1124
lib/oem_hk.scad
Normal file
File diff suppressed because it is too large
Load Diff
30
lib/pcb_pad.scad
Normal file
30
lib/pcb_pad.scad
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
pcb_pad(pads = 1, style = "round")
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
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,-adjust]) cylinder(d=.625, h=.125+2*adjust);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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,-adjust]) cylinder(d=.625, h=.125+2*adjust);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
163
lib/shape.scad
Normal file
163
lib/shape.scad
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
slab(size, radius)
|
||||||
|
slab_r(size, radius)
|
||||||
|
slot(hole,length,depth)
|
||||||
|
punchout(width,depth,gap,thick,fillet,shape)
|
||||||
|
hdmi_open(hdmi_style)
|
||||||
|
microusb_open()
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* slab module */
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* multi-radius round slab */
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* slot module */
|
||||||
|
module slot(hole,length,depth) {
|
||||||
|
|
||||||
|
hull() {
|
||||||
|
translate([0,0,0]) cylinder(d=hole,h=depth);
|
||||||
|
translate([length,0,0]) cylinder(d=hole,h=depth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// punchout opening
|
||||||
|
module punchout(width,depth,gap,thick,fillet,shape) {
|
||||||
|
|
||||||
|
adjust = .01;
|
||||||
|
$fn=90;
|
||||||
|
|
||||||
|
// slot punchout
|
||||||
|
if(shape == "slot") {
|
||||||
|
difference() {
|
||||||
|
translate([0,0,0]) slot(depth,width,thick);
|
||||||
|
translate([0,0,-adjust]) slot(depth-gap,width,thick+(2*adjust));
|
||||||
|
// 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)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
// 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)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* hdmi opening */
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* micro-usb opening */
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
97
lib/standoff.scad
Normal file
97
lib/standoff.scad
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
standoff(standoff[radius,height,holesize,supportsize,supportheight,sink,style,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];
|
||||||
|
height = stand_off[1];
|
||||||
|
holesize = stand_off[2];
|
||||||
|
supportsize = stand_off[3];
|
||||||
|
supportheight = stand_off[4];
|
||||||
|
sink = stand_off[5];
|
||||||
|
style = stand_off[6];
|
||||||
|
reverse = stand_off[7];
|
||||||
|
insert_e = stand_off[8];
|
||||||
|
i_dia = stand_off[9];
|
||||||
|
i_depth = stand_off[10];
|
||||||
|
|
||||||
|
adjust = 0.1;
|
||||||
|
|
||||||
|
difference (){
|
||||||
|
union () {
|
||||||
|
if(style == 0 && reverse == 0) {
|
||||||
|
rotate([0,0,30]) cylinder(d=radius*2/sqrt(3),h=height,$fn=6);
|
||||||
|
}
|
||||||
|
if(style == 0 && reverse == 1) {
|
||||||
|
translate([0,0,-height]) rotate([0,0,30]) cylinder(d=radius*2/sqrt(3),h=height,$fn=6);
|
||||||
|
}
|
||||||
|
if(style == 1 && reverse == 0) {
|
||||||
|
cylinder(d=radius,h=height,$fn=90);
|
||||||
|
}
|
||||||
|
if(style == 1 && reverse == 1) {
|
||||||
|
translate([0,0,-height]) cylinder(d=radius,h=height,$fn=90);
|
||||||
|
}
|
||||||
|
if(reverse == 1) {
|
||||||
|
translate([0,0,-supportheight]) cylinder(d=(supportsize),h=supportheight,$fn=60);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cylinder(d=(supportsize),h=supportheight,$fn=60);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// hole
|
||||||
|
if(sink <= 3 && reverse == 0) {
|
||||||
|
translate([0,0,-adjust]) cylinder(d=holesize, h=height+(adjust*2),$fn=90);
|
||||||
|
}
|
||||||
|
if(sink <= 3 && reverse == 1) {
|
||||||
|
translate([0,0,-adjust-height]) cylinder(d=holesize, h=height+(adjust*2),$fn=90);
|
||||||
|
}
|
||||||
|
// countersink hole
|
||||||
|
if(sink == 1 && reverse == 0) {
|
||||||
|
translate([0,0,-adjust]) cylinder(d1=6.5, d2=(holesize), h=3);
|
||||||
|
}
|
||||||
|
if(sink == 1 && reverse == 1) {
|
||||||
|
translate([0,0,+adjust-2.5]) cylinder(d1=(holesize), d2=6.5, h=3);
|
||||||
|
}
|
||||||
|
// recessed hole
|
||||||
|
if(sink == 2 && reverse == 0) {
|
||||||
|
translate([0,0,-adjust]) cylinder(d=6.5, h=3);
|
||||||
|
}
|
||||||
|
if(sink == 2 && reverse == 1) {
|
||||||
|
translate([0,0,+adjust-3]) cylinder(d=6.5, h=3);
|
||||||
|
}
|
||||||
|
// nut holder
|
||||||
|
if(sink == 3 && reverse == 0) {
|
||||||
|
translate([0,0,-adjust]) cylinder(r=3.3,h=3,$fn=6);
|
||||||
|
}
|
||||||
|
if(sink == 3 && reverse == 1) {
|
||||||
|
translate([0,0,+adjust-3]) cylinder(r=3.3,h=3,$fn=6);
|
||||||
|
}
|
||||||
|
// blind hole
|
||||||
|
if(sink == 4 && reverse == 0) {
|
||||||
|
translate([0,0,2]) cylinder(d=holesize, h=height,$fn=90);
|
||||||
|
}
|
||||||
|
if(sink == 4 && reverse == 1) {
|
||||||
|
translate([0,0,-height-2-adjust]) cylinder(d=holesize, h=height,$fn=90);
|
||||||
|
}
|
||||||
|
if(insert_e > 0 && reverse == 0) {
|
||||||
|
translate([0,0,height-i_depth]) cylinder(d=i_dia, h=i_depth+adjust,$fn=90);
|
||||||
|
}
|
||||||
|
if(insert_e > 0 && reverse == 1) {
|
||||||
|
translate([0,0,-height-adjust]) cylinder(d=i_dia, h=i_depth+adjust,$fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
87
lib/vent.scad
Normal file
87
lib/vent.scad
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
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) {
|
||||||
|
|
||||||
|
fillet = width/2;
|
||||||
|
adjust = .01;
|
||||||
|
$fn=90;
|
||||||
|
|
||||||
|
// vertical orientation
|
||||||
|
if(orientation == "vertical") { rotate([90,0,0])
|
||||||
|
for (r=[0:length+gap:rows*(length+gap)-1]) {
|
||||||
|
for (c=[0:width+(2*gap):(columns*(width+(2*gap)))-1]) {
|
||||||
|
translate ([c,r,-1]) cube([width,length,height]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// horizontal orientation
|
||||||
|
if(orientation == "horizontal") {
|
||||||
|
for (r=[0:length+(2*gap):rows*(length+gap)]) {
|
||||||
|
for (c=[0:width+(2*gap):(columns*(width+(2*gap)))-1]) {
|
||||||
|
translate ([c,r,-1]) cube([width,length,height]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hex vent opening
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
yb = (borders == "x" || borders == "none") ? cell_spacing : border;
|
||||||
|
hxb = max(yb/2, cell_spacing + hole);
|
||||||
|
hyb = max(xb/2, cell_spacing + hole);
|
||||||
|
|
||||||
|
cells_x = floor((2*(x-2*xb-cell_size)/(cell_size+cell_spacing))+1);
|
||||||
|
cells_y = floor(((sqrt(12)*(y-2*yb)-4*cell_size)/(3*(cell_size+cell_spacing)))+1);
|
||||||
|
csx = cell_size + (cells_x-1)*(cell_size+cell_spacing)/2;
|
||||||
|
csy = sqrt(4/3)*cell_size + ((cell_size+cell_spacing)*sqrt(3/4)*(cells_y-1));
|
||||||
|
|
||||||
|
difference() {
|
||||||
|
color("grey",1) slab([x,y,thick],2);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
150
mod/add.scad
Normal file
150
mod/add.scad
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
add(type,loc_x,loc_y,loc_z,size_x,size_y,size_z,rotation,face,side,case_z,data_1,data_2,data_3,data_4)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* addition module */
|
||||||
|
module add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4) {
|
||||||
|
|
||||||
|
if(type == "rectangle") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data_4);
|
||||||
|
}
|
||||||
|
if(type == "round") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) cylinder(d=size_x,h=size_z);
|
||||||
|
}
|
||||||
|
if(type == "slot") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) slot(size_x,size_y,size_z);
|
||||||
|
}
|
||||||
|
if(type == "text") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data_3, size=data_1);
|
||||||
|
}
|
||||||
|
if(type == "art") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data_1,data_2,data_3);
|
||||||
|
}
|
||||||
|
if(type == "button") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data_3,[size_x,size_y,size_z],data_4,data_1);
|
||||||
|
}
|
||||||
|
if(type == "button_top") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) button_assembly(data_3,size_x,size_z);
|
||||||
|
}
|
||||||
|
if(type == "pcb_holder") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) pcb_holder([size_x,size_y,size_z],data_1);
|
||||||
|
}
|
||||||
|
if(type == "batt_holder") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) batt_holder(data_1);
|
||||||
|
}
|
||||||
|
if(type == "uart_holder") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) uart_holder();
|
||||||
|
}
|
||||||
|
if(type == "uart_strap") {
|
||||||
|
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) uart_strap();
|
||||||
|
}
|
||||||
|
if(type == "standoff") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data_4);
|
||||||
|
}
|
||||||
|
if(type == "hd_holder") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"horizontal","none");
|
||||||
|
}
|
||||||
|
if(type == "hd_vertleft") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"vertical","left");
|
||||||
|
}
|
||||||
|
if(type == "hd_vertright") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_mount(data_1,data_3,"vertical","right");
|
||||||
|
}
|
||||||
|
if(type == "hd25") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd25(data_1);
|
||||||
|
}
|
||||||
|
if(type == "hd35") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd35();
|
||||||
|
}
|
||||||
|
if(type == "hk_wb2") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_wb2();
|
||||||
|
}
|
||||||
|
if(type == "hc4_oled") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hc4_oled();
|
||||||
|
}
|
||||||
|
if(type == "hc4_oled_holder") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hc4_oled_holder(face,size_z);
|
||||||
|
}
|
||||||
|
if(type == "h2_netcard") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) h2_netcard();
|
||||||
|
}
|
||||||
|
if(type == "hk_lcd35") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk35_lcd();
|
||||||
|
}
|
||||||
|
if(type == "hk_m1s_ups") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_m1s_ups();
|
||||||
|
}
|
||||||
|
if(type == "hk_uart") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_uart();
|
||||||
|
}
|
||||||
|
if(type == "hk_vu7c") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_vu7c(data_1,data_2);
|
||||||
|
}
|
||||||
|
if(type == "hk_boom") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom(data_1,data_3);
|
||||||
|
}
|
||||||
|
if(type == "boom_speaker") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_speaker(data_3,true,data_1);
|
||||||
|
}
|
||||||
|
if(type == "boom_grill") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_boom_grill(data_3,size_z);
|
||||||
|
}
|
||||||
|
if(type == "boom_speaker_holder") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) boom_speaker_holder(data_1);
|
||||||
|
}
|
||||||
|
if(type == "hk_speaker") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_speaker();
|
||||||
|
}
|
||||||
|
if(type == "fan_cover") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_cover(size_x, size_z);
|
||||||
|
}
|
||||||
|
if(type == "vent_panel_hex") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_panel_hex(x=size_x, y=size_y, thick=size_z,
|
||||||
|
cell_size=data_1, cell_spacing=data_2, border=data_4, borders=data_3);
|
||||||
|
}
|
||||||
|
if(type == "feet") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) feet(size_x, size_z);
|
||||||
|
}
|
||||||
|
if(type == "access_port") {
|
||||||
|
if(rotation[2] == 180) {
|
||||||
|
translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_port([size_x,size_y,size_z],data_3);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) access_port([size_x,size_y,size_z],data_3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(type == "access_cover") {
|
||||||
|
if(rotation[2] == 180) {
|
||||||
|
color("grey",1) translate([loc_x+size_x,loc_y+size_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data_3);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
color("grey",1) translate([loc_x,loc_y,loc_z]) rotate(rotation) access_cover([size_x,size_y,size_z],data_3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(type == "boom_vring") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) boom_vring(data_1);
|
||||||
|
}
|
||||||
|
if(type == "h3_port_extender") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender(data_3);
|
||||||
|
}
|
||||||
|
if(type == "h3_port_extender_holder") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender_holder(data_3,data_1);
|
||||||
|
}
|
||||||
|
if(type == "hk_pwr_button") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_pwr_button();
|
||||||
|
}
|
||||||
|
if(type == "keyhole") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data_4);
|
||||||
|
}
|
||||||
|
if(type == "dsub") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data_4);
|
||||||
|
}
|
||||||
|
if(type == "nut_holder") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) nut_holder(data_1, data_2, size_x, size_y, size_z);
|
||||||
|
}
|
||||||
|
if(type == "standoff") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) standoff(data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
680
mod/case_bottom.scad
Normal file
680
mod/case_bottom.scad
Normal file
@@ -0,0 +1,680 @@
|
|||||||
|
|
||||||
|
|
||||||
|
// case bottom
|
||||||
|
module case_bottom(case_design) {
|
||||||
|
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
if(case_design == "shell") {
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,bottom_height/2])
|
||||||
|
cube_fillet_inside([width,depth,bottom_height],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
translate([(width/2)-wallthick-gap,
|
||||||
|
(depth/2)-wallthick-gap,(bottom_height/2)+floorthick])
|
||||||
|
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),bottom_height],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
|
||||||
|
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "panel") {
|
||||||
|
union() {
|
||||||
|
translate([-gap,-gap,0])
|
||||||
|
cube([width-(2*wallthick),depth-(2*wallthick),floorthick]);
|
||||||
|
translate([(width*(1/5))-8-(wallthick+gap),depth-(2*wallthick)-gap-adj,0])
|
||||||
|
cube([8,wallthick+2*adj,floorthick]);
|
||||||
|
translate([width-(width*(1/5))-(wallthick+gap),depth-(2*wallthick)-gap-adj,0])
|
||||||
|
cube([8,wallthick+2*adj,floorthick]);
|
||||||
|
translate([(width*(1/5))-8-(wallthick+gap),-wallthick-gap+adj,0])
|
||||||
|
cube([8,wallthick+2*adj,floorthick]);
|
||||||
|
translate([width-(width*(1/5))-(wallthick+gap),-wallthick-gap+adj,0])
|
||||||
|
cube([8,wallthick+2*adj,floorthick]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "stacked") {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,floorthick/2])
|
||||||
|
cube_fillet_inside([width-(2*wallthick),depth-(2*wallthick),floorthick],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
if(case_design == "tray") {
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,(bottom_height)/2])
|
||||||
|
cube_fillet_inside([width,depth,bottom_height],
|
||||||
|
vertical=[0,0,0,0], top=[0,0,0,0],
|
||||||
|
bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,(bottom_height/2)+floorthick])
|
||||||
|
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),bottom_height+adj],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
|
||||||
|
top=[0,0,0,0],bottom=[2,2,2,2], $fn=90);
|
||||||
|
}
|
||||||
|
// right side nut
|
||||||
|
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+10,
|
||||||
|
floorthick+3.4]) rotate([90,0,90])
|
||||||
|
cylinder(d=10, h=4, $fn=6);
|
||||||
|
// left side nut
|
||||||
|
translate([-adj-gap,wallthick+gap+10,floorthick+3.4])
|
||||||
|
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
|
||||||
|
if(depth >= 75 && sbc_model != "visionfive2" && sbc_model != "visionfive2q" && sbc_model != "rock5b-v1.42" && sbc_model != "rock5bq-v1.42" && sbc_model != "rock5b-v1.3") {
|
||||||
|
translate([width-wallthick-gap-wallthick-4+adj,depth-wallthick-gap-10,
|
||||||
|
floorthick+3.4]) rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
|
||||||
|
translate([-adj-gap,depth-wallthick-gap-10,floorthick+3.4])
|
||||||
|
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(sbc_model == "visionfive2" || sbc_model == "visionfive2q" || sbc_model == "rock5b-v1.42" || sbc_model == "rock5bq-v1.42" || sbc_model == "rock5b-v1.3") {
|
||||||
|
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+58,
|
||||||
|
floorthick+3.4]) rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
|
||||||
|
translate([-adj-gap,wallthick+gap+58,floorthick+3.4])
|
||||||
|
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([width-wallthick-gap-wallthick-4+adj,wallthick+gap+40,
|
||||||
|
floorthick+3.4]) rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
|
||||||
|
translate([-adj-gap,wallthick+gap+40,floorthick+3.4])
|
||||||
|
rotate([90,0,90]) cylinder(d=10, h=4, $fn=6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// front panel
|
||||||
|
if(case_style == "sides" || case_style == "vu5" || case_style == "vu7") {
|
||||||
|
translate([-wallthick-gap,depth-(2*wallthick)-gap,bottom_height-adj])
|
||||||
|
rotate([0,0,0]) cube([width,wallthick,top_height]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([-wallthick-gap,depth-(2*wallthick)-gap,bottom_height-adj])
|
||||||
|
rotate([0,0,0]) cube([width,wallthick,top_height-floorthick]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// rear panel
|
||||||
|
translate([-wallthick-gap,-wallthick-gap,bottom_height-adj])
|
||||||
|
cube([width,wallthick,top_height-floorthick]);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(case_design == "round") {
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=bottom_height, r=case_diameter/2,
|
||||||
|
top=0, bottom=fillet, $fn=case_fn, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+floorthick]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=bottom_height+adj, r=(case_diameter/2)-lip/2,
|
||||||
|
top=0, bottom=fillet-1, $fn=case_fn, fillet_fn=case_ffn, center=true);
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,30])
|
||||||
|
cylinder(h=lip+adj, r=(case_diameter/2)+1, $fn=case_fn);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,30])
|
||||||
|
cylinder(h=lip+2*adj, r=(case_diameter/2)-lip/4, $fn=case_fn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+2*floorthick]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=bottom_height+adj+floorthick+lip,
|
||||||
|
r=(case_diameter/2)-lip/2,top=0,bottom=fillet-1, $fn=case_fn,
|
||||||
|
fillet_fn=case_ffn, center=true);
|
||||||
|
if(width/depth >= 1.4 && sbc_model != "vim1" && sbc_model != "vim2" &&
|
||||||
|
sbc_model != "vim3l" && sbc_model != "vim3" && sbc_model != "vim4" &&
|
||||||
|
sbc_model != "rpizero" && sbc_model != "rpizero2w") {
|
||||||
|
translate([-16,(depth/2)-150,-adj])
|
||||||
|
cube([width+10,300,case_z-2*floorthick-2]);
|
||||||
|
translate([width-9,(depth/2)-62.5,bottom_height-2*adj])
|
||||||
|
cube([20,110,top_height-2*floorthick-2]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([-width/2,0,-adj])
|
||||||
|
cube([300,depth+100,case_z-2*floorthick-2]);
|
||||||
|
translate([(-width+50)/2,-50,bottom_height-2*adj])
|
||||||
|
cube([width+50,50+adj,top_height-2*floorthick-2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "hex") {
|
||||||
|
if(width/depth >= 1.4 && sbc_model != "vim1" && sbc_model != "vim2" &&
|
||||||
|
sbc_model != "vim3l" && sbc_model != "vim3" && sbc_model != "vim4" &&
|
||||||
|
sbc_model != "rpizero" && sbc_model != "rpizero2w") {
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=bottom_height, r=case_diameter/2,
|
||||||
|
top=0, bottom=fillet, $fn=6, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+floorthick]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=bottom_height+adj,r=(case_diameter/2)-lip/2,top=0,
|
||||||
|
bottom=fillet-1,$fn=6,fillet_fn=case_ffn, center=true);
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,30])
|
||||||
|
cylinder(h=lip+adj,r=(case_diameter/2)+1, $fn=6);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,30])
|
||||||
|
cylinder(h=lip+2*adj,r=(case_diameter/2)-lip/4, $fn=6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+2*floorthick]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=bottom_height+adj+floorthick+lip,
|
||||||
|
r=(case_diameter/2)-lip/2,top=0, bottom=fillet-1, $fn=6,
|
||||||
|
fillet_fn=case_ffn, center=true);
|
||||||
|
translate([-16,(depth/2)-150,-adj])
|
||||||
|
cube([width+10,300,case_z-2*floorthick-2]);
|
||||||
|
translate([width-9,(depth/2)-62.5,bottom_height-2*adj])
|
||||||
|
cube([20,110,top_height-2*floorthick-2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height/2]) rotate([0,0,0])
|
||||||
|
cylinder_fillet_inside(h=bottom_height, r=hex_diameter/2,
|
||||||
|
top=0, bottom=fillet, $fn=6, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+floorthick]) rotate([0,0,0])
|
||||||
|
cylinder_fillet_inside(h=bottom_height+adj,r=(hex_diameter/2)-lip/2,top=0,
|
||||||
|
bottom=fillet-1,$fn=6,fillet_fn=case_ffn, center=true);
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,0])
|
||||||
|
cylinder(h=lip+adj,r=(hex_diameter/2)+1, $fn=6);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-lip]) rotate([0,0,0])
|
||||||
|
cylinder(h=lip+2*adj,r=(hex_diameter/2)-lip/4, $fn=6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,(bottom_height/2)+2*floorthick]) rotate([0,0,0])
|
||||||
|
cylinder_fillet_inside(h=bottom_height+adj+floorthick+lip,
|
||||||
|
r=(hex_diameter/2)-lip/2,top=0, bottom=fillet-1, $fn=6,
|
||||||
|
fillet_fn=case_ffn, center=true);
|
||||||
|
translate([-width/2,0,-adj])
|
||||||
|
cube([300,depth+100,case_z-2*floorthick-2]);
|
||||||
|
translate([(-width+50)/2,-50,bottom_height-2*adj])
|
||||||
|
cube([width+50,50+adj,top_height-2*floorthick-2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "snap") {
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,(floorthick+case_z)/2])
|
||||||
|
cube_fillet_inside([width,depth,floorthick+case_z],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,floorthick+(floorthick+case_z)/2])
|
||||||
|
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),case_z+floorthick],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
|
||||||
|
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
// snap top indent
|
||||||
|
translate([-gap-wallthick+.75,(depth/2)-(depth*.75)/2-gap-wallthick,case_z-.5])
|
||||||
|
rotate([0,45,0]) cube([4,depth*.75,4]);
|
||||||
|
translate([width-wallthick-gap-6.25,(depth/2)-(depth*.75)/2-gap-wallthick,case_z-.5])
|
||||||
|
rotate([0,45,0]) cube([4,depth*.75,4]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "fitted") {
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z/2])
|
||||||
|
cube_fillet_inside([width,depth,case_z],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
translate([(width/2)-wallthick-gap,
|
||||||
|
(depth/2)-wallthick-gap,(case_z/2)+floorthick])
|
||||||
|
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),case_z],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
|
||||||
|
top=[0,0,0,0], bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-lip/2])
|
||||||
|
cube_fillet_inside([width+adj,depth+adj,lip+adj],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[0,0,0,0],bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-lip/2])
|
||||||
|
cube_fillet_inside([width-wallthick,depth-wallthick,lip+adj],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],top=[0,0,0,0],
|
||||||
|
bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// additive accessories
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if(class == "add1" && face == "bottom") {
|
||||||
|
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// side attachment holes
|
||||||
|
if(case_design == "tray") {
|
||||||
|
// right side bottom attachment holes
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
// right side bottom nut inset
|
||||||
|
translate([width-3.5-(2*wallthick)-gap-.6,wallthick+gap+10,
|
||||||
|
floorthick+3.4]) rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
|
||||||
|
// left side bottom attachment holes
|
||||||
|
translate([-wallthick-gap-adj,wallthick+gap+10,floorthick+3.4]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
// left side bottom nut inset
|
||||||
|
translate([-gap+.6,wallthick+gap+10,floorthick+3.4])
|
||||||
|
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
|
||||||
|
if(depth >= 75 && sbc_model != "visionfive2" && sbc_model != "visionfive2q" && sbc_model != "rock5b-v1.42" && sbc_model != "rock5bq-v1.42" && sbc_model != "rock5b-v1.3") {
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,depth-wallthick-gap-10,
|
||||||
|
floorthick+3.4]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([-wallthick-gap-adj-6,depth-wallthick-gap-10,
|
||||||
|
floorthick+3.4]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([width-3.5-(2*wallthick)-gap-.6,depth-wallthick-gap-10,
|
||||||
|
floorthick+3.4])rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
|
||||||
|
translate([-gap+.6,depth-wallthick-gap-10,floorthick+3.4])
|
||||||
|
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(sbc_model == "visionfive2" || sbc_model == "visionfive2q" || sbc_model == "rock5b-v1.42" || sbc_model == "rock5bq-v1.42" || sbc_model == "rock5b-v1.3") {
|
||||||
|
translate([width-3*(wallthick+gap)-adj,wallthick+gap+58,
|
||||||
|
floorthick+3.4]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([-wallthick-gap-adj-6,wallthick+gap+58,
|
||||||
|
floorthick+3.4]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([width-3.5-(2*wallthick)-gap-.6,wallthick+gap+58,
|
||||||
|
floorthick+3.4])rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
|
||||||
|
translate([-gap+.6,wallthick+gap+58,floorthick+3.4])
|
||||||
|
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([width-3*(wallthick+gap)-adj,wallthick+gap+40,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([-wallthick-gap-adj-6,wallthick+gap+40,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([width-3.5-(2*wallthick)-gap-.6,wallthick+gap+40,
|
||||||
|
floorthick+3.4])rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
|
||||||
|
translate([-gap+.6,wallthick+gap+40,floorthick+3.4])
|
||||||
|
rotate([90,0,90]) cylinder(d=6.6, h=3.5, $fn=6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// pcb standoff holes
|
||||||
|
if(sbc_bottom_standoffs == true && bottom_standoff[5] != 4) {
|
||||||
|
for (i=[1:11:len(sbc_data[s[0]])-2]) {
|
||||||
|
class = sbc_data[s[0]][i+1];
|
||||||
|
type = sbc_data[s[0]][i+2];
|
||||||
|
id = sbc_data[s[0]][i+3];
|
||||||
|
pcb_hole_x = sbc_data[s[0]][i+4];
|
||||||
|
pcb_hole_y = sbc_data[s[0]][i+5];
|
||||||
|
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||||
|
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||||
|
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||||
|
if(class == "pcbhole" && id == pcb_id && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" || pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,-1]) cylinder(d=6.5, h=bottom_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// extended standoff holes
|
||||||
|
if(case_ext_standoffs == true) {
|
||||||
|
// right-rear standoff
|
||||||
|
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([width-(2*(wallthick+gap))-(c_fillet/2),(c_fillet/2),-1]) cylinder(d=6.5, h=bottom_height);
|
||||||
|
}
|
||||||
|
// right-front standoff
|
||||||
|
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10) || width-pcb_loc_x-pcb_width >= 10) {
|
||||||
|
translate([width-(c_fillet/2)-(2*(wallthick+gap)),
|
||||||
|
depth-(c_fillet/2)-(2*(wallthick+gap)),-1]) cylinder(d=6.5, h=bottom_height);
|
||||||
|
}
|
||||||
|
// left-rear standoff
|
||||||
|
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([(c_fillet/2),(c_fillet/2),-1]) cylinder(d=6.5, h=bottom_height);
|
||||||
|
}
|
||||||
|
// left-front standoff
|
||||||
|
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
|
||||||
|
translate([(c_fillet/2),depth-(c_fillet/2)-(2*(wallthick+gap)),-1])
|
||||||
|
cylinder(d=6.5, h=bottom_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// pcb standoffs
|
||||||
|
if(sbc_bottom_standoffs == true) {
|
||||||
|
for (i=[1:11:len(sbc_data[s[0]])-2]) {
|
||||||
|
class = sbc_data[s[0]][i+1];
|
||||||
|
type = sbc_data[s[0]][i+2];
|
||||||
|
id = sbc_data[s[0]][i+3];
|
||||||
|
pcb_hole_x = sbc_data[s[0]][i+4];
|
||||||
|
pcb_hole_y = sbc_data[s[0]][i+5];
|
||||||
|
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||||
|
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||||
|
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||||
|
|
||||||
|
if(pcb_hole_x!=0 && pcb_hole_y!=0) {
|
||||||
|
if (pcb_hole_pos == "left_rear") {
|
||||||
|
normal_standoff = [bottom_standoff[0],
|
||||||
|
bottom_height-pcb_z+pcb_loc_z+bottom_rear_left,
|
||||||
|
bottom_standoff[2],
|
||||||
|
bottom_standoff[3],
|
||||||
|
bottom_standoff[4],
|
||||||
|
bottom_standoff[5],
|
||||||
|
bottom_standoff[6],
|
||||||
|
bottom_standoff[7],
|
||||||
|
bottom_standoff[8],
|
||||||
|
bottom_standoff[9],
|
||||||
|
bottom_standoff[10]];
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,0]) standoff(normal_standoff);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "left_front") {
|
||||||
|
normal_standoff = [bottom_standoff[0],
|
||||||
|
bottom_height-pcb_z+pcb_loc_z+bottom_front_left,
|
||||||
|
bottom_standoff[2],
|
||||||
|
bottom_standoff[3],
|
||||||
|
bottom_standoff[4],
|
||||||
|
bottom_standoff[5],
|
||||||
|
bottom_standoff[6],
|
||||||
|
bottom_standoff[7],
|
||||||
|
bottom_standoff[8],
|
||||||
|
bottom_standoff[9],
|
||||||
|
bottom_standoff[10]];
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,0]) standoff(normal_standoff);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_rear") {
|
||||||
|
normal_standoff = [bottom_standoff[0],
|
||||||
|
bottom_height-pcb_z+pcb_loc_z+bottom_rear_right,
|
||||||
|
bottom_standoff[2],
|
||||||
|
bottom_standoff[3],
|
||||||
|
bottom_standoff[4],
|
||||||
|
bottom_standoff[5],
|
||||||
|
bottom_standoff[6],
|
||||||
|
bottom_standoff[7],
|
||||||
|
bottom_standoff[8],
|
||||||
|
bottom_standoff[9],
|
||||||
|
bottom_standoff[10]];
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,0]) standoff(normal_standoff);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_front") {
|
||||||
|
normal_standoff = [bottom_standoff[0],
|
||||||
|
bottom_height-pcb_z+pcb_loc_z+bottom_front_right,
|
||||||
|
bottom_standoff[2],
|
||||||
|
bottom_standoff[3],
|
||||||
|
bottom_standoff[4],
|
||||||
|
bottom_standoff[5],
|
||||||
|
bottom_standoff[6],
|
||||||
|
bottom_standoff[7],
|
||||||
|
bottom_standoff[8],
|
||||||
|
bottom_standoff[9],
|
||||||
|
bottom_standoff[10]];
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,0]) standoff(normal_standoff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// extended standoffs
|
||||||
|
if(case_ext_standoffs == true) {
|
||||||
|
// right-rear standoff
|
||||||
|
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([width-(2*(wallthick+gap))-(c_fillet/2),(c_fillet/2),0]) standoff(bottom_ext_standoff);
|
||||||
|
}
|
||||||
|
// right-front standoff
|
||||||
|
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10) || width-pcb_loc_x-pcb_width >= 10) {
|
||||||
|
translate([width-(c_fillet/2)-(2*(wallthick+gap)),
|
||||||
|
depth-(c_fillet/2)-(2*(wallthick+gap)),0]) standoff(bottom_ext_standoff);
|
||||||
|
}
|
||||||
|
// left-rear standoff
|
||||||
|
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([(c_fillet/2),(c_fillet/2),0]) standoff(bottom_ext_standoff);
|
||||||
|
}
|
||||||
|
// left-front standoff
|
||||||
|
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
|
||||||
|
translate([(c_fillet/2),depth-(c_fillet/2)-(2*(wallthick+gap)),0])
|
||||||
|
standoff(bottom_ext_standoff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// standoff sidewall support
|
||||||
|
if(sidewall_support == true && sbc_bottom_standoffs == true) {
|
||||||
|
if(pcb_width/pcb_depth >= 1.4) {
|
||||||
|
for (i=[1:11:len(sbc_data[s[0]])-2]) {
|
||||||
|
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||||
|
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||||
|
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||||
|
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||||
|
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||||
|
|
||||||
|
if(pcb_hole_x!=0 && pcb_hole_y!=0) {
|
||||||
|
if(pcb_hole_pos == "left_rear") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y-(bottom_standoff[0]/2)-(gap+adj)-1,0])
|
||||||
|
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_rear_left]);
|
||||||
|
}
|
||||||
|
if(pcb_hole_pos == "left_front") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y+(bottom_standoff[0]/2)-.6+adj,0])
|
||||||
|
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_front_left]);
|
||||||
|
}
|
||||||
|
if(pcb_hole_pos == "right_rear") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y-(bottom_standoff[0]/2)-(gap+adj)-1,0])
|
||||||
|
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_rear_right]);
|
||||||
|
}
|
||||||
|
if(pcb_hole_pos == "right_front") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y+(bottom_standoff[0]/2)-.6+adj,0])
|
||||||
|
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_front_right]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (i=[1:11:len(sbc_data[s[0]])-2]) {
|
||||||
|
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||||
|
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||||
|
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||||
|
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||||
|
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||||
|
|
||||||
|
if(pcb_hole_x!=0 && pcb_hole_y!=0) {
|
||||||
|
if(pcb_hole_pos == "left_rear" && sbc_model != "n2l") {
|
||||||
|
translate([pcb_hole_x-(bottom_standoff[0]/2)-2.6+adj, pcb_hole_y-gap,0])
|
||||||
|
cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+bottom_rear_left]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "left_rear" && sbc_model == "n2l") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y-(bottom_standoff[0]/2)-(gap+adj)-1,0])
|
||||||
|
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_rear_left]);
|
||||||
|
}
|
||||||
|
if(pcb_hole_pos == "left_front" && sbc_model != "n2l") {
|
||||||
|
translate([pcb_hole_x-(bottom_standoff[0]/2)-2.6+adj, pcb_hole_y-gap,0])
|
||||||
|
cube([gap+1.6,2,bottom_height-pcb_z+pcb_loc_z+bottom_front_left]);
|
||||||
|
}
|
||||||
|
if(pcb_hole_pos == "left_front" && sbc_model == "n2l") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y+(bottom_standoff[0]/2)-.6+adj,0])
|
||||||
|
cube([2,gap+1.6,bottom_height-pcb_z+pcb_loc_z+bottom_front_left]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_rear") {
|
||||||
|
translate([pcb_hole_x+(bottom_standoff[0]/2)-.5+adj, pcb_hole_y-gap,0])
|
||||||
|
cube([gap+1.5,2,bottom_height-pcb_z+pcb_loc_z+bottom_rear_right]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_front") {
|
||||||
|
translate([pcb_hole_x+(bottom_standoff[0]/2)-.5+adj, pcb_hole_y-gap,0])
|
||||||
|
cube([gap+1.5,2,bottom_height-pcb_z+pcb_loc_z+bottom_front_right]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// extended standoff sidewall support
|
||||||
|
if(case_ext_standoffs == true && sidewall_support == true) {
|
||||||
|
// right-rear standoff
|
||||||
|
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([width-(2*(wallthick+gap))-(c_fillet/2)+(bottom_ext_standoff[0]/2)-.5,
|
||||||
|
(c_fillet/2)-1,0]) cube([gap+adj+2,2,bottom_ext_standoff[1]]);
|
||||||
|
}
|
||||||
|
// right-front standoff
|
||||||
|
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10)
|
||||||
|
|| width-pcb_loc_x-pcb_width >= 10) {
|
||||||
|
translate([width-(2*(wallthick+gap))-(c_fillet/2)+(bottom_ext_standoff[0]/2)-.5,
|
||||||
|
depth-(c_fillet/2)-(2*(wallthick+gap))-1,0])
|
||||||
|
cube([gap+adj+2,2,bottom_ext_standoff[1]]);
|
||||||
|
}
|
||||||
|
// left-rear standoff
|
||||||
|
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([(c_fillet/2)-(wallthick+gap)-(bottom_ext_standoff[0]/2)+.6,
|
||||||
|
(c_fillet/2)-1,0]) cube([gap+adj+2,2,bottom_ext_standoff[1]]);
|
||||||
|
}
|
||||||
|
// left-front standoff
|
||||||
|
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
|
||||||
|
translate([(c_fillet/2)-(wallthick+gap)-(bottom_ext_standoff[0]/2)+.6,
|
||||||
|
depth-(c_fillet/2)-(2*(wallthick+gap))-1,0])
|
||||||
|
cube([gap+adj+2,2,bottom_ext_standoff[1]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// subtractive accessories
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if ((class == "sub" && face == "bottom") || class == "suball") {
|
||||||
|
if(accessory_highlight == false) {
|
||||||
|
parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// create openings for additive
|
||||||
|
if (class == "add2" && face == "bottom" && type == "standoff") {
|
||||||
|
parametric_move_sub("round",loc_x,loc_y,loc_z-.1,face,rotation,parametric,
|
||||||
|
6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && type == "uart_holder") {
|
||||||
|
if(accessory_highlight == false) {
|
||||||
|
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
|
||||||
|
0,0,0,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
|
||||||
|
0,0,0,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+25.5,face,rotation,parametric,
|
||||||
|
26.5,wallthick+gap+4,15,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "access_port") {
|
||||||
|
if(data_3 == "landscape") {
|
||||||
|
if(rotation[2] == 180) {
|
||||||
|
parametric_move_sub("rectangle",loc_x-6+size_x,loc_y+.5+size_y,loc_z-adj,face,rotation,
|
||||||
|
parametric,size_x-17,size_y-1,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
parametric_move_sub("rectangle",loc_x-size_x+12.5+size_x,loc_y-(size_y/2)+6+size_y,loc_z-adj,
|
||||||
|
face,rotation,parametric,5.5,10.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
parametric_move_sub("rectangle",loc_x+6,loc_y-.5,loc_z-adj,face,rotation,
|
||||||
|
parametric,size_x-17,size_y-1,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
parametric_move_sub("rectangle",loc_x+size_x-12.5,loc_y+(size_y/2)-6,loc_z-adj,face,rotation,
|
||||||
|
parametric,5.5,10.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(rotation[2] == 180) {
|
||||||
|
if(data_3 == "portrait") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+size_x-.5,loc_y+size_y-5.75,loc_z-adj,face,
|
||||||
|
rotation,parametric,size_x-1,size_y-17,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
parametric_move_sub("rectangle",loc_x-(size_x/2)+5+size_x,loc_y-size_y+12.5+size_y,
|
||||||
|
loc_z-adj,face,rotation,parametric,10.5,5.5,floorthick+.12,data_1,data_2,data_3,
|
||||||
|
[5.5,5.5,5.5,5.5]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
parametric_move_sub("rectangle",loc_x-.5,loc_y-5.75,loc_z-adj,face,rotation,
|
||||||
|
parametric,size_x-1,size_y-17,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
parametric_move_sub("rectangle",loc_x-(size_x/2)+5,loc_y-size_y+12.5,loc_z-adj,face,
|
||||||
|
rotation,parametric,10.5,5.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
parametric_move_sub("rectangle",loc_x+.5,loc_y+5.75,loc_z-adj,face,rotation,
|
||||||
|
parametric,size_x-1,size_y-17,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
parametric_move_sub("rectangle",loc_x+(size_x/2)-5,loc_y+size_y-12.5,loc_z-adj,face,rotation,
|
||||||
|
parametric,10.5,5.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((class == "model") && face == "bottom" && type == "h2_netcard") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+25,loc_y-6,loc_z-14,face,rotation,
|
||||||
|
parametric,68.5,wallthick+3,14.5,data_1,data_2,data_3,[1,1,1,1]);
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
|
||||||
|
if(data_3 == "recess") {
|
||||||
|
#parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
|
||||||
|
parametric,size_x-1,size_y,size_z,data_1,data_2,data_3,0);
|
||||||
|
}
|
||||||
|
if(data_3 == "cutout") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
|
||||||
|
parametric,size_x+2,size_y+1,size_z+2*adj,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sbc openings
|
||||||
|
if(sbc_highlight == true) {
|
||||||
|
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model,"default",0,"default","default",true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model,"default",0,"default","default",true);
|
||||||
|
}
|
||||||
|
// clean fillets
|
||||||
|
if(case_design == "shell") {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,bottom_height/2])
|
||||||
|
cube_negative_fillet([width,depth,bottom_height], radius=-1,
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet], top=[0,0,0,0],
|
||||||
|
bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// additive accessories
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if(class == "add2" && face == "bottom") {
|
||||||
|
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
322
mod/case_side.scad
Normal file
322
mod/case_side.scad
Normal file
@@ -0,0 +1,322 @@
|
|||||||
|
|
||||||
|
|
||||||
|
// case side
|
||||||
|
module case_side(case_design,case_style,side) {
|
||||||
|
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
if(case_design == "panel") {
|
||||||
|
if(side == "rear") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([-gap,-wallthick-gap,-floorthick])
|
||||||
|
cube([width-2*wallthick,wallthick,case_z+2*floorthick]);
|
||||||
|
// right hook
|
||||||
|
difference() {
|
||||||
|
translate([width-(2*wallthick)-gap-adj,-wallthick-gap,
|
||||||
|
((case_z)/2)-4])
|
||||||
|
cube([(2*wallthick)+.5,wallthick,8]);
|
||||||
|
translate([width-(2*wallthick)-gap-adj,-wallthick-gap-adj,
|
||||||
|
((case_z)/2)-4-adj])
|
||||||
|
cube([wallthick+.25,wallthick+(2*adj),4.25]);
|
||||||
|
}
|
||||||
|
// left hook
|
||||||
|
difference() {
|
||||||
|
translate([-(2*wallthick)-gap-adj-.25,-wallthick-gap,
|
||||||
|
((case_z)/2)-4])
|
||||||
|
cube([(2*wallthick)+.5,wallthick,8]);
|
||||||
|
translate([-wallthick-gap-adj-.25,-wallthick-gap-adj,
|
||||||
|
((case_z)/2)-4-adj])
|
||||||
|
cube([wallthick+.25,wallthick+(2*adj),4.25]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// top slots
|
||||||
|
translate([(width*(1/5))-8.25-(wallthick+gap),-wallthick-gap-adj,
|
||||||
|
case_z-floorthick-.25])
|
||||||
|
cube([8.5,wallthick+2*adj,floorthick+.5]);
|
||||||
|
translate([width-(width*(1/5))-(wallthick+gap)-.25,-wallthick-gap-adj,
|
||||||
|
case_z-floorthick-.25])
|
||||||
|
cube([8.5,wallthick+2*adj,floorthick+.5]);
|
||||||
|
// bottom slots
|
||||||
|
translate([(width*(1/5))-8.25-(wallthick+gap),-wallthick-gap-adj,-.25])
|
||||||
|
cube([8.5,wallthick+2*adj,floorthick+.5]);
|
||||||
|
translate([width-(width*(1/5))-(wallthick+gap)-.25,-wallthick-gap-adj,-.25])
|
||||||
|
cube([8.5,wallthick+2*adj,floorthick+.5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(side == "front") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([-gap,depth-2*(wallthick)-gap,-floorthick])
|
||||||
|
cube([width-2*wallthick,wallthick,case_z+2*floorthick]);
|
||||||
|
// right hook
|
||||||
|
difference() {
|
||||||
|
translate([width-(2*wallthick)-gap-adj,depth-2*(wallthick)-gap-adj,
|
||||||
|
((case_z)/2)-4])
|
||||||
|
cube([(2*wallthick)+.5,wallthick,8]);
|
||||||
|
translate([width-(2*wallthick)-gap-adj,
|
||||||
|
depth-2*(wallthick)-adj-gap-adj,((case_z)/2)-4-adj])
|
||||||
|
cube([wallthick+.25,wallthick+(2*adj),4.25]);
|
||||||
|
}
|
||||||
|
// left hook
|
||||||
|
difference() {
|
||||||
|
translate([-(2*wallthick)-gap-adj-.25,depth-2*(wallthick)-gap-adj,(
|
||||||
|
(case_z)/2)-4])
|
||||||
|
cube([(2*wallthick)+.5,wallthick,8]);
|
||||||
|
translate([-wallthick-gap-adj-.25,depth-2*(wallthick)-adj-gap-adj,
|
||||||
|
((case_z)/2)-4-adj])
|
||||||
|
cube([wallthick+.25,wallthick+(2*adj),4.25]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// top slots
|
||||||
|
translate([(width*(1/5))-8.25-(wallthick+gap),depth-2*wallthick-gap-adj,
|
||||||
|
case_z-floorthick-.25])
|
||||||
|
cube([8.5,wallthick+2*adj,floorthick+.5]);
|
||||||
|
translate([width-(width*(1/5))-(wallthick+gap)-.25,depth-2*wallthick-gap-adj,
|
||||||
|
case_z-floorthick-.25])
|
||||||
|
cube([8.5,wallthick+2*adj,floorthick+.5]);
|
||||||
|
// bottom slots
|
||||||
|
translate([(width*(1/5))-8.25-(wallthick+gap),depth-2*wallthick-gap-adj,-.25])
|
||||||
|
cube([8.5,wallthick+2*adj,floorthick+.5]);
|
||||||
|
translate([width-(width*(1/5))-(wallthick+gap)-.25,
|
||||||
|
depth-2*wallthick-gap-adj,-.25]) cube([8.5,wallthick+2*adj,floorthick+.5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(side == "right") {
|
||||||
|
difference() {
|
||||||
|
translate([width-(2*wallthick)-gap,-(2*wallthick)-gap,-wallthick])
|
||||||
|
cube([wallthick,depth+2*wallthick,case_z+(2*wallthick)]);
|
||||||
|
translate([width-(2*wallthick)-gap-adj,-wallthick-gap-.25,
|
||||||
|
((case_z)/2)]) cube([wallthick+2*adj,wallthick+.5,8.5]);
|
||||||
|
translate([width-(2*wallthick)-gap-adj,depth-2*(wallthick)-gap-.25,
|
||||||
|
((case_z)/2)])
|
||||||
|
cube([wallthick+2*adj,wallthick+.5,8.5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(side == "left") {
|
||||||
|
difference() {
|
||||||
|
translate([-wallthick-gap,-(2*wallthick)-gap,-wallthick])
|
||||||
|
cube([wallthick,depth+2*wallthick,case_z+(2*wallthick)]);
|
||||||
|
translate([-wallthick-gap-adj,-wallthick-gap-.25,((case_z)/2)])
|
||||||
|
cube([wallthick+2*adj,wallthick+.5,8.5]);
|
||||||
|
translate([-wallthick-gap-adj,depth-2*(wallthick)-gap-.25,
|
||||||
|
((case_z)/2)])
|
||||||
|
cube([wallthick+2*adj,wallthick+.5,8.5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "tray" && case_style == "sides") {
|
||||||
|
if(side == "right") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([width-wallthick-gap,-(2*wallthick)-gap,0])
|
||||||
|
cube([sidethick,depth+2*wallthick,case_z+(2*wallthick)]);
|
||||||
|
translate([width-gap-wallthick-1+adj,depth-2*(wallthick+gap)-.5,case_z+(2*wallthick)-2])
|
||||||
|
cube([1,6,2]);
|
||||||
|
translate([width-gap-wallthick-1+adj,-2*(wallthick+gap)+1.5,case_z+(2*wallthick)-2])
|
||||||
|
cube([1,6,2]);
|
||||||
|
// top rail
|
||||||
|
translate([width-6.9-adj,-gap,case_z-floorthick-.5])
|
||||||
|
cube([4,depth-2*(wallthick+gap),2]);
|
||||||
|
}
|
||||||
|
// right side bottom attachment holes
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
if(depth >= 75) {
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,depth-wallthick-gap-10,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+40,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(side == "left") {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
translate([-wallthick-gap-sidethick,-(2*wallthick)-gap,0])
|
||||||
|
cube([sidethick,depth+2*wallthick,case_z+(2*wallthick)]);
|
||||||
|
translate([-gap-wallthick-adj,depth-2*(wallthick+gap)-.5,case_z+(2*wallthick)-2])
|
||||||
|
cube([1,6,2]);
|
||||||
|
translate([-gap-wallthick-adj,-2*(wallthick+gap)+1.5,case_z+(2*wallthick)-2])
|
||||||
|
cube([1,6,2]);
|
||||||
|
// top rail
|
||||||
|
translate([-wallthick-gap-adj,-gap,case_z-floorthick-.5])
|
||||||
|
cube([4,depth-2*(wallthick+gap),2]);
|
||||||
|
}
|
||||||
|
// left side bottom attachment holes
|
||||||
|
translate([-wallthick-gap-adj-5,wallthick+gap+10,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
if(depth >= 75) {
|
||||||
|
translate([-wallthick-gap-adj-6,depth-wallthick-gap-10,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([-wallthick-gap-adj-6,wallthick+gap+40,
|
||||||
|
((bottom_height+floorthick)/2)-1]) rotate([0,90,0])
|
||||||
|
cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "tray" && case_style == "vu5") {
|
||||||
|
cheight = case_z+90;
|
||||||
|
vesa = 75;
|
||||||
|
vu_holder(case_style,side,vesa,cheight);
|
||||||
|
}
|
||||||
|
if(case_design == "tray" && case_style == "vu7") {
|
||||||
|
cheight = case_z+122;
|
||||||
|
vesa = 100;
|
||||||
|
vu_holder(case_style,side,vesa,cheight);
|
||||||
|
}
|
||||||
|
// additive accessories
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if (class == "add1" && face == side) {
|
||||||
|
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if ((class == "sub" && face == side) || class == "suball") {
|
||||||
|
if(accessory_highlight == false) {
|
||||||
|
parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// create openings for additive
|
||||||
|
if ((class == "sub" && face == "bottom") || class == "suball") {
|
||||||
|
if(accessory_highlight == false) {
|
||||||
|
parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// create openings for additive
|
||||||
|
if (class == "add2" && face == "bottom" && type == "standoff") {
|
||||||
|
parametric_move_sub("round",loc_x,loc_y,-.1,face,rotation,parametric,
|
||||||
|
6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
|
||||||
|
if(accessory_highlight == false) {
|
||||||
|
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
|
||||||
|
0,0,0,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
|
||||||
|
0,0,0,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+25.5,face,rotation,
|
||||||
|
parametric,26.5,wallthick+gap+4,15,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "access_port") {
|
||||||
|
if(data_3 == "landscape") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+6,loc_y-.5,loc_z-adj,face,rotation,
|
||||||
|
parametric,size_x-17,size_y-1,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
parametric_move_sub("rectangle",loc_x+size_x-12.5,loc_y+(size_y/2)-6,loc_z-adj,face,rotation,
|
||||||
|
parametric,5.5,10.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
parametric_move_sub("rectangle",loc_x+.5,loc_y+5.75,loc_z-adj,face,rotation,parametric,
|
||||||
|
size_x-1,size_y-17,floorthick+1,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
parametric_move_sub("rectangle",loc_x+(size_x/2)-5,loc_y+size_y-12.5,loc_z-adj,face,rotation,
|
||||||
|
parametric,10.5,5.5,floorthick+.12,data_1,data_2,data_3,[5.5,5.5,5.5,5.5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((class == "model") && face == "bottom" && type == "h2_netcard") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+25,loc_y-6,loc_z-14,face,rotation,
|
||||||
|
parametric,68.5,wallthick+3,14.5,data_1,data_2,data_3,[1,1,1,1]);
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "button") {
|
||||||
|
if(data_3 == "recess") {
|
||||||
|
parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
|
||||||
|
parametric,size_x-1,size_y,size_z,data_1,data_2,data_3,0);
|
||||||
|
}
|
||||||
|
if(data_3 == "cutout") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
|
||||||
|
parametric,size_x+2,size_y+1,size_z+2*adj,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sbc openings
|
||||||
|
if(sbc_highlight == true) {
|
||||||
|
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model,"default",0,"default","default",true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model,"default",0,"default","default",true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if (class == "add2" && face == side) {
|
||||||
|
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
595
mod/case_top.scad
Normal file
595
mod/case_top.scad
Normal file
@@ -0,0 +1,595 @@
|
|||||||
|
|
||||||
|
|
||||||
|
// case top
|
||||||
|
module case_top(case_design) {
|
||||||
|
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
if(case_design == "shell") {
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,
|
||||||
|
(depth/2)-wallthick-gap,bottom_height+(top_height/2)])
|
||||||
|
cube_fillet_inside([width,depth,top_height],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[fillet,fillet,fillet,fillet,fillet],
|
||||||
|
bottom=[0,0,0,0], $fn=90);
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,
|
||||||
|
bottom_height+(top_height/2)-floorthick])
|
||||||
|
cube_fillet_inside([width-(wallthick*2),depth-(wallthick*2),top_height],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
|
||||||
|
top=[fillet,fillet,fillet,fillet,fillet],
|
||||||
|
bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "panel") {
|
||||||
|
union() {
|
||||||
|
translate([-gap,-gap,case_z-floorthick])
|
||||||
|
cube([width-(2*wallthick),depth-(2*wallthick),floorthick]);
|
||||||
|
translate([(width*(1/5))-8-(wallthick+gap),depth-(2*wallthick)-gap-adj,
|
||||||
|
case_z-floorthick])
|
||||||
|
cube([8,wallthick+2*adj,floorthick]);
|
||||||
|
translate([width-(width*(1/5))-(wallthick+gap),depth-(2*wallthick)-gap-adj,
|
||||||
|
case_z-floorthick])
|
||||||
|
cube([8,wallthick+2*adj,floorthick]);
|
||||||
|
translate([(width*(1/5))-8-(wallthick+gap),-wallthick-gap+adj,
|
||||||
|
case_z-floorthick])
|
||||||
|
cube([8,wallthick+2*adj,floorthick]);
|
||||||
|
translate([width-(width*(1/5))-(wallthick+gap),-wallthick-gap+adj,
|
||||||
|
case_z-floorthick])
|
||||||
|
cube([8,wallthick+2*adj,floorthick]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "stacked") {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,
|
||||||
|
case_z-(floorthick/2)])
|
||||||
|
cube_fillet_inside([width-(2*wallthick),depth-(2*wallthick),floorthick],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
if(case_design == "tray" && (case_style == "vu5" || case_style == "vu7" || case_style == "sides")) {
|
||||||
|
translate([-wallthick-gap+.5,-wallthick-gap,case_z])
|
||||||
|
cube([width-1,depth,floorthick]);
|
||||||
|
translate([-wallthick-gap+.5,-wallthick-gap,
|
||||||
|
case_z-floorthick+adj]) cube([width-1,wallthick,wallthick]);
|
||||||
|
}
|
||||||
|
if(case_design == "tray" && case_style == "none") {
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z/2])
|
||||||
|
cube_fillet_inside([width+2*wallthick+1,depth,case_z],
|
||||||
|
vertical=[0,0,0,0], top=[0,fillet,0,fillet,fillet],
|
||||||
|
bottom=[0,0,0,0], $fn=90);
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,(case_z/2)-floorthick+.25])
|
||||||
|
cube_fillet_inside([width+1,depth+(wallthick*2),case_z],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
|
||||||
|
top=[0,0,0,0],bottom=[0,0,0,0], $fn=90);
|
||||||
|
// right side bottom attachment hole
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
// left side bottom attachment hole
|
||||||
|
translate([-2*(wallthick+gap)-sidethick-adj,wallthick+gap+10,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
if(depth >= 75 && sbc_model != "visionfive2" && sbc_model != "visionfive2q"&& sbc_model != "rock5b-v1.42" && sbc_model != "rock5bq-v1.42" && sbc_model != "rock5b-v1.3") {
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,depth-wallthick-gap-10,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([-wallthick-gap-adj-6,depth-wallthick-gap-10,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(sbc_model == "visionfive2" || sbc_model == "visionfive2q" || sbc_model == "rock5b-v1.42" || sbc_model == "rock5bq-v1.42" || sbc_model == "rock5b-v1.3") {
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+58,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([-wallthick-gap-adj-6,wallthick+gap+58,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([width-2*(wallthick+gap)-sidethick-adj,wallthick+gap+40,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
translate([-wallthick-gap-adj-6,wallthick+gap+40,
|
||||||
|
floorthick+3.4]) rotate([0,90,0]) cylinder(d=3, h=10+sidethick+(2*adj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "round") {
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-lip/2]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=top_height+lip, r=case_diameter/2,
|
||||||
|
top=fillet, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-floorthick-lip/2]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=top_height+lip, r=(case_diameter/2)-wallthick,
|
||||||
|
top=fillet-1, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-adj-lip/2]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=lip+2*adj, r=(case_diameter/2)-wallthick/2+tol/2,
|
||||||
|
top=fillet-1, bottom=0, $fn=case_fn, fillet_fn=case_ffn, center=true);
|
||||||
|
// io cutout
|
||||||
|
if(width/depth >= 1.4 && sbc_model != "vim1" && sbc_model != "vim2" &&
|
||||||
|
sbc_model != "vim3l" && sbc_model != "vim3" && sbc_model != "vim4" &&
|
||||||
|
sbc_model != "rpizero" && sbc_model != "rpizero2w") {
|
||||||
|
translate([width,(depth/2)-wallthick-gap,bottom_height-lip+top_height/2-floorthick])
|
||||||
|
cube_fillet_inside([18,depth-2*(wallthick+gap)-1,top_height+lip+2],
|
||||||
|
vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([(width/2)-wallthick-gap,-20,bottom_height-lip+top_height/2-floorthick])
|
||||||
|
cube_fillet_inside([width-2*(wallthick+gap)-1,40,top_height+lip+2],
|
||||||
|
vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(width/depth >= 1.4 && sbc_model != "vim1" && sbc_model != "vim2" &&
|
||||||
|
sbc_model != "vim3l" && sbc_model != "vim3" && sbc_model != "vim4" &&
|
||||||
|
sbc_model != "rpizero" && sbc_model != "rpizero2w") {
|
||||||
|
translate([width-2*wallthick-gap-.95,depth/2-wallthick-gap-(depth-2*(floorthick+gap))/2,
|
||||||
|
bottom_height]) cube([wallthick-adj,depth-2*(floorthick+gap),top_height+adj]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([-.95,depth/2-2*wallthick-gap-(depth-2*(floorthick+gap))/2,
|
||||||
|
bottom_height]) cube([width-2*(floorthick+gap),wallthick-adj,top_height+adj]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "hex") {
|
||||||
|
if(width/depth >= 1.4 && sbc_model != "vim1" && sbc_model != "vim2" &&
|
||||||
|
sbc_model != "vim3l" && sbc_model != "vim3" && sbc_model != "vim4" &&
|
||||||
|
sbc_model != "rpizero" && sbc_model != "rpizero2w") {
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-lip/2]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=top_height+lip, r=case_diameter/2,
|
||||||
|
top=fillet, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-floorthick-lip/2]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=top_height+lip, r=(case_diameter/2)-wallthick,
|
||||||
|
top=fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-adj-lip/2]) rotate([0,0,30])
|
||||||
|
cylinder_fillet_inside(h=lip+2*adj, r=(case_diameter/2)-wallthick/2+tol/2,
|
||||||
|
top=fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
|
||||||
|
// io cutout
|
||||||
|
translate([width,(depth/2)-wallthick-gap,bottom_height-lip+top_height/2-floorthick])
|
||||||
|
cube_fillet_inside([18,depth-2*(wallthick+gap)-1,top_height+lip+2],
|
||||||
|
vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
difference() {
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-lip/2]) rotate([0,0,0])
|
||||||
|
cylinder_fillet_inside(h=top_height+lip, r=hex_diameter/2,
|
||||||
|
top=fillet, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height+(top_height/2)-floorthick-lip/2])
|
||||||
|
rotate([0,0,0]) cylinder_fillet_inside(h=top_height+lip, r=(hex_diameter/2)-wallthick,
|
||||||
|
top=fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
|
||||||
|
translate([pcb_width/2,pcb_depth/2,bottom_height-adj-lip/2]) rotate([0,0,0])
|
||||||
|
cylinder_fillet_inside(h=lip+2*adj, r=(hex_diameter/2)-wallthick/2+tol/2,
|
||||||
|
top=fillet-1, bottom=0, $fn=6, fillet_fn=case_ffn, center=true);
|
||||||
|
// io cutout
|
||||||
|
translate([(width/2)-wallthick-gap,-23,bottom_height-lip+top_height/2-floorthick])
|
||||||
|
cube_fillet_inside([width-2*(wallthick+gap),40,top_height+lip+2],
|
||||||
|
vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(width/depth >= 1.4 && sbc_model != "vim1" && sbc_model != "vim2" &&
|
||||||
|
sbc_model != "vim3l" && sbc_model != "vim3" && sbc_model != "vim4" &&
|
||||||
|
sbc_model != "rpizero" && sbc_model != "rpizero2w") {
|
||||||
|
translate([width-2*wallthick-gap-.95,depth/2-wallthick-gap-(depth-2*(floorthick+gap))/2,
|
||||||
|
bottom_height]) cube([wallthick-adj,depth-2*(floorthick+gap),top_height+adj]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([0,depth/2-2.25*(wallthick+gap)-(depth-2*(floorthick+gap))/2,
|
||||||
|
bottom_height]) cube([width-2*(floorthick+gap),wallthick-adj,top_height+adj]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "snap") {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,floorthick*1.5+case_z])
|
||||||
|
cube_fillet_inside([width,depth,floorthick],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[0,0,0,0],bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-adj])
|
||||||
|
cube_fillet_inside([width-2*wallthick-tol,depth-2*wallthick-tol,2*floorthick+1.5],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[0,0,0,0],bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-adj])
|
||||||
|
cube_fillet_inside([width-(3*wallthick),depth-(3*wallthick),2*floorthick+1.5+adj],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],top=[0,0,0,0],
|
||||||
|
bottom=[fillet,fillet,fillet,fillet,fillet], $fn=90);
|
||||||
|
}
|
||||||
|
// snap top outdent
|
||||||
|
difference() {
|
||||||
|
translate([-wallthick-gap+1.25+tol,(depth/2)-((depth*.75)/2)+2.5-gap-wallthick,case_z-.5])
|
||||||
|
rotate([0,45,0]) cube([4,(depth*.75)-5,4]);
|
||||||
|
translate([-wallthick-gap+3,(depth/2)-((depth*.75)/2)+1.25-gap-wallthick,case_z+floorthick-5.75])
|
||||||
|
rotate([0,0,0]) cube([6,(depth*.75)-2,6]);
|
||||||
|
}
|
||||||
|
difference() {
|
||||||
|
translate([width-wallthick-gap-6.8-tol,(depth/2)-((depth*.75)/2)+2.5-gap-wallthick,case_z-.5])
|
||||||
|
rotate([0,45,0]) cube([4,(depth*.75)-5,4]);
|
||||||
|
translate([width-wallthick-gap-8.5,(depth/2)-((depth*.75)/2)+1.25-gap-wallthick,case_z+floorthick-5.75])
|
||||||
|
rotate([0,0,0]) cube([6,(depth*.75)-2,6]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(case_design == "fitted") {
|
||||||
|
difference() {
|
||||||
|
translate([(width/2)-wallthick-gap,
|
||||||
|
(depth/2)-wallthick-gap,case_z+floorthick/2-(lip)/2])
|
||||||
|
cube_fillet_inside([width,depth,lip+floorthick],
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[fillet,fillet,fillet,fillet,fillet],
|
||||||
|
bottom=[0,0,0,0], $fn=90);
|
||||||
|
translate([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,case_z-floorthick-1])
|
||||||
|
cube_fillet_inside([width-wallthick+tol,depth-wallthick+tol,lip+floorthick],
|
||||||
|
vertical=[c_fillet-1,c_fillet-1,c_fillet-1,c_fillet-1],
|
||||||
|
top=[fillet,fillet,fillet,fillet,fillet],
|
||||||
|
bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if (class == "add1" && face == "top") {
|
||||||
|
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,
|
||||||
|
parametric,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// pcb standoff holes
|
||||||
|
if(sbc_top_standoffs == true && top_standoff[5] != 4) {
|
||||||
|
for (i=[1:11:len(sbc_data[s[0]])-2]) {
|
||||||
|
class = sbc_data[s[0]][i+1];
|
||||||
|
type = sbc_data[s[0]][i+2];
|
||||||
|
id = sbc_data[s[0]][i+3];
|
||||||
|
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||||
|
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||||
|
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||||
|
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||||
|
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||||
|
|
||||||
|
if (class == "pcbhole" && id == pcb_id && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" || pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
|
||||||
|
#translate([pcb_hole_x,pcb_hole_y,top_height+1]) cylinder(d=6.5, h=top_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// extended standoff holes
|
||||||
|
if(case_ext_standoffs == true) {
|
||||||
|
// right-rear standoff
|
||||||
|
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([width-(2*(wallthick+gap))-(c_fillet/2),(c_fillet/2),top_height+1])
|
||||||
|
cylinder(d=6.5, h=top_height);
|
||||||
|
}
|
||||||
|
// right-front standoff
|
||||||
|
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10) || width-pcb_loc_x-pcb_width >= 10) {
|
||||||
|
translate([width-(c_fillet/2)-(2*(wallthick+gap)),
|
||||||
|
depth-(c_fillet/2)-(2*(wallthick+gap)),top_height+1]) cylinder(d=6.5, h=top_height);
|
||||||
|
}
|
||||||
|
// left-rear standoff
|
||||||
|
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([(c_fillet/2),(c_fillet/2),top_height+1]) cylinder(d=6.5, h=top_height);
|
||||||
|
}
|
||||||
|
// left-front standoff
|
||||||
|
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
|
||||||
|
translate([+(c_fillet/2),depth-(c_fillet/2)-(2*(wallthick+gap)),
|
||||||
|
top_height+1]) cylinder(d=6.5, h=top_height+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// pcb standoffs
|
||||||
|
|
||||||
|
if(sbc_top_standoffs == true) {
|
||||||
|
for (i=[1:11:len(sbc_data[s[0]])-2]) {
|
||||||
|
class = sbc_data[s[0]][i+1];
|
||||||
|
type = sbc_data[s[0]][i+2];
|
||||||
|
id = sbc_data[s[0]][i+3];
|
||||||
|
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||||
|
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||||
|
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||||
|
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||||
|
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||||
|
if(class == "pcbhole" && id == pcb_id && (pcb_hole_pos == "left_rear" || pcb_hole_pos == "left_front" || pcb_hole_pos == "right_rear" || pcb_hole_pos == "right_front")) {
|
||||||
|
if (pcb_hole_pos == "left_rear") {
|
||||||
|
normal_standoff = [top_standoff[0],
|
||||||
|
top_height+pcb_loc_z+top_rear_left,
|
||||||
|
top_standoff[2],
|
||||||
|
top_standoff[3],
|
||||||
|
top_standoff[4],
|
||||||
|
top_standoff[5],
|
||||||
|
top_standoff[6],
|
||||||
|
top_standoff[7],
|
||||||
|
top_standoff[8],
|
||||||
|
top_standoff[9],
|
||||||
|
top_standoff[10]];
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,case_z]) standoff(normal_standoff);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "left_front") {
|
||||||
|
normal_standoff = [top_standoff[0],
|
||||||
|
top_height+pcb_loc_z+top_front_left,
|
||||||
|
top_standoff[2],
|
||||||
|
top_standoff[3],
|
||||||
|
top_standoff[4],
|
||||||
|
top_standoff[5],
|
||||||
|
top_standoff[6],
|
||||||
|
top_standoff[7],
|
||||||
|
top_standoff[8],
|
||||||
|
top_standoff[9],
|
||||||
|
top_standoff[10]];
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,case_z]) standoff(normal_standoff);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_rear") {
|
||||||
|
normal_standoff = [top_standoff[0],
|
||||||
|
top_height+pcb_loc_z+top_rear_right,
|
||||||
|
top_standoff[2],
|
||||||
|
top_standoff[3],
|
||||||
|
top_standoff[4],
|
||||||
|
top_standoff[5],
|
||||||
|
top_standoff[6],
|
||||||
|
top_standoff[7],
|
||||||
|
top_standoff[8],
|
||||||
|
top_standoff[9],
|
||||||
|
top_standoff[10]];
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,case_z]) standoff(normal_standoff);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_front") {
|
||||||
|
normal_standoff = [top_standoff[0],
|
||||||
|
top_height+pcb_loc_z+top_front_right,
|
||||||
|
top_standoff[2],
|
||||||
|
top_standoff[3],
|
||||||
|
top_standoff[4],
|
||||||
|
top_standoff[5],
|
||||||
|
top_standoff[6],
|
||||||
|
top_standoff[7],
|
||||||
|
top_standoff[8],
|
||||||
|
top_standoff[9],
|
||||||
|
top_standoff[10]];
|
||||||
|
translate([pcb_hole_x,pcb_hole_y,case_z]) standoff(normal_standoff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// extended standoffs
|
||||||
|
if(case_ext_standoffs == true) {
|
||||||
|
// right-rear standoff
|
||||||
|
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([width-(2*(wallthick+gap))-(c_fillet/2),(c_fillet/2),case_z])
|
||||||
|
standoff(top_ext_standoff);
|
||||||
|
}
|
||||||
|
// right-front standoff
|
||||||
|
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10)
|
||||||
|
|| width-pcb_loc_x-pcb_width >= 10) {
|
||||||
|
translate([width-(c_fillet/2)-(2*(wallthick+gap)),
|
||||||
|
depth-(c_fillet/2)-(2*(wallthick+gap)),case_z]) standoff(top_ext_standoff);
|
||||||
|
}
|
||||||
|
// left-rear standoff
|
||||||
|
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([(c_fillet/2),(c_fillet/2),case_z]) standoff(top_ext_standoff);
|
||||||
|
}
|
||||||
|
// left-front standoff
|
||||||
|
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
|
||||||
|
translate([(c_fillet/2),depth-(c_fillet/2)-(2*(wallthick+gap)),
|
||||||
|
case_z]) standoff(top_ext_standoff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// standoff sidewall support
|
||||||
|
if(sidewall_support == true && sbc_top_standoffs == true) {
|
||||||
|
if(pcb_width/pcb_depth >= 1.4) {
|
||||||
|
for (i=[1:11:len(sbc_data[s[0]])-2]) {
|
||||||
|
class = sbc_data[s[0]][i+1];
|
||||||
|
type = sbc_data[s[0]][i+2];
|
||||||
|
id = sbc_data[s[0]][i+3];
|
||||||
|
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||||
|
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||||
|
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||||
|
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||||
|
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||||
|
|
||||||
|
if(pcb_hole_x!=0 && pcb_hole_y!=0) {
|
||||||
|
if (pcb_hole_pos == "left_rear") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4,
|
||||||
|
case_z-top_height-top_rear_left]) cube([2,gap+1.6,top_height+top_rear_left]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "left_front") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-top_front_left])
|
||||||
|
cube([2,gap+1.6,top_height+top_front_left]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_rear") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4,
|
||||||
|
case_z-top_height-top_rear_right]) cube([2,gap+1.6,top_height+top_rear_right]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_front") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-top_front_right])
|
||||||
|
cube([2,gap+1.6,top_height+top_front_right]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (i=[1:11:len(sbc_data[s[0]])-2]) {
|
||||||
|
class = sbc_data[s[0]][i+1];
|
||||||
|
type = sbc_data[s[0]][i+2];
|
||||||
|
id = sbc_data[s[0]][i+3];
|
||||||
|
pcb_hole_x = sbc_data[s[0]][i+4]+pcb_loc_x;
|
||||||
|
pcb_hole_y = sbc_data[s[0]][i+5]+pcb_loc_y;
|
||||||
|
pcb_hole_z = sbc_data[s[0]][i+6];
|
||||||
|
pcb_hole_size = sbc_data[s[0]][i+9][0];
|
||||||
|
pcb_hole_pos = sbc_data[s[0]][i+10][4];
|
||||||
|
|
||||||
|
if(pcb_hole_x!=0 && pcb_hole_y!=0) {
|
||||||
|
if (i == 7 && sbc_model != "n2l") {
|
||||||
|
translate([pcb_hole_x-(top_standoff[0]/2)-gap-adj-1,pcb_hole_y-1,
|
||||||
|
bottom_height-top_rear_left]) cube([gap+adj+1.6,2,top_height+top_rear_left]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "left_rear" && sbc_model == "n2l") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y-(top_standoff[0]/2)-(gap-adj)-1.4,
|
||||||
|
case_z-top_height-top_rear_left]) cube([2,gap+1.6,top_height+top_rear_left]);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "left_front" && sbc_model != "n2l") {
|
||||||
|
translate([pcb_hole_x-(top_standoff[0]/2)-gap-adj-1,pcb_hole_y-1,
|
||||||
|
bottom_height-top_front_left]) cube([gap+adj+1.6,2,top_height+top_front_left]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "left_front" && sbc_model == "n2l") {
|
||||||
|
translate([pcb_hole_x-1, pcb_hole_y+(top_standoff[0]/2)-.6+adj,case_z-top_height-top_front_left])
|
||||||
|
cube([2,gap+1.6,top_height+top_front_left]);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_rear") {
|
||||||
|
translate([pcb_hole_x+(top_standoff[0]/2)-adj-.45,pcb_hole_y-1,
|
||||||
|
bottom_height-top_rear_right]) cube([gap+adj+1.6,2,top_height+top_rear_right]);
|
||||||
|
}
|
||||||
|
if (pcb_hole_pos == "right_front") {
|
||||||
|
translate([pcb_hole_x+(top_standoff[0]/2)-adj-.45,pcb_hole_y-1,
|
||||||
|
bottom_height-top_front_right]) cube([gap+adj+1.6,2,top_height+top_front_right]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// extended standoff sidewall support
|
||||||
|
if(case_ext_standoffs == true && sidewall_support == true) {
|
||||||
|
// right-rear standoff
|
||||||
|
if(width-pcb_loc_x-pcb_width >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([width-(2*(wallthick+gap))-(c_fillet/2)+(top_ext_standoff[0]/2)-.6,
|
||||||
|
(c_fillet/2)-1,bottom_height]) cube([gap+adj+2,2,top_height]);
|
||||||
|
}
|
||||||
|
// right-front standoff
|
||||||
|
if((width-pcb_loc_x-pcb_width >= 10 && depth-pcb_loc_y-pcb_depth >= 10)
|
||||||
|
|| width-pcb_loc_x-pcb_width >= 10) {
|
||||||
|
translate([width-(2*(wallthick+gap))-(c_fillet/2)+(top_ext_standoff[0]/2)-.6,
|
||||||
|
depth-(c_fillet/2)-(2*(wallthick+gap))-1,bottom_height])
|
||||||
|
cube([gap+adj+2,2,top_height]);
|
||||||
|
}
|
||||||
|
// left-rear standoff
|
||||||
|
if(pcb_loc_x >= 10 || pcb_loc_y >= 10) {
|
||||||
|
translate([(c_fillet/2)-(wallthick+gap)-(top_ext_standoff[0]/2)+.6,(c_fillet/2)-1,
|
||||||
|
bottom_height]) cube([gap+adj+2,2,top_height]);
|
||||||
|
}
|
||||||
|
// left-front standoff
|
||||||
|
if(pcb_loc_x >= 10 || depth-pcb_loc_y-pcb_depth >= 10) {
|
||||||
|
translate([(c_fillet/2)-(wallthick+gap)-(top_ext_standoff[0]/2)+.6,
|
||||||
|
depth-(c_fillet/2)-(2*(wallthick+gap))-1, bottom_height])
|
||||||
|
cube([gap+adj+2,2,top_height]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// subtractive accessories
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if ((class == "sub" && face == "top") || class == "suball") {
|
||||||
|
if(accessory_highlight == false) {
|
||||||
|
parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,
|
||||||
|
parametric,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,
|
||||||
|
parametric,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// create openings for additive
|
||||||
|
if (class == "add2" && face == "top" && type == "standoff") {
|
||||||
|
parametric_move_sub("round",loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
6.5,size_y,floorthick+1,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "uart_holder") {
|
||||||
|
if(accessory_highlight == false) {
|
||||||
|
parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
|
||||||
|
0,0,0,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
#parametric_move_sub("microusb",loc_x+5.25,loc_y-5,loc_z+4,face,rotation,parametric,
|
||||||
|
0,0,0,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "bottom" && type == "hc4_oled_holder") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+1,loc_y+1.75,loc_z+26,face,rotation,
|
||||||
|
parametric,26.5,wallthick+gap+4,14.5,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
}
|
||||||
|
if ((class == "add1" || class == "add2") && face == "top" && type == "button") {
|
||||||
|
if(data_3 == "recess") {
|
||||||
|
parametric_move_sub("sphere",loc_x,loc_y,loc_z,face,rotation,
|
||||||
|
parametric,size_x-1,size_y,size_z,data_1,data_2,data_3,0);
|
||||||
|
}
|
||||||
|
if(data_3 == "cutout") {
|
||||||
|
parametric_move_sub("rectangle",loc_x+10,loc_y+4,loc_z-adj,face,rotation,
|
||||||
|
parametric,size_x+2,size_y+1,size_z+2*adj,data_1,data_2,data_3,[.1,.1,.1,.1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (class == "model" && face == "bottom" && type == "hk_boom" &&
|
||||||
|
rotation[0] == 90 && rotation[1] == 0 && rotation[2] == 0) {
|
||||||
|
parametric_move_sub("round",loc_x+11,loc_y-4,loc_z,face,[0,0,0],
|
||||||
|
parametric,5,size_y,80,data_1,data_2,data_3,data_4);
|
||||||
|
parametric_move_sub("slot",loc_x+37.5,loc_y-4.75,loc_z,face,[0,0,0],
|
||||||
|
parametric,6,14,80,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sbc openings
|
||||||
|
if(sbc_highlight == true) {
|
||||||
|
#translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model,"default",0,"default","default",true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
translate([pcb_loc_x ,pcb_loc_y,bottom_height-pcb_z+pcb_loc_z-adj]) sbc(sbc_model,"default",0,"default","default",true);
|
||||||
|
}
|
||||||
|
// clean fillets
|
||||||
|
if(case_design == "shell") {
|
||||||
|
translate(([(width/2)-wallthick-gap,(depth/2)-wallthick-gap,
|
||||||
|
bottom_height+(top_height/2)]) )
|
||||||
|
cube_negative_fillet([width,depth,top_height], radius=-1,
|
||||||
|
vertical=[c_fillet,c_fillet,c_fillet,c_fillet],
|
||||||
|
top=[fillet,fillet,fillet,fillet,fillet],
|
||||||
|
bottom=[0,0,0,0], $fn=90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// additive accessories
|
||||||
|
if(accessory_name != "none") {
|
||||||
|
for (i=[1:15:len(accessory_data[a[0]])-1]) {
|
||||||
|
class = accessory_data[a[0]][i];
|
||||||
|
type = accessory_data[a[0]][i+1];
|
||||||
|
loc_x = accessory_data[a[0]][i+2];
|
||||||
|
loc_y = accessory_data[a[0]][i+3];
|
||||||
|
loc_z = accessory_data[a[0]][i+4];
|
||||||
|
face = accessory_data[a[0]][i+5];
|
||||||
|
rotation = accessory_data[a[0]][i+6];
|
||||||
|
parametric = accessory_data[a[0]][i+7];
|
||||||
|
size_x = accessory_data[a[0]][i+8];
|
||||||
|
size_y = accessory_data[a[0]][i+9];
|
||||||
|
size_z = accessory_data[a[0]][i+10];
|
||||||
|
data_1 = accessory_data[a[0]][i+11];
|
||||||
|
data_2 = accessory_data[a[0]][i+12];
|
||||||
|
data_3 = accessory_data[a[0]][i+13];
|
||||||
|
data_4 = accessory_data[a[0]][i+14];
|
||||||
|
|
||||||
|
if (class == "add2" && face == "top") {
|
||||||
|
parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
243
mod/indent.scad
Normal file
243
mod/indent.scad
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
/* indent module */
|
||||||
|
module indent(loc_x,loc_y,loc_z,rotation,side,class,type,wallthick,gap,floorthick,pcb_z) {
|
||||||
|
|
||||||
|
adj = .01;
|
||||||
|
$fn=90;
|
||||||
|
|
||||||
|
// hdmi indent
|
||||||
|
if(class == "video" && type == "hdmi_a" && side == "top" && rotation == 0) {
|
||||||
|
place(loc_x+2.375,-(wallthick+gap)+wallthick/2,loc_z+3.75,12,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(12,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_a" && side == "top" && rotation == 90) {
|
||||||
|
place(-gap-wallthick/2,loc_y,loc_z+3.75,12,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(12,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_a" && side == "top" && rotation == 180) {
|
||||||
|
place(loc_x,depth-(wallthick+gap)-10-wallthick/2,loc_z+3.75,12,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(12,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_a" && side == "top" && rotation == 270) {
|
||||||
|
place(width-(wallthick+gap)-10-wallthick/2,loc_y+2.375,loc_z+3.75,12,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(12,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_a" && side == "bottom" && rotation == 0) {
|
||||||
|
place(loc_x,-(wallthick+gap)+wallthick/2,loc_z-pcb_z-3.75,12,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(12,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_a" && side == "bottom" && rotation == 90) {
|
||||||
|
place(width-(wallthick+gap)-10-wallthick/2,loc_y,loc_z-5.25,12,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(12,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_a" && side == "bottom" && rotation == 180) {
|
||||||
|
place(loc_x+2.375,depth-(wallthick+gap)-10-wallthick/2,loc_z-pcb_z-3.75,12,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(12,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_a" && side == "bottom" && rotation == 270) {
|
||||||
|
place(-gap-wallthick/2,loc_y+1.75,loc_z-pcb_z-3.75,12,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(12,10,wallthick);
|
||||||
|
}
|
||||||
|
// hdmi micro indent
|
||||||
|
if(class == "video" && type == "hdmi_micro" && rotation == 0 && side == "top") {
|
||||||
|
place(loc_x-.5,-(wallthick+gap)+wallthick/2,loc_z+1.5,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_micro" && rotation == 90 && side == "top") {
|
||||||
|
place(-gap-wallthick/2,loc_y+1.5,loc_z+1.5,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_micro" && rotation == 180 && side == "top") {
|
||||||
|
place(loc_x+1,depth-(wallthick+gap)-8-wallthick/2,loc_z+1.5,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_micro" && rotation == 270 && side == "top") {
|
||||||
|
place(width-(wallthick+gap)-8-wallthick/2,loc_y-.75,loc_z+1.5,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_micro" && rotation == 0 && side == "bottom") {
|
||||||
|
place(loc_x+1.5,-(wallthick+gap)+wallthick/2,loc_z-3,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_micro" && rotation == 90 && side == "bottom") {
|
||||||
|
place(width-(wallthick+gap)-8-wallthick/2,loc_y+1.25,loc_z-3,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_micro" && rotation == 180 && side == "bottom") {
|
||||||
|
place(loc_x-1,depth-(wallthick+gap)-8-wallthick/2,loc_z-3,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_micro" && rotation == 270 && side == "bottom") {
|
||||||
|
place(-gap-wallthick/2,loc_y-.5,loc_z-3,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
// hdmi mini indent
|
||||||
|
if(class == "video" && type == "hdmi_mini" && rotation == 0 && side == "top") {
|
||||||
|
place(loc_x+.5,loc_y-gap-wallthick/2+1,loc_z+1.5,6,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_mini" && rotation == 90 && side == "top") {
|
||||||
|
place(loc_x-wallthick/2,loc_y+3.5,loc_z+1.5,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_mini" && rotation == 180 && side == "top") {
|
||||||
|
place(loc_x+4.5,loc_y-wallthick/2,loc_z+1.5,6,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_mini" && rotation == 270 && side == "top") {
|
||||||
|
place(loc_x+wallthick/2,loc_y+1.5,loc_z+1.5,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_mini" && rotation == 0 && side == "bottom") {
|
||||||
|
place(loc_x+4.5,loc_y-gap-wallthick/2+1,loc_z-3,6,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_mini" && rotation == 90 && side == "bottom") {
|
||||||
|
place(loc_x+wallthick/2,loc_y+3.5,loc_z-3,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_mini" && rotation == 180 && side == "bottom") {
|
||||||
|
place(loc_x+.5,loc_y-wallthick/2,loc_z-3,6,10,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,10,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "video" && type == "hdmi_mini" && rotation == 270 && side == "bottom") {
|
||||||
|
place(loc_x-wallthick/2,loc_y+1.5,loc_z-3,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
// power plug indent
|
||||||
|
if(type == "pwr5.5_7.5x11.5" && rotation == 0 && side == "top") {
|
||||||
|
place(loc_x+3.75,-(wallthick+gap)+wallthick/2,loc_z+6.25,10,10,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(type == "pwr5.5_7.5x11.5" && rotation == 90 && side == "top") {
|
||||||
|
place(-gap-wallthick/2,loc_y-6.25,loc_z+6.25,10,10,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(type == "pwr5.5_7.5x11.5" && rotation == 180 && side == "top") {
|
||||||
|
place(loc_x-6.5,depth-10-(wallthick+gap)-wallthick/2,loc_z+6.25,10,10,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(type == "pwr5.5_7.5x11.5" && rotation == 270 && side == "top") {
|
||||||
|
place(width-(wallthick+gap)-10-wallthick/2,loc_y+3.75,loc_z+6.25,10,10,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(type == "pwr2.5_5x7.5" && rotation == 0 && side == "top") {
|
||||||
|
place(loc_x+2.75,-(wallthick+gap)+wallthick/2,loc_z+2.1,7,7,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=7, h=wallthick);
|
||||||
|
}
|
||||||
|
if(type == "pwr2.5_5x7.5" && rotation == 90 && side == "top") {
|
||||||
|
place(-(wallthick+gap)+wallthick/2,loc_y-4.5,loc_z+2,7,7,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=7, h=wallthick);
|
||||||
|
}
|
||||||
|
if(type == "pwr2.5_5x7.5" && rotation == 180 && side == "top") {
|
||||||
|
place(loc_x-4.5,depth-(wallthick+gap)-7-wallthick/2,loc_z+2,7,7,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=7, h=wallthick);
|
||||||
|
}
|
||||||
|
if(type == "pwr2.5_5x7.5" && rotation == 270 && side == "top") {
|
||||||
|
place(width-(wallthick+gap)-7-wallthick/2,loc_y+2.5,loc_z+2,7,7,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=7, h=wallthick);
|
||||||
|
}
|
||||||
|
// micro usb indent
|
||||||
|
if(class == "usb2" && type == "micro" && rotation == 0 && side == "top") {
|
||||||
|
place(loc_x-.5,-(wallthick+gap)+wallthick/2,loc_z+1.9,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usb2" && type == "micro" && rotation == 90 && side == "top") {
|
||||||
|
place(-gap-wallthick/2,loc_y+1.5,loc_z+1.9,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(class == "usb2" && type == "micro" && rotation == 180 && side == "top") {
|
||||||
|
place(loc_x+1.5,depth-(wallthick+gap)-8-wallthick/2,loc_z+1.9,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usb2" && type == "micro" && rotation == 270 && side == "top") {
|
||||||
|
place(width-(wallthick+gap)-8-wallthick/2,loc_y-.5,loc_z+1.9,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usb2" && type == "micro" && rotation == 0 && side == "bottom") {
|
||||||
|
place(loc_x+1.5,-(wallthick+gap)+wallthick/2,loc_z-3.25,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usb2" && type == "micro" && rotation == 90 && side == "bottom") {
|
||||||
|
place(width-(wallthick+gap)-8-wallthick/2,loc_y+1.5,loc_z-3.25,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
|
||||||
|
}
|
||||||
|
if(class == "usb2" && type == "micro" && rotation == 180 && side == "bottom") {
|
||||||
|
place(loc_x-.5,depth-(wallthick+gap)-8-wallthick/2,loc_z-3.25,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usb2" && type == "micro" && rotation == 270 && side == "bottom") {
|
||||||
|
place(-gap-wallthick/2,loc_y-.5,loc_z-3.25,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
// single horizontal usbc indent
|
||||||
|
if(class == "usbc" && type == "single_horizontal" && rotation == 0 && side == "top") {
|
||||||
|
place(loc_x+.5,-(wallthick+gap)+wallthick/2,loc_z+1.75,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usbc" && type == "single_horizontal" && rotation == 90 && side == "top") {
|
||||||
|
place(-gap-wallthick/2,loc_y+2.5,loc_z+1.75,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usbc" && type == "single_horizontal" && rotation == 180 && side == "top") {
|
||||||
|
place(loc_x+2.5,depth-(wallthick+gap)-8-wallthick/2,loc_z+2,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usbc" && type == "single_horizontal" && rotation == 270 && side == "top") {
|
||||||
|
place(width-(wallthick+gap)-8-wallthick/2,loc_y+.5,loc_z+1.75,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usbc" && type == "single_horizontal" && rotation == 0 && side == "bottom") {
|
||||||
|
place(loc_x+2.75,-(wallthick+gap)+wallthick/2,loc_z-3.25,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usbc" && type == "single_horizontal" && rotation == 90 && side == "bottom") {
|
||||||
|
place(width-(wallthick+gap)-8-wallthick/2,loc_y+2.5,loc_z-3.25,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick-(wallthick+gap)+wallthick/2);
|
||||||
|
}
|
||||||
|
if(class == "usbc" && type == "single_horizontal" && rotation == 180 && side == "bottom") {
|
||||||
|
place(loc_x+.5,depth-(wallthick+gap)-8-wallthick/2,loc_z-3.25,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
if(class == "usbc" && type == "single_horizontal" && rotation == 270 && side == "bottom") {
|
||||||
|
place(-gap-wallthick/2,loc_y+.5,loc_z-3.25,6,8,rotation,side)
|
||||||
|
rotate([90,0,0]) slot(6,8,wallthick);
|
||||||
|
}
|
||||||
|
// audio jack indent
|
||||||
|
if(class == "audio" && type == "jack_3.5" && rotation == 0 && side == "top") {
|
||||||
|
place(loc_x+3.15,-(wallthick+gap)+wallthick/2,loc_z+2,8,8,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(class == "audio" && type == "jack_3.5" && rotation == 90 && side == "top") {
|
||||||
|
place(-gap-wallthick/2,loc_y-4.6,loc_z+2,8,8,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(class == "audio" && type == "jack_3.5" && rotation == 180 && side == "top") {
|
||||||
|
place(loc_x-4.6,depth-(wallthick+gap)-8-wallthick/2,loc_z+2,8,8,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(class == "audio" && type == "jack_3.5" && rotation == 270 && side == "top") {
|
||||||
|
place(width-(wallthick+gap)-8-wallthick/2,loc_y+3.15,loc_z+2,8,8,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(class == "audio" && type == "jack_3.5" && rotation == 0 && side == "bottom") {
|
||||||
|
place(loc_x-4.6,-(wallthick+gap)+wallthick/2,loc_z-3.5,8,8,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(class == "audio" && type == "jack_3.5" && rotation == 90 && side == "bottom") {
|
||||||
|
place(width-(wallthick+gap)-8-wallthick/2,loc_y-4.6,loc_z-3.5,8,8,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(class == "audio" && type == "jack_3.5" && rotation == 180 && side == "bottom") {
|
||||||
|
place(loc_x+3.15,depth-(wallthick+gap)-8-wallthick/2,loc_z-3.5,8,8,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
if(class == "audio" && type == "jack_3.5" && rotation == 270 && side == "bottom") {
|
||||||
|
place(-gap-wallthick/2,loc_y+3.15,loc_z-3.5,8,8,rotation,side)
|
||||||
|
rotate([90,0,0]) cylinder(d=10, h=wallthick);
|
||||||
|
}
|
||||||
|
}
|
||||||
301
mod/parametric_move.scad
Normal file
301
mod/parametric_move.scad
Normal file
@@ -0,0 +1,301 @@
|
|||||||
|
module parametric_move_add(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4) {
|
||||||
|
|
||||||
|
// absolute no parametrics
|
||||||
|
if(parametric[1] == false && parametric[2] == false && parametric[3] == false) {
|
||||||
|
add(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
// x axis accessory parametrics
|
||||||
|
if(parametric[1] == true && parametric[2] == false && parametric[3] == false) {
|
||||||
|
if(parametric[0] == "case") {
|
||||||
|
add(type,loc_x+case_offset_x,loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
add(type,loc_x+pcb_loc_x,loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// y axis accessory parametrics
|
||||||
|
if(parametric[1] == false && parametric[2] == true && parametric[3] == false) {
|
||||||
|
if(parametric[0] == "case") {
|
||||||
|
add(type,loc_x,loc_y+case_offset_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
add(type,loc_x,loc_y+pcb_loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// z axis accessory parametrics
|
||||||
|
if(parametric[1] == false && parametric[2] == false && parametric[3] == true) {
|
||||||
|
if(parametric[0] == "case" && face == "top") {
|
||||||
|
add(type,loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face == "bottom") {
|
||||||
|
add(type,loc_x,loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face != "bottom" && face != "top") {
|
||||||
|
add(type,loc_x,loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
add(type,loc_x,loc_y,loc_z+pcb_loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "top") {
|
||||||
|
add(type,loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "bottom") {
|
||||||
|
add(type,loc_x,loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// xy axis accessory parametrics
|
||||||
|
if(parametric[1] == true && parametric[2] == true && parametric[3] == false) {
|
||||||
|
if(parametric[0] == "case") {
|
||||||
|
add(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
add(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// xz axis accessory parametrics
|
||||||
|
if(parametric[1] == true && parametric[2] == false && parametric[3] == true) {
|
||||||
|
if(parametric[0] == "case" && face == "top") {
|
||||||
|
add(type,loc_x+case_offset_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face == "bottom") {
|
||||||
|
add(type,loc_x+case_offset_x,loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face != "bottom" && face != "top") {
|
||||||
|
add(type,loc_x+case_offset_x,loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
add(type,loc_x+pcb_loc_x,loc_y,loc_z+pcb_loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "top") {
|
||||||
|
add(type,loc_x+pcb_loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "bottom") {
|
||||||
|
add(type,loc_x+pcb_loc_x,loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// yz axis accessory parametrics
|
||||||
|
if(parametric[1] == false && parametric[2] == true && parametric[3] == true) {
|
||||||
|
if(parametric[0] == "case" && face == "top") {
|
||||||
|
add(type,loc_x,loc_y+case_offset_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face == "bottom") {
|
||||||
|
add(type,loc_x,loc_y+case_offset_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face != "bottom" && face != "top") {
|
||||||
|
add(type,loc_x,loc_y+case_offset_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
add(type,loc_x,loc_y+pcb_loc_y,loc_z+pcb_loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "top") {
|
||||||
|
add(type,loc_x,loc_y+pcb_loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "bottom") {
|
||||||
|
add(type,loc_x,loc_y+pcb_loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// xyz axis accessory parametrics
|
||||||
|
if(parametric[1] == true && parametric[2] == true && parametric[3] == true) {
|
||||||
|
if(parametric[0] == "case" && face == "top") {
|
||||||
|
add(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face == "bottom") {
|
||||||
|
add(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face != "bottom" && face != "top") {
|
||||||
|
add(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
add(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+pcb_loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "top") {
|
||||||
|
add(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "bottom") {
|
||||||
|
add(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
module parametric_move_sub(type,loc_x,loc_y,loc_z,face,rotation,parametric,
|
||||||
|
size_x,size_y,size_z,data_1,data_2,data_3,data_4) {
|
||||||
|
|
||||||
|
// absolute no parametrics
|
||||||
|
if(parametric[1] == false && parametric[2] == false && parametric[3] == false) {
|
||||||
|
sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
// x axis accessory parametrics
|
||||||
|
if(parametric[1] == true && parametric[2] == false && parametric[3] == false) {
|
||||||
|
if(parametric[0] == "case") {
|
||||||
|
sub(type,loc_x+case_offset_x,loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
sub(type,loc_x+pcb_loc_x,loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// y axis accessory parametrics
|
||||||
|
if(parametric[1] == false && parametric[2] == true && parametric[3] == false) {
|
||||||
|
if(parametric[0] == "case") {
|
||||||
|
sub(type,loc_x,loc_y+case_offset_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
sub(type,loc_x,loc_y+pcb_loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// z axis accessory parametrics
|
||||||
|
if(parametric[1] == false && parametric[2] == false && parametric[3] == true) {
|
||||||
|
if(parametric[0] == "case" && face == "top") {
|
||||||
|
sub(type,loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face == "bottom") {
|
||||||
|
sub(type,loc_x,loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face != "bottom" && face != "top") {
|
||||||
|
sub(type,loc_x,loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
sub(type,loc_x,loc_y,loc_z+pcb_loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "top") {
|
||||||
|
sub(type,loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "bottom") {
|
||||||
|
sub(type,loc_x,loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// xy axis accessory parametrics
|
||||||
|
if(parametric[1] == true && parametric[2] == true && parametric[3] == false) {
|
||||||
|
if(parametric[0] == "case") {
|
||||||
|
sub(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
sub(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// xz axis accessory parametrics
|
||||||
|
if(parametric[1] == true && parametric[2] == false && parametric[3] == true) {
|
||||||
|
if(parametric[0] == "case" && face == "top") {
|
||||||
|
sub(type,loc_x+case_offset_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face == "bottom") {
|
||||||
|
sub(type,loc_x+case_offset_x,loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face != "bottom" && face != "top") {
|
||||||
|
sub(type,loc_x+case_offset_x,loc_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
sub(type,loc_x+pcb_loc_x,loc_y,loc_z+pcb_loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "top") {
|
||||||
|
sub(type,loc_x+pcb_loc_x,loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "bottom") {
|
||||||
|
sub(type,loc_x+pcb_loc_x,loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// yz axis accessory parametrics
|
||||||
|
if(parametric[1] == false && parametric[2] == true && parametric[3] == true) {
|
||||||
|
if(parametric[0] == "case" && face == "top") {
|
||||||
|
sub(type,loc_x,loc_y+case_offset_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face == "bottom") {
|
||||||
|
sub(type,loc_x,loc_y+case_offset_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face != "bottom" && face != "top") {
|
||||||
|
sub(type,loc_x,loc_y+case_offset_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
sub(type,loc_x,loc_y+pcb_loc_y,loc_z+pcb_loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "top") {
|
||||||
|
sub(type,loc_x,loc_y+pcb_loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "bottom") {
|
||||||
|
sub(type,loc_x,loc_y+pcb_loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// xyz axis accessory parametrics
|
||||||
|
if(parametric[1] == true && parametric[2] == true && parametric[3] == true) {
|
||||||
|
if(parametric[0] == "case" && face == "top") {
|
||||||
|
sub(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face == "bottom") {
|
||||||
|
sub(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "case" && face != "bottom" && face != "top") {
|
||||||
|
sub(type,loc_x+case_offset_x,loc_y+case_offset_y,loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc") {
|
||||||
|
sub(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+pcb_loc_z,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "top") {
|
||||||
|
sub(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+case_offset_tz+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
if(parametric[0] == "sbc-case_z" && face == "bottom") {
|
||||||
|
sub(type,loc_x+pcb_loc_x,loc_y+pcb_loc_y,loc_z+case_offset_bz,
|
||||||
|
face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
46
mod/place.scad
Normal file
46
mod/place.scad
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
place(x,y,z,size_x,size_y,rotation,side)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* placement module *must be first* for children() */
|
||||||
|
module place(x,y,z,size_x,size_y,rotation,side) {
|
||||||
|
|
||||||
|
if (side == "top") {
|
||||||
|
if (rotation == 0 || rotation == 90 || rotation == 180 || rotation == 270) {
|
||||||
|
if ((rotation >= 0 && rotation < 90) || (rotation < -270 && rotation > -360))
|
||||||
|
translate([x,y,z]) rotate([0,0,-rotation]) children();
|
||||||
|
|
||||||
|
if ((rotation >= 90 && rotation < 180) || (rotation < -180 && rotation >= -270))
|
||||||
|
translate([x,y+size_x,z]) rotate([0,0,-rotation]) children();
|
||||||
|
|
||||||
|
if ((rotation >= 180 && rotation < 270) || (rotation < -90 && rotation >= -180))
|
||||||
|
translate([x+size_x,y+size_y,z]) rotate([0,0,-rotation]) children(0);
|
||||||
|
|
||||||
|
if ((rotation >= 270 && rotation < 360) || (rotation < 0 && rotation >= -90))
|
||||||
|
translate([x+size_y,y,z]) rotate([0,0,-rotation]) children(); }
|
||||||
|
else {
|
||||||
|
translate([x,y,z]) rotate([0,0,-rotation]) children();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (side == "bottom") {
|
||||||
|
if (rotation == 0 || rotation == 90 || rotation == 180 || rotation == 270) {
|
||||||
|
if ((rotation >= 0 && rotation < 90) || (rotation < -270 && rotation > -360))
|
||||||
|
translate([x+size_x,y,z]) rotate([0,180,rotation]) children();
|
||||||
|
|
||||||
|
if ((rotation >= 90 && rotation < 180) || (rotation < -180 && rotation >= -270))
|
||||||
|
translate([x+size_y,y+size_x,z]) rotate([0,180,rotation]) children();
|
||||||
|
|
||||||
|
if ((rotation >= 180 && rotation < 270) || (rotation < -90 && rotation >= -180))
|
||||||
|
translate([x,y+size_y,z]) rotate([0,180,rotation]) children();
|
||||||
|
|
||||||
|
if ((rotation >= 270 && rotation < 360) || (rotation < 0 && rotation >= -90))
|
||||||
|
translate([x,y,z]) rotate([0,180,rotation]) children(); }
|
||||||
|
else {
|
||||||
|
translate([x,y,z]) rotate([0,180,rotation]) children();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
children([1:1:$children-1]);
|
||||||
|
}
|
||||||
70
mod/sub.scad
Normal file
70
mod/sub.scad
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
sub(type,loc_x,loc_y,loc_z,size_x,size_y,size_z,rotation,face,side,case_z,data_1,data_2,data_3,data_4)
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* subtractive module */
|
||||||
|
module sub(type,loc_x,loc_y,loc_z,face,rotation,size_x,size_y,size_z,data_1,data_2,data_3,data_4) {
|
||||||
|
|
||||||
|
if(type == "rectangle") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) slab_r([size_x,size_y,size_z],data_4);
|
||||||
|
}
|
||||||
|
if(type == "round") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) cylinder(d=size_x,h=size_z);
|
||||||
|
}
|
||||||
|
if(type == "slot") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) slot(size_x,size_y,size_z);
|
||||||
|
}
|
||||||
|
if(type == "text") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) linear_extrude(height = size_z) text(data_3, size=data_1);
|
||||||
|
}
|
||||||
|
if(type == "art") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) art(data_1,data_2,data_3);
|
||||||
|
}
|
||||||
|
if(type == "button") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) button(data_3,[size_x,size_y,size_z],data_4,data_1);
|
||||||
|
}
|
||||||
|
if(type == "hd_holes") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"none","none",data_2);
|
||||||
|
}
|
||||||
|
if(type == "hd_vertleft_holes") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"vertical","left",data_2);
|
||||||
|
}
|
||||||
|
if(type == "hd_vertright_holes") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hd_bottom_holes(data_1,data_3,"vertical","right",data_2);
|
||||||
|
}
|
||||||
|
if(type == "hk_fan_top") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_fan_top();
|
||||||
|
}
|
||||||
|
if(type == "punchout") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) punchout(size_x,size_y,data_1,size_z,data_2,data_3);
|
||||||
|
}
|
||||||
|
if(type == "fan") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) fan_mask(size_x, size_z, data_1);
|
||||||
|
}
|
||||||
|
if(type == "vent") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent(size_x,size_y,size_z,data_4,data_1,data_2,data_3);
|
||||||
|
}
|
||||||
|
if(type == "vent_hex") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) vent_hex(size_x,size_y,size_z,data_1,data_2,data_3);
|
||||||
|
}
|
||||||
|
if(type == "microusb") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) microusb_open();
|
||||||
|
}
|
||||||
|
if(type == "sphere") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) sphere(d=size_x);
|
||||||
|
}
|
||||||
|
if(type == "keyhole") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) keyhole(data_4, true);
|
||||||
|
}
|
||||||
|
if(type == "h3_port_extender") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) h3_port_extender(data_3, true);
|
||||||
|
}
|
||||||
|
if(type == "hk_pwr_button") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) hk_pwr_button(true);
|
||||||
|
}
|
||||||
|
if(type == "dsub") {
|
||||||
|
translate([loc_x,loc_y,loc_z]) rotate(rotation) dsub(data_4, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user