added sbccb_accessory_tool.scad for user access to the accessory library, fixed rack tab hole spacing, added library parts rack_rail and rack_stand for 1u-4u cases

This commit is contained in:
Edward Kisiel
2025-05-29 16:50:35 -04:00
parent 12c99bee77
commit 054dbb9edc
7 changed files with 245 additions and 16 deletions

View File

@@ -16,6 +16,8 @@
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
rack_end_bracket(side, size, thick)
rack_rail(style, rack_1u, hole_dia, thick)
rack_stand(rack_1u)
*/
@@ -36,7 +38,9 @@
module rack_end_bracket(side, size, thick) {
u1 = 44.45;
depth = size == "1u" ? 44.45 : size == "1u+" ? 59.26 : size == "1u++" ? 74.07 : size == "2u" ? 2*44.45 : size == "3u" ? 3*44.45 : 4*44.45;
mask = size == "1u" ? 44.45 : size == "1u+" ? 88.9 : size == "1u++" ? 88.9 : size == "2u" ? 2*44.45 : size == "3u" ? 3*44.45 : 4*44.45;
c_fillet = 2;
hole = 3.2;
rack_hole = 6;
@@ -50,7 +54,7 @@ module rack_end_bracket(side, size, thick) {
$fn=90;
if(side == "left") {
translate([thick,-thick,depth]) rotate([270,0,0])
translate([thick,0,0]) rotate([90,0,0])
difference() {
union() {
translate([(-tab_width/2),(depth/2),thick/2])
@@ -60,8 +64,11 @@ module rack_end_bracket(side, size, thick) {
cube_fillet_inside([b_width,b_depth,b_height],
vertical=[0,0,0,0],top=[c_fillet,0,c_fillet,0],bottom=[0,0,0,0], $fn=90);
}
for (c=[7.5:15:depth]) {
translate([(3-thick)-9-(15.875-9)/2,c,-adjust]) slot(rack_hole,3,thick+(adjust*2));
for(i=[0:u1:mask-u1]) {
for(c=[6.35:15.875:44.45]) {
translate([(3-thick)-9-(15.875-9)/2,c+i,-adjust])
slot(rack_hole,3,thick+(adjust*2));
}
}
}
}
@@ -76,9 +83,123 @@ module rack_end_bracket(side, size, thick) {
cube_fillet_inside([b_width,b_depth,b_height],
vertical=[0,0,0,0],top=[c_fillet,0,c_fillet,0],bottom=[0,0,0,0], $fn=90);
}
for (c=[7.5:15:depth]) {
translate([(3-thick)-9-(15.875-9)/2,c,-adjust]) slot(rack_hole,3,thick+(adjust*2));
for(i=[0:u1:mask-u1]) {
for(c=[6.35:15.875:44.45]) {
translate([(3-thick)-9-(15.875-9)/2,c+i,-adjust]) slot(rack_hole,3,thick+(adjust*2));
}
}
}
}
}
/*
NAME: rack_rail
DESCRIPTION: creates rack rail lengths
TODO: none
USAGE: rack_rail(style, rack_1u, hole_dia, thick)
style = "none", "nut", "insert"
rack_1u = number of 1u
hole_dia = hole size to create
thick = thickness of bracket
*/
module rack_rail(style, rack_1u, hole_dia, thick) {
1u = 44.45;
mount_rail = 15.875;
1u_hole_offset = 6.35;
1u_hole_spacing = 15.875;
height = rack_1u * 1u;
difference() {
union() {
cube([mount_rail, thick, height]);
if(style == "nut" || style == "insert") {
fastner = style == "insert" ? "m3-insert" : "m3";
for(i=[0:rack_1u-1]) {
translate([mount_rail/2, adj, i*1u]) {
translate([0,0,1u_hole_offset]) rotate([90,0,0])
nut_holder(fastner, "sloped", 7, mount_rail-1, 3, [false,10,2,"default"]);
translate([0,0,1u_hole_offset+1u_hole_spacing])
rotate([90,0,0]) nut_holder(fastner, "sloped", 7, mount_rail-1, 3, [false,10,2,"default"]);
translate([0,0,1u_hole_offset+2*1u_hole_spacing])
rotate([90,0,0]) nut_holder(fastner, "sloped", 7, mount_rail-1, 3, [false,10,2,"default"]);
}
}
}
}
for(i=[0:rack_1u-1]) {
translate([mount_rail/2, -1, i*1u]) {
translate([0,thick+2,1u_hole_offset]) rotate([90,0,0]) cylinder(d = hole_dia, h=thick+2);
translate([0,thick+2,1u_hole_offset+1u_hole_spacing]) rotate([90,0,0]) cylinder(d = hole_dia, h=thick+2);
translate([0,thick+2,1u_hole_offset+2*1u_hole_spacing]) rotate([90,0,0]) cylinder(d = hole_dia, h=thick+2);
}
}
translate([-1,-1,height]) cube([mount_rail+2,thick+2,10]);
}
}
/*
NAME: rack_stand
DESCRIPTION: creates rack stand of 1u hieght
TODO: none
USAGE: rack_stand(rack_1u)
rack_1u = number of 1u
*/
module rack_stand(rack_1u) {
1u = 44.45;
mount_rail = 15.875;
thick = 5;
height = rack_1u * 1u;
height_offset = 25.4/2;
hole_dia = 3.2;
c_fillet = 9;
rail_offset = 87.5;
foot_length = 175;
foot_thick = thick;
$fn=180;
// vertical rack rails
translate([0, 0, height_offset-adj]) rack_rail(rack_fasteners, rack_1u, hole_dia, thick);
// bottom feet
translate([mount_rail/2, -rail_offset/2, foot_thick-2]) cube_fillet_inside([mount_rail, foot_length, foot_thick],
vertical=[0,0,0,0], top=[c_fillet,0,c_fillet,0], bottom=[0,0,0,0], $fn=90);
// bottom connection piece
translate([0, 0, 0]) cube([mount_rail, thick, height_offset]);
// top extension piece
ext_len = rack_1u == 4 ? thick : rack_1u == 3 ? thick : thick;
translate([0, 0, height+height_offset-adj]) cube([mount_rail, thick, ext_len]);
// support arc
if(rack_1u > 0) {
ext_adj = rack_1u == 4 ? 4.5*thick : rack_1u == 3 ? 3.5*thick : 2.5*thick;
difference() {
translate([0,(height/2)-5*thick,ext_adj]) rotate([0,90,0]) {
difference() {
translate([0,0,0]) cylinder(d=(2*height)+(3*thick), h=mount_rail);
translate([0,0,-adj]) cylinder(d=(2*height)+thick, h=mount_rail+(2*adj));
}
}
// top trim
translate([-1, thick, height+height_offset-5]) cube([mount_rail+2, 300, 40]);
// front trim
translate([-1, 42.75, -175]) cube([mount_rail+2, 300, 400]);
translate([-1, thick, foot_thick]) cube([mount_rail+2, 300, 400]);
// bottom trim
translate([-1, -150, -174.5]) cube([mount_rail+2, 300, 175]);
}
}
}