This commit is contained in:
zhao
2023-01-03 00:30:45 -05:00
parent a84916a965
commit 48774d5b1b
88 changed files with 0 additions and 0 deletions

4818
rack/base1.stl Normal file

File diff suppressed because it is too large Load Diff

79
rack/body/base1.scad Normal file
View File

@ -0,0 +1,79 @@
include <../../common.scad>
include <../screws.scad>
$fn=64;
module baseFrame() {
difference() {
cube(size=[200,200,4], center=true);
cube(size=[180,180,4], center=true);
}
translate(v=[80,80,0])
cube(size=[20,20, 4],center=true);
translate(v=[-80,80,0])
cube(size=[20,20, 4],center=true);
translate(v=[80,-80,0])
cube(size=[20,20, 4],center=true);
translate(v=[-80,-80,0])
cube(size=[20,20, 4],center=true);
}
module lugBottom() {
difference() {
cube(size=[9.7,9.7,6], center=true);
translate(v=[2,2,0])
cube(size=[9.1,9.1,5+1], center=true);
}
}
module base() {
difference() {
union() {
translate(v=[0,0,4/2])
baseFrame();
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[1,0,0])
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[0,1,0])
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[1,1,0])
translate(v=[-90,-90,-6/2])
lugBottom();
}
union() {
translate(v=[80,80,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[-80,80,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[80,-80,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[-80,-80,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
}
}
}
base();

37
rack/body/l1.scad Normal file
View File

@ -0,0 +1,37 @@
slack = 0.5;
m3Diameter = 3.0;
m3Radius = m3Diameter/2.0;
m3ptr = m3Radius + slack;
legLength = 200;
module baseLeg(legLength) {
cube(size=[3, 15, legLength]);
}
module leg() {
difference() {
baseLeg(legLength);
union() {
for (i = [0:18]) {
translate(v=[0,10,(i+1)*10])
rotate(a=[0,90,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
}
translate(v=[0,10,(0+1)*10])
rotate(a=[0,90,0])
*cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[0,10,(18+1)*10])
rotate(a=[0,90,0])
*cylinder(h = 100, r = m3ptr, $fn=32, center=true);
}
}
}
leg();

View File

@ -0,0 +1,45 @@
slack = 0.5;
m3Diameter = 3.0;
m3Radius = m3Diameter/2.0;
m3ptr = m3Radius + slack;
legLength = 60;
module baseLeg(legLength) {
difference() {
cube(size=[16,16, legLength]);
translate(v=[4,4,4])
cube(size=[16, 16, legLength-2*4]);
}
}
module leg(ui) {
assert(ui > 0);
legLength = 20 + (ui-1)*10;
difference() {
baseLeg(legLength);
union() {
for (i = [0:ui-1]) {
translate(v=[0,10,(i+1)*10])
rotate(a=[0,90,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[10,0,(i+1)*10])
rotate(a=[90,0,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
}
translate(v=[10,10,legLength/2])
cylinder(h = legLength*2, r = m3ptr, $fn=32, center=true);
}
}
}
leg(18);

158
rack/body/m4Leg.scad Normal file
View File

@ -0,0 +1,158 @@
include <../../common.scad>
include <../screws.scad>
//slack = 0.5;
//m3Diameter = 3.0;
//m3Radius = m3Diameter/2.0;
//m3ptr = m3Radius + slack;
legWidth = 16;
legLength = 16;
legHeight = 60;
legFrontThickness = 6;
legSupportThickness = 4;
legWingThickness = 4;
legWingLength = 9;
// 9.5 to account for space for inserting hex nuts at the top
legWingWidth = 9.5+legSupportThickness;
module legWing() {
difference() {
cube(size=[legWingLength, legWingThickness, legWingWidth]);
union() {
translate(v=[4,0,10])
rotate(a=[90,0,0])
cylinder(r=m3RadiusSlacked, h=20, center=true);
translate(v=[14,0,10])
rotate(a=[90,0,0])
cylinder(r=m3RadiusSlacked, h=20, center=true);
}
}
}
module base() {
difference() {
cube(size=[25,25,legWingThickness]);
union() {
translate(v=[20,20,0])
cylinder(r=m3RadiusSlacked, h=100, center=true);
translate(v=[10,10,0])
cylinder(r=m3RadiusSlacked, h=100, center=true);
translate(v=[20,10,0])
cylinder(r=m3RadiusSlacked, h=100, center=true);
translate(v=[10,20,0])
cylinder(r=m3RadiusSlacked, h=100, center=true);
}
}
}
module baseLeg(legHeight) {
union() {
difference() {
cube(size=[16,16, legHeight]);
union() {
translate(v=[4,6,0])
cube(size=[16, 16, legHeight]);
// compensate for differences between leg/wing thickness
translate(v=[legSupportThickness,legSupportThickness,0])
cube(size=[legWidth,legWidth,legSupportThickness+10]);
translate(v=[legSupportThickness,legSupportThickness,legHeight-legWingWidth])
cube(size=[legWidth,legWidth,legSupportThickness+10]);
}
}
translate(v=[16,0,0])
legWing();
translate(v=[16,0,legHeight])
mirror(v=[0,0,1]) {
legWing();
}
mirror(v=[1,-1,0]) {
translate(v=[16,0,0])
legWing();
translate(v=[16,0,legHeight])
mirror(v=[0,0,1]) {
legWing();
}
}
}
base();
translate(v=[0,0,legHeight-legWingThickness])
base();
}
*baseLeg(180);
module leg(ui) {
assert(ui > 0);
legLength = 20 + (ui-1)*10;
difference() {
baseLeg(legLength);
union() {
intersection() {
union() {
for (i = [1:ui-2]) {
translate(v=[0,10,(i+1)*10])
rotate(a=[0,90,0])
*cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[10,3,(i+1)*10])
rotate(a=[90,-10,0])
m4HexNutPocketNegative();
}
}
translate(v=[-1,-1,legWingWidth])
cube(size=[1000,1000,legLength-2*legWingWidth]);
}
translate(v=[0,10,10])
rotate(a=[0,90,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[0,10,ui*10])
rotate(a=[0,90,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[10,0,10])
rotate(a=[90,0,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[10,0,ui*10])
rotate(a=[90,0,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
}
}
}
//mirror(v=[1,0,0])
leg(20);

88
rack/body/side/side.scad Normal file
View File

@ -0,0 +1,88 @@
include <../../../misc/magnet.scad>
include <../../../math.scad>
$fn=64;
_height = 210;
_depth = 200;
_thickness = 5;
holeOffset = 10;
module _base() {
difference() {
cube(size = [_height, _depth, _thickness], center=true);
union() {
translate(v = [0, 0, 20])
minkowski() {
sphere(r = 20);
cube(size = [_height - 34, _depth - 34, 1], center = true);
}
// handles
handleLength = 80;
translate(v=[0, _depth/2, _thickness+5.5])
minkowski() {
sphere(r=10);
cube(size=[handleLength, 10, 1], center=true);
}
translate(v=[0, -_depth/2, _thickness+5.5])
minkowski() {
sphere(r=10);
cube(size=[handleLength, 10, 1], center=true);
}
}
}
}
module magnetMount(h) {
slack = 0.2;
difference() {
cylinder(h = h, r=magnetR*2);
translate(v=[0,0,h-magnetH])
cylinder(h = magnetH, r = magnetR+slack);
}
}
module side() {
magnetMountOffsetX = 95;
magnetMountOffsetY = 90;
difference() {
union() {
// align _base to positive z plan
translate(v = [0, 0, _thickness / 2])
_base();
// magnet mounts (no holes)
for (i=mirror4XY(midpoint=[0,0,0], offsetX=magnetMountOffsetX, offsetY=magnetMountOffsetY)) {
translate(v=i)
cylinder(h=_thickness, r=2*magnetR);
}
}
// magnet mount holes
for (i=mirror4XY(midpoint=[0,0,_thickness-magnetH], offsetX=magnetMountOffsetX, offsetY=magnetMountOffsetY)) {
translate(v=i)
cylinder(h=magnetH, r=magnetR);
}
}
}
difference() {
side();
union() {
for (i=[0:7]) {
translate(v=[i*15 - 52.5,0,0])
minkowski() {
cube(size = [2, 100, 10], center = true);
sphere(r=2);
}
}
}
}

BIN
rack/body/side/side.stl Normal file

Binary file not shown.

97
rack/body/top1.scad Normal file
View File

@ -0,0 +1,97 @@
include <../../common.scad>
include <../../math.scad>
include <../screws.scad>
$fn=64;
_height = 8;
_width = 210;
_depth = 200;
module _bodySilBase(width, depth, height, roundedPartHeight) {
hull() {
cube(size = [width, depth, height - roundedPartHeight]);
minkowski() {
translate(v = [roundedPartHeight, 0, height - roundedPartHeight])
cube(size = [width-2*roundedPartHeight, depth, eps]);
rotate(a = [90, 0, 0])
cylinder(r = roundedPartHeight, h = eps);
}
}
}
module _bodySil(width, depth, height, roundedPartHeight, wallThickness, topThickness) {
cornerSquareDim = 30;
difference() {
_bodySilBase(width, depth, height, roundedPartHeight);
union() {
translate(v = [wallThickness, cornerSquareDim, - topThickness])
_bodySilBase(width - 2 * wallThickness, depth - 2 * cornerSquareDim, height, roundedPartHeight);
translate(v=[cornerSquareDim, wallThickness, -topThickness])
cube(size=[width-2*cornerSquareDim, depth-2*wallThickness, height]);
}
}
}
// Negative and centered on xy. Aligned with z=0 downwards
module _lugAndMagnet() {
slack = 0.3;
vSlack = 0.1;
// lug
translate(v=[0,0,-2.5])
cube(size=[10+slack, 10+slack, 5+vSlack], center=true);
// hole for magnet, no tolerance on
translate(v=[0,0,-(5+vSlack+1.7)])
cylinder(d=6+slack, h=1.7+vSlack);
}
module baseBody() {
difference() {
_bodySil(_width, _depth, _height, 4, 5, 2);
_mid = [_width / 2, _depth / 2, _height];
union() {
for (i = mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 15, offsetY = (_depth / 2) - 10)) {
translate(v = i)
_lugAndMagnet();
}
screwHolePositions = concat(
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 25, offsetY = (_depth / 2) - 20),
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 15, offsetY = (_depth / 2) - 20),
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 25, offsetY = (_depth / 2) - 10)
);
for (i = screwHolePositions) {
translate(v = i) {
cylinder(r = m3RadiusSlacked, h = inf, center = true);
}
}
}
}
}
difference() {
baseBody();
union() {
minkowski() {
translate(v = [(_width - 130) / 2, (_depth - 150) / 2, - inf / 2])
cube(size = [130, 150, inf]);
cylinder(r = 5);
}
}
}

BIN
rack/body/top1.stl Normal file

Binary file not shown.

71
rack/frontPlate.scad Normal file
View File

@ -0,0 +1,71 @@
include <../common.scad>
include <./screws.scad>
include <../rpi/voronoi.scad>
vU = 2;
uHeight = 10;
plateScrewDiffV = uHeight*vU;
plateScrewDiffH = 180;
plateScrewToHEdge = 4.5;
plateScrewToVEdge = 5.5;
frontPlateThickness = 2.5;
frontPlateV = plateScrewDiffV + 2*plateScrewToHEdge;
frontPlateH = plateScrewDiffH + 2*plateScrewToVEdge;
plateScrewToBoxMin = 6;
module _frontPlateBody() {
translate(v=[-plateScrewToVEdge,0,-plateScrewToHEdge])
cube(size=[frontPlateH,frontPlateThickness,frontPlateV]);
}
module _plateHole() {
rotate(a=[90,0,0])
cylinder(r=m4RadiusSlacked, h=inf, center=true);
}
module frontPlate() {
difference() {
_frontPlateBody();
union() {
// TODO: introduce helper modules for this pattern
_plateHole();
translate(v=[plateScrewDiffH,0,0])
_plateHole();
translate(v=[0,0,plateScrewDiffV])
_plateHole();
translate(v=[plateScrewDiffH,0,plateScrewDiffV])
_plateHole();
}
}
}
difference() {
difference () {
rotate(a=[-90,0,0])
frontPlate();
translate(v=[0,0,-5])
voronoi3u_N(10);
}
// lug holes
union() {
translate(v=[160,-3,-frontPlateThickness])
cube(size=[5.2, 5.2, 3]);
translate(v=[160-91.1,-3,-frontPlateThickness])
cube(size=[5.2, 5.2, 3]);
}
}

16214
rack/frontPlate2u.stl Normal file

File diff suppressed because it is too large Load Diff

17642
rack/l1.stl Normal file

File diff suppressed because it is too large Load Diff

35310
rack/legToleranceTest.stl Normal file

File diff suppressed because it is too large Load Diff

54952
rack/m4Leg.stl Normal file

File diff suppressed because it is too large Load Diff

54952
rack/m4LegM.stl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
eps=0.01;
vU = 2;
uHeight = 10;
plateScrewDiffV = uHeight*vU;
plateScrewDiffH = 180;
plateScrewToHEdge = 4.5;
plateScrewToVEdge = 5.5;
frontPlateThickness = 3;
frontPlateV = plateScrewDiffV + 2*plateScrewToHEdge;
frontPlateH = plateScrewDiffH + 2*plateScrewToVEdge;
//////////////////////////////////////////////////////
trayOuterHeight = 28;
trayOuterWidth = 168;
trayOuterDepth = 130;
trayBottomThickness = 2;
traySideThickness = 3;
trayFrontThickness = 2;
trayInnerWidth = trayOuterWidth - 2*traySideThickness;
trayInnerDepth = trayOuterDepth - trayFrontThickness;
trayInnerHeight = trayOuterHeight - trayBottomThickness;
module _trayBody() {
difference() {
cube(size = [trayOuterWidth, trayOuterDepth, trayOuterHeight]);
union() {
translate(v = [traySideThickness, trayFrontThickness, trayBottomThickness])
cube(size = [trayInnerWidth + eps, trayInnerDepth + eps, trayInnerHeight + eps]);
translate(v=[0,0, trayOuterHeight])
rotate(a=[-atan(trayInnerHeight/trayOuterDepth),0,0])
cube(size=[trayOuterWidth+eps, 2*trayOuterDepth+eps, trayInnerHeight+eps]);
translate(v=[5+traySideThickness,0,trayBottomThickness])
cube(size=[trayInnerWidth-10, trayFrontThickness+eps, trayOuterHeight]);
}
}
}
// todo make a nice module for this (triangular prism)
module _sideHole_N() {
scale(v=[2,0.65,0.65])
difference () {
cube(size = [trayOuterWidth, trayOuterDepth, trayOuterHeight]);
translate(v = [0, 0, trayOuterHeight])
rotate(a = [- atan(trayInnerHeight / trayOuterDepth), 0, 0])
cube(size = [trayOuterWidth + eps, 2 * trayOuterDepth + eps, trayInnerHeight + eps]);
}
}
module trayBody() {
union() {
difference() {
_trayBody();
union() {
// bottom holes
for (i = [0:7]) {
translate(v = [35, i * 15 + 10, - eps])
*cube(size = [100, 5, 10]);
}
translate(v=[-10,5,5])
_sideHole_N();
}
}
// lugs for front
translate(v=[0,-2,0])
cube(size=[5,2,5]);
translate(v=[trayOuterWidth-5,-2,0])
cube(size=[5,2,5]);
}
}
//trayBody();

365
rack/rackCase.scad Normal file
View File

@ -0,0 +1,365 @@
include <../common.scad>
include <./screws.scad>
include <../risers.scad>
// TODO currently only for rockpro64 - make generic
vU = 3;
uHeight = 10;
// Front Plate dimensions
frontPlateScrewDiffV = uHeight*vU;
frontPlateScrewDiffH = 180;
frontPlateHeightTopSpace = 0.25; // Give some space at the top for the lid
frontPlateHeightBottomSpace = 0;
frontPlateHeight = (vU+1)*uHeight - (frontPlateHeightBottomSpace+frontPlateHeightTopSpace);
frontPlateWidth = 190;
frontPlateBottomScrewToHEdge = uHeight/2 + frontPlateHeightBottomSpace;
frontPlateTopScrewToHEdge = uHeight/2 + frontPlateHeightTopSpace;
frontPlateScrewToVEdge = (frontPlateWidth - frontPlateScrewDiffH)/2;
frontPlateThickness = 2.5;
plateScrewToBoxMin = 6;
// BOX CONFIG
// box dimensions
boxDepth = 132;
boxWidth = 160;
boxBottomThickness = 2;
boxSideThickness = 2;
boxBackThickness = 2;
boxFrontThickness = 2;
boxTopSpace = 1; // meant for lids?
boxBottomSpace = 1; // meant to be used for boxes that expect support rails (edit: not using right now)
boxHeight = (vU+1) * uHeight - (boxBottomSpace+boxTopSpace);
boxInnerDepth = boxDepth - (boxBackThickness+boxFrontThickness);
boxInnerHeight = boxHeight - boxBottomThickness; // TODO support lids
boxInnerWidth = boxWidth - 2*boxSideThickness;
// all of these are defined on the xy plane with centered zLen height
// 'rise' is meant model how raised a pcb is. More specifically, the distance between the top of
// the pcb and the bottom of the inside of the case
module frontFace_N(zLen, rise) {
translate(v=[7.5,2,0])
cube(size=[boxInnerWidth - 15, boxInnerHeight-8, zLen]);
}
module backFace_N(zLen, rise) {
translate(v=[7.5,2,0])
cube(size=[boxInnerWidth - 15, boxInnerHeight-8, zLen]);
}
module leftFace_N(zLen, rise) {
translate(v=[7.5,2,0])
cube(size=[boxInnerDepth - 15, boxInnerHeight-8, zLen]);
}
module rightFace_N(zLen, rise) {
translate(v=[7.5,2,0])
cube(size=[boxInnerDepth - 15, boxInnerHeight-8, zLen]);
}
module boxBody() {
// save this transformation...
// translate(v=[(plateScrewDiffH-boxWidth)/2.0,0,boxBottomSpace -plateScrewToHEdge])
// convert to inside box space
translate(v=[-boxSideThickness, -boxFrontThickness, -boxBottomThickness])
difference() {
cube(size=[boxWidth, boxDepth, boxHeight]);
translate(v=[boxSideThickness, boxFrontThickness, boxBottomThickness])
cube(size=[boxWidth-2*boxSideThickness, boxDepth-(boxBackThickness+boxFrontThickness), inf]);
}
}
module boxBodyWithHoles() {
m_trans_back =
[ [-1, 0, 0, boxInnerWidth],
[0, -1, 0, boxInnerDepth-boxBackThickness],
[0, 0, 1, 0],
[0, 0, 0, 1]];
m_trans_left_side =
[ [cos(-90), -sin(-90), 0, 0],
[sin(-90), cos(-90), 0, boxInnerDepth],
[0, 0, 1, 0],
[0, 0, 0, 1]];
m_trans_right_side =
[ [cos(90), -sin(90), 0, boxInnerWidth],
[sin(90), cos(90), 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]];
difference() {
boxBody();
union() {
rotate(a=[90,0,0])
frontFace_N(10, 0);
multmatrix(m_trans_back)
rotate(a=[90,0,0])
backFace_N(10, 0);
multmatrix(m_trans_left_side)
rotate(a=[90,0,0])
leftFace_N(10, 0);
multmatrix(m_trans_right_side)
rotate(a=[90,0,0])
rightFace_N(10, 0);
}
}
}
// lid + lugging
module cylinderLug_M(length, radius) {
rotate(a=[0,90,0])
cylinder(h=length, r=radius, center=true);
}
module cylinderLug(lMult=1, rMult=1) {
cylinderLug_M(6*lMult, 1*rMult);
}
function lerp(u, a, b) = (1-u)*a + u*b;
module lugLine(a,b, numLugs, lMult=1, rMult=1) {
assert(numLugs>0);
// require straight line that is level (same z values) either parallel with the x axis, or y axis
// this just avoids some math and simplifies things
assert(a[2] == b[2] && (a[0]==b[0] || a[1]==b[1]));
direction = norm(b-a);
for (i=[0:numLugs-1]) {
u = (i+1)/(numLugs+1);
if (a[1] == b[1]) {
translate(v=lerp(u,a,b))
cylinderLug(lMult, rMult);
} else if (a[0] == b[0]) {
translate(v=lerp(u,a,b))
rotate(a=[0,0,90])
cylinderLug(lMult,rMult);
}
}
}
module lugProfile(height, sideEps=0, lMult=1, rMult=1) {
points = [
[0+sideEps,0+sideEps,height],
[boxInnerWidth-sideEps,0+sideEps,height],
[boxInnerWidth-sideEps, boxInnerDepth-sideEps, height],
[0+sideEps, boxInnerDepth-sideEps, height]
];
for (i=[1:4]) {
lugLine(points[(i-1)%4], points[i%4], 3, lMult, rMult);
}
}
module lidBody() {
topLidThickness = 1;
bottomLidThickness = 4;
bottomLidWallThickness = 2;
translate(v=[-boxSideThickness, -boxFrontThickness,0])
cube(size=[boxWidth, boxDepth, topLidThickness]);
difference() {
innerWallTolerance = 0.1;
innerWallWidth = boxWidth - 2 * boxSideThickness - innerWallTolerance;
innerWallDepth = boxDepth - (boxFrontThickness + boxBackThickness) - innerWallTolerance;
translate(v = [innerWallTolerance/2, innerWallTolerance/2, topLidThickness])
cube(size = [innerWallWidth, innerWallDepth,
bottomLidThickness]);
translate(v = [bottomLidWallThickness, bottomLidWallThickness, topLidThickness])
cube(size = [boxWidth - 2*boxSideThickness - 2*bottomLidWallThickness, boxDepth - (boxFrontThickness + boxBackThickness) - 2*bottomLidWallThickness,
bottomLidThickness]);
}
}
module lid() {
difference() {
union() {
lidBody();
// todo figure out relation
lugProfile(3, sideEps = 0.25, lMult=0.95, rMult=0.95);
}
for (i=[0:7]) {
translate(v=[i*17 + 14, 15,-2])
minkowski() {
cylinder(r=1,h=1);
cube(size = [10, 20, 5]);
}
}
}
}
module case() {
difference() {
union() {
boxBodyWithHoles();
translate(v=[20,5, -1])
rockProScrewMounts();
// lugs
translate(v=[0,-(1+boxFrontThickness),0])
cube(size=[4,1,4]);
translate(v=[boxInnerWidth-4,-(1+boxFrontThickness),0])
cube(size=[4,1,4]);
}
union() {
lugProfile(boxHeight-4); // todo reliant on box bottom thickness
translate(v=[32,25,-2])
minkowski() {
cylinder(r=1,h=0.1);
cube(size = [50, 80, 5]);
}
}
}
}
/////////////////////////////////////////////////////////////////////////////////
module _frontPlateBody() {
cube(size=[frontPlateWidth,frontPlateThickness,frontPlateHeight]);
}
module _plateHole() {
rotate(a=[90,0,0])
cylinder(r=m4RadiusSlacked, h=inf, center=true);
}
module frontPlate() {
difference() {
_frontPlateBody();
translate(v=[frontPlateScrewToVEdge, 0, frontPlateBottomScrewToHEdge])
union() {
// TODO: introduce helper modules for this pattern
_plateHole();
translate(v=[frontPlateScrewDiffH,0,0])
_plateHole();
translate(v=[0,0,frontPlateScrewDiffV])
_plateHole();
translate(v=[frontPlateScrewDiffH,0,frontPlateScrewDiffV])
_plateHole();
}
}
}
module frontPlateAligned() {
difference() {
// Aligned with case
translate(v = [
-(boxSideThickness + (frontPlateWidth - boxWidth) / 2),
-(boxFrontThickness+frontPlateThickness),
-boxBottomThickness
])
frontPlate();
union() {
// lugs TODO not recessed enough!!
translate(v=[-0.05,-(1.5+boxFrontThickness),-0.05])
cube(size=[4+0.1,2,4+0.1]);
translate(v=[-0.05 + (boxInnerWidth-4),-(1.5+boxFrontThickness),-0.05])
cube(size=[4+0.1,2,4+0.1]);
}
}
}
module rockPro64FrontPlate() {
difference() {
frontPlateAligned();
union() {
translate(v=[-1,-4,22])
rotate(a=[90,0,0])
linear_extrude(10)
text("rock-2", font="Tlwg Mono:style=Bold", size=9);
minkowski() {
rotate(a=[90,0,0])
cylinder(h=1, r=1);
union() {
translate(v = [24, - 10, 7])
cube(size = [62, 10, 9]);
translate(v = [52, - 10, 7])
cube(size = [34, 10, 18]);
}
}
intersection() {
translate(v = [95, - 10, 3])
cube(size = [70, 20, 26]);
for(i=[0:9]) {
translate(v = [83 + 8*i, - 10, 0])
rotate(a=[0,30,0])
cube(size=[3, 15, 50]);
}
}
}
}
}
rockPro64FrontPlate();
//translate(v=[0,-20,0])
//frontPlateAligned();
//case();
//translate(v=[0,0,50])
//mirror(v=[0,0,1])
//lid();

BIN
rack/rackCase.stl Normal file

Binary file not shown.

7506
rack/rackCase180.stl Normal file

File diff suppressed because it is too large Load Diff

171
rack/rackCaseForBox.scad Normal file
View File

@ -0,0 +1,171 @@
/* Simple configurable rack mount component to hold a box-like shell */
include <../common.scad>
include <./screws.scad>
slack = 0.4;
boxWidth = 157.67;
boxHeight = 27.0;
boxLength = 101.5+1;
topThickness = 1.0;
bottomThickness = 1.0;
faceThickness = 3.0;
sideThickness = 2.0;
sideSupportWidth = 10;
railWidth = 16.0;
totalHeight = boxHeight+topThickness+bottomThickness;
totalLength = boxLength+2*sideThickness;
railMountWidthDiff = (200.0 - (boxWidth + 2*sideThickness)) / 2.0;
totalMountLength = 200.0 + 2*faceThickness + 1;
module sideHolder() {
module frontLowerCaseSegment() {
translate(v=[0,0,0])
cube(size=[sideSupportWidth, faceThickness, bottomThickness]);
}
module frontUpperCaseSegment() {
// no room for slack? :(
translate(v=[0,0,boxHeight+bottomThickness])
cube(size=[sideSupportWidth, faceThickness, topThickness]);
}
module backLowerCaseSegment() {
translate(v=[0,boxLength+slack+sideThickness,0])
frontLowerCaseSegment();
}
module backUpperCaseSegment() {
translate(v=[0,boxLength+slack+sideThickness,0])
frontUpperCaseSegment();
}
module backLowerRailSegment() {
translate(v=[0,200.0+1,0])
cube(size=[sideSupportWidth, faceThickness, bottomThickness]);
}
module backUpperRailSegment() {
translate(v=[0,200.0+1,boxHeight+bottomThickness])
cube(size=[sideSupportWidth, faceThickness, topThickness]);
}
module frontRailMountSegment() {
// +2 is slack
translate(v=[-railMountWidthDiff+5,0,0])
// should technically use different totalHeight, as current totalHeight is for case holder
cube(size=[railWidth,faceThickness,totalHeight]);
}
module backRailMountSegment() {
translate(v=[0,200+1,0])
// should technically use different totalHeight, as current totalHeight is for case holder
frontRailMountSegment();
}
module frontFace() {
difference() {
hull() {
frontLowerCaseSegment();
frontUpperCaseSegment();
frontRailMountSegment();
}
// screw holes
translate(v=[-railMountWidthDiff + 11.5,0,5])
rotate(a=[90,0,0])
cylinder(r=m4RadiusSlacked, h=10, center=true);
translate(v=[-railMountWidthDiff + 11.5,0,25])
rotate(a=[90,0,0])
cylinder(r=m4RadiusSlacked, h=10, center=true);
}
}
module backFace() {
translate(v=[0,200.0+faceThickness+1,0])
frontFace();
}
frontFace();
backFace();
hull() {
frontLowerCaseSegment();
backLowerCaseSegment();
}
hull() {
backLowerCaseSegment();
backUpperCaseSegment();
}
hull() {
frontUpperCaseSegment();
backUpperCaseSegment();
}
hull() {
backLowerRailSegment();
backLowerCaseSegment();
}
hull() {
backUpperRailSegment();
backUpperCaseSegment();
}
// side support/hold for case
difference() {
cube(size=[sideThickness, totalLength, totalHeight]);
translate(v=[-eps/2,8,5])
cube(size=[sideThickness+eps,totalLength-17.5+eps, totalHeight-10+eps]);
}
// side support/hold for case
difference() {
translate(v=[sideSupportWidth-sideThickness,totalLength,0])
cube(size=[sideThickness, totalMountLength-totalLength, totalHeight]);
translate(v=[sideSupportWidth-sideThickness-eps/2,(200-totalLength)+20,5])
cube(size=[sideThickness+eps,(200-totalLength)-10+eps, totalHeight-10+eps]);
}
}
module sideHolderAligned() {
//translate(v=[19,0,0])
sideHolder();
}
module mSide() {
mirror(v=[1,0,0]) {
sideHolderAligned();
}
}
sideHolderAligned();
//translate(v=[42 + boxWidth,0,0])
//mSide();

7982
rack/rackCaseForBox.stl Normal file

File diff suppressed because it is too large Load Diff

7982
rack/rackCaseForBoxM.stl Normal file

File diff suppressed because it is too large Load Diff

BIN
rack/rackCaseFrontPlat.stl Normal file

Binary file not shown.

BIN
rack/rackCaseFrontPlate.stl Normal file

Binary file not shown.

BIN
rack/rackCaselid.stl Normal file

Binary file not shown.

14422
rack/screwmount-test.stl Normal file

File diff suppressed because it is too large Load Diff

62
rack/screwmount.scad Normal file
View File

@ -0,0 +1,62 @@
/* Contains screw mounts to be used to fix risers and whatnot into plastic */
include <../common.scad>
include <./screws.scad>
// Heat set inserts:
// Useful references:
// https://hackaday.com/2019/02/28/threading-3d-printed-parts-how-to-use-heat-set-inserts/
// My knurled brass nut dimensions
m4NutDiameter = 6;
m4NutLength1 = 6;
m3NutDiameter = 4.9;
m3NutLength1 = 6;
module nut_N(diameter,length,edm,elm) {
cylinder(h=(length + length*edm), d=(diameter + diameter*edm));
}
difference() {
union() {
cube(size=[30,30,2.5]);
translate(v=[8,8,0])
cylinder(h=8,d=8);
translate(v=[22,8,0])
cylinder(h=10,d=8);
translate(v=[8,22,0])
cylinder(h=8,d=10);
translate(v=[22,22,0])
cylinder(h=10,d=10);
}
union() {
translate(v=[8,8,2])
cylinder(h=6, d=6);
translate(v=[22,8,4])
cylinder(h=6,d=6);
translate(v=[8,22,2])
cylinder(h=6,d=6);
translate(v=[22,22,3])
cylinder(h=8,d=6);
}
}

113
rack/screws.scad Normal file
View File

@ -0,0 +1,113 @@
/* Some common screw dimensions */
inf = 400; // basically infinity
/********************************************************************************/
// M3 dimensions
m3HoleRadiusSlack = 0.15;
m3Diameter = 3.0;
m3Radius = m3Diameter/2.0;
m3RadiusSlacked = m3Radius + m3HoleRadiusSlack;
// legacy TODO: replace
m3ptr = m3RadiusSlacked;
// NUTS!
m3HexNutWidthAcrossFlats = 5.41;
m3HexNutWidthAcrossCorners = FtoG(m3HexNutWidthAcrossFlats);
m3HexNutThickness = 2.18;
module m3HexNutPocketNegative() {
hexNutPocketNegative(m3RadiusSlacked,
m3HexNutWidthAcrossCorners/2 + 0.1,
m3HexNutThickness + 0.2);
}
// TODO: remove test
*difference() {
cube(size=[8,12,5], center=true);
rotate(a=[0,0,20])
m3HexNutPocketNegative();
}
*m3HexNutPocketNegative();
/********************************************************************************/
// M4 dimensions
m4HoleRadiusSlack = 0.15;
m4Diameter = 4.0;
m4Radius = m4Diameter/2.0;
m4RadiusSlacked = m4Radius + m4HoleRadiusSlack;
m4HexNutWidthAcrossFlats = 6.89;
m4HexNutWidthAcrossCorners = FtoG(m4HexNutWidthAcrossFlats);
m4HexNutThickness = 3.07;
module m4HexNutPocketNegative() {
hexNutPocketNegative(m4RadiusSlacked,
m4HexNutWidthAcrossCorners/2 + 0.1,
m4HexNutThickness + 0.2);
}
// TODO: remove test
*difference() {
translate(v=[0,1,0])
cube(size=[10,12,6], center=true);
rotate(a=[0,0,20])
m4HexNutPocketNegative();
}
*m4HexNutPocketNegative();
/********************************************************************************/
// Convert a regular hexagon widthAcrossFlats to widthAcrossCorners
function FtoG(widthAcrossFlats) = widthAcrossFlats * (2/sqrt(3));
// Convert a regular hexagon widthAcrossCorners to widthAcrossFlats
function GtoF(widthAcrossCorners) = widthAcrossCorners * (sqrt(3)/2);
module hexNutPocketNegative(
innerRadius,
widthAcrossCorners,
thickness)
{
union() {
hull() {
// hexagonal cylinder representing where the nut should fit
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
// negative volume for sliding in the nut
translate(v=[inf,0,0])
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
}
// negative volume for screw lead
translate(v=[0,0,-10])
cylinder(r=innerRadius, h = inf, $fn=32);
hull() {
translate(v=[inf,0,0])
cylinder(r=innerRadius, h = inf, $fn=32);
cylinder(r=innerRadius, h = inf, $fn=32);
}
}
}

1682
rack/screws.stl Normal file

File diff suppressed because it is too large Load Diff