This commit is contained in:
zhao
2023-01-10 23:30:19 -05:00
parent 43c2aceba5
commit bb6288ee32
83 changed files with 172 additions and 172 deletions

41
rack/assemble.scad Normal file
View File

@ -0,0 +1,41 @@
include <../helper/math.scad>
include <./config.scad>
include <./mainRail.scad>
include <./yBar.scad>
include <./xBar.scad>
translate(v=[12,2,18])
mainRail();
translate(v=[12,2 + 200,18])
mirror(v=[0,1,0])
mainRail();
translate(v=[12 + 216,2,18])
mirror(v=[1,0,0])
mainRail();
translate(v=[12 + 216,2 + 200,18])
rotate(a=[0,0,180])
mainRail();
xyPlane();
translate(v=[0,0,250])
mirror(v=[0,0,1])
xyPlane();
module xyPlane() {
yBar();
translate(v = [240, 0, 0])
mirror(v = [1, 0, 0])
yBar();
translate(v = [30, 0, 0])
xBar();
translate(v = [30, 206, 0])
mirror(v = [0, 1, 0])
xBar();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +0,0 @@
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();

View File

@ -1,37 +0,0 @@
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

@ -1,45 +0,0 @@
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);

View File

@ -1,158 +0,0 @@
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);

View File

@ -1,88 +0,0 @@
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);
}
}
}
}

Binary file not shown.

View File

@ -1,97 +0,0 @@
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);
}
}
}

Binary file not shown.

34
rack/config.scad Normal file
View File

@ -0,0 +1,34 @@
/*
case-files v2
This file contains parameters used for declaring/generating a customized rack frame.
- All dimensions are in millimetres (mm) unless stated otherwise.
- A "_N" appended to a module is meant to denote that this module is a negative volume, and should only be used to
substract from other volumes.
*/
// Maximum width for rackmount units. Change this according your max expected enclosure width.
// Changing this will directly affect the required build volume.
maxUnitWidth = 200;
// Maximum (recommended) unit depth. There technically isn't a max unit depth because there's no physical bound on
// how far a rack unit can extrude back. This parameter basically controls the distance between the front of the front
// rails and the back of the back rails. Changing this will directly affect the required build volume.
maxUnitDepth = 200;
// Vertical distance between the midpoint of adjacent screws mounts. Affects build volume.
screwDiff = 10;
// Number screw slots on the main rail. Affects build volume.
numRailScrews = 20;
// Screw type used for rackmount units. See screws.scad.
mainRailScrewType = "m4";
// Screw type used to affix side rails.
mainRailSideMountScrewType = "m4";
// Screw type used for constructing the actual rack frame.
rackFrameScrewType = "m3";
// Currently, only m3 screws are supported here (tolerance issues)
assert(rackFrameScrewType == "m3");

0
rack/connectors.scad Normal file
View File

View File

@ -1,71 +0,0 @@
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]);
}
}

File diff suppressed because it is too large Load Diff

17642
rack/l1.stl

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

98
rack/mainRail.scad Normal file
View File

@ -0,0 +1,98 @@
include <./config.scad>
include <./screws.scad>
include <../helper/math.scad>
/* Small horizontal planes at the top and bottom of the main rails. Used so we can fasten the rail to the frame
Note that this value is also used for a depression at the bottom/top of the frame for aligning the rail */
railFootThickness = 3;
railTotalHeight = screwDiff * (numRailScrews + 1) + 2 * railFootThickness;
railFrontThickness = 6; // Make sure that the nuts for the chosen screw type can slot within the front face
railSideMountThickness = 2.5;
// Distance between the middle of a screw mount and the rail's vertical edges
railScrewHoleToInnerEdge = 5;
railScrewHoleToOuterEdge = 7;
// Distance between the midpoint of the rail screw holes.
rackMountScrewWidth = maxUnitWidth + 2 * railScrewHoleToInnerEdge;
// Extra spacing for screws.
frontScrewSpacing = 15;
sideSupportScrewHoleToBackEdge = 4;
sideSupportDepth = sideSupportScrewHoleToBackEdge + frontScrewSpacing;
frontFaceWidth = railScrewHoleToInnerEdge + railScrewHoleToOuterEdge;
railTotalWidth = frontFaceWidth;
railTotalDepth = railFrontThickness+sideSupportDepth;
echo("Total Rail Height: ", railTotalHeight);
// Also known as the z-bar :)
module mainRail() {
union() {
_frontRailSegment();
translate(v = [railSideMountThickness, railFrontThickness, 0])
rotate(a = [0, 0, 90])
_sideSupportSegment();
translate(v = [0, railFrontThickness, 0]) {
translate(v=[railSideMountThickness,0,0])
_railFeet();
translate(v = [railSideMountThickness, 0, railTotalHeight - railFootThickness])
_railFeet();
}
}
module _frontRailSegment() {
difference() {
cube(size = [frontFaceWidth, railFrontThickness, railTotalHeight]);
for (i = [1:numRailScrews]) {
translate(v = [railScrewHoleToOuterEdge, railFrontThickness / 2, i * screwDiff + railFootThickness])
rotate(a = [90, 0, 0])
hexNutPocket_N(mainRailScrewType);
}
}
}
module _sideSupportSegment() {
difference() {
cube(size = [sideSupportDepth, railSideMountThickness, railTotalHeight]);
for (i = [1:numRailScrews]) {
translate(v = [frontScrewSpacing, railFrontThickness/2, i*screwDiff+railFootThickness])
rotate(a = [90, 0, 0])
cylinder(r = screwRadiusSlacked(mainRailSideMountScrewType), h = inf10, $fn = 32);
}
}
}
module _railFeet() {
difference() {
cube(size = [frontFaceWidth - railSideMountThickness, sideSupportDepth, railFootThickness]);
translate(v = [5, 4, 0])
cylinder(r = screwRadiusSlacked(rackFrameScrewType), h = inf10, $fn = 32);
}
}
}
module railFeetSlot_N() {
slotSlack = 0.2;
union() {
translate(v=[-slotSlack/2, -slotSlack/2,0])
cube(size = [railTotalWidth + slotSlack, railTotalDepth + slotSlack, railFootThickness]);
translate(v = [railSideMountThickness + 5, railFrontThickness + 4 , -m3HeatSetInsertSlotHeightSlacked])
heatSetInsertSlot_N(rackFrameScrewType);
}
}

View File

@ -1,85 +0,0 @@
$fn=64;
include <./math.scad>
eps=0.1;
module leg() {
mainLength = 80;
upperDim = 20;
innerDim = 10;
translate(v=[0,0,mainLength/2]) {
cube(size=[upperDim, upperDim, mainLength], center=true);
translate(v=[0,0,mainLength/2 + innerDim/8-0.3])
cube(size=[innerDim, innerDim, innerDim/4-0.5], center=true);
}
}
module base() {
difference() {
union() {
cube(size=[200,200,4], center=true);
// legs
for (i=mirror4XY(midpoint=[0,0,-2], offsetX=90, offsetY=90)) {
translate(v=i)
leg();
}
// base support
translate(v=[0,0,4.5])
cube(size=[200,5,5], center=true);
rotate(a=[0,0,90])
translate(v=[0,0,4.5])
cube(size=[200,5,5], center=true);
translate(v=[0,-98,4.5])
cube(size=[200,4,5], center=true);
rotate(a=[0,0,90])
translate(v=[0,-98,4.5])
cube(size=[200,4,5], center=true);
rotate(a=[0,0,180])
translate(v=[0,-98,4.5])
cube(size=[200,4,5], center=true);
rotate(a=[0,0,270])
translate(v=[0,-98,4.5])
cube(size=[200,4,5], center=true);
}
union() {
// lug holes
for (i=mirror4XY(midpoint=[0,0,0], offsetX=50, offsetY=50)) {
for (j=mirror4XY(midpoint=i, offsetX=40, offsetY=40)) {
translate(v=j)
cube(size=[10+0.3,10+0.3,140], center=true);
}
}
// decorative perforations
for (i=mirror4XY(midpoint=[0,0,0], offsetX=50, offsetY=50)) {
translate(v=i)
minkowski() {
cube(size=[30,30,50], center=true);
cylinder(r=20, h=10);
}
}
}
}
}
base();

View File

@ -1,132 +0,0 @@
include <./common.scad>
include <./rack/screws.scad>
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;
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();
}
}
}
// keystone stuff
// a lot of these variables are useless, after a couple of design iterations
keystoneMainBodyWidth = 15.0;
keystoneMainBodyHeight = 16.90;
keystoneMainBodyDepth = 32.90;
heightWithHookBody = 20.2;
heightWithHookCatch = 21.30;
widthWithSideLugs = 15.96;
sideLugWidth = (widthWithSideLugs - keystoneMainBodyWidth) / 2.0;
heightWithBottomLug = 17.5;
frontToHookCatch = 8.35; // not sure about this
frontToBottomLugBack = 8.23;
frontToSideLugFront = 10.63;
module keystoneSlot_N() {
// main keystone body (no hooks or lugs)
cube(size=[keystoneMainBodyWidth, keystoneMainBodyDepth, keystoneMainBodyHeight]);
// slot for top hook
translate(v=[0,frontToHookCatch,0])
cube(size=[keystoneMainBodyWidth, keystoneMainBodyDepth -frontToHookCatch, heightWithHookBody]);
cube(size=[keystoneMainBodyWidth, frontToHookCatch, heightWithHookCatch]);
// slots for side lugs
translate(v=[-sideLugWidth, frontToSideLugFront,0])
cube(size=[widthWithSideLugs, keystoneMainBodyDepth-frontToSideLugFront, keystoneMainBodyHeight]);
// slots for bottom lugs
translate(v=[0,0,-(heightWithBottomLug-keystoneMainBodyHeight)])
cube(size=[keystoneMainBodyWidth, frontToBottomLugBack, keystoneMainBodyHeight]);
}
module keystoneJack_N() {
translate(v=[0,-4,0.5])
intersection() {
translate(v=[-2.5,4,-4])
cube(size=[20,6,28]);
keystoneSlot_N();
}
}
//keystoneJack_N();
module patchPanel_P() {
frontPlate();
for (i = [0:7]) {
translate(v=[(i*20+12.5)-2.5,0,-4.5])
cube(size=[20,6,29]);
}
}
module patchPanel() {
difference() {
patchPanel_P();
for (i = [0:7]) {
translate(v=[i*18 + 12.5,0,-2])
keystoneJack_N();
}
}
}
patchPanel();

View File

@ -1,91 +0,0 @@
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();

View File

@ -1,365 +0,0 @@
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();

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,171 +0,0 @@
/* 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();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,22 +0,0 @@
include <./common.scad>
include <./rack/screws.scad>
include <./rockpro/rockpro.scad>
module screwRiser(innerD, outerD, height) {
difference() {
cylinder(d=outerD, h=height, $fn=64);
cylinder(d=innerD, h=height, $fn=64);
}
}
module rockProScrewMounts() {
for (i=[0:3]) {
p = mountPoints[i];
translate(v=[p[0], p[1], p[2]])
screwRiser(innerD=2.8, outerD=8, height=7);
}
}
//rockProScrewMounts();

File diff suppressed because it is too large Load Diff

View File

@ -1,62 +0,0 @@
/* 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);
}
}

View File

@ -1,113 +1,97 @@
/* Some common screw dimensions and helper functions/modules */
/* Some common screw dimensions */
inf = 400; // basically infinity
include <../helper/math.scad>
include <../helper/common.scad>
/********************************************************************************/
// M3 dimensions
m3HoleRadiusSlack = 0.15;
m3HoleRadiusSlack = 0.4; // higher slack for not-so straight heat set inserts
m3Diameter = 3.0;
m3Radius = m3Diameter/2.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);
}
m3HeatSetInsertSlotRadiusSlack = -0.1;
m3HeatSetInsertSlotHeightSlack = 0.5;
m3HeatSetInsertSlotRadius = 2.5;
m3HeatSetInsertSlotHeight = 6;
// TODO: remove test
*difference() {
cube(size=[8,12,5], center=true);
rotate(a=[0,0,20])
m3HexNutPocketNegative();
}
*m3HexNutPocketNegative();
m3HeatSetInsertSlotRadiusSlacked = m3HeatSetInsertSlotRadius+m3HeatSetInsertSlotRadiusSlack;
m3HeatSetInsertSlotHeightSlacked = m3HeatSetInsertSlotHeight+m3HeatSetInsertSlotHeightSlack;
/********************************************************************************/
// M4 dimensions
m4HoleRadiusSlack = 0.15;
m4Diameter = 4.0;
m4Radius = m4Diameter/2.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));
module heatSetInsertSlot_N(screwType) {
if (screwType == "m3") {
union() {
// actual slot for insert
cylinder(h = m3HeatSetInsertSlotHeightSlacked, r = m3HeatSetInsertSlotRadiusSlacked);
// Convert a regular hexagon widthAcrossCorners to widthAcrossFlats
function GtoF(widthAcrossCorners) = widthAcrossCorners * (sqrt(3)/2);
// extra space above slot to help with insertion
translate(v=[0, 0, m3HeatSetInsertSlotHeightSlacked])
cylinder(h = inf50, r = 1.3*m3HeatSetInsertSlotRadiusSlacked);
}
} else {
error("Unsupported screw type");
}
}
function screwRadiusSlacked(screwType) =
(screwType == "m3")
? m3RadiusSlacked
: (screwType == "m4")
? m4RadiusSlacked
: error("Unsupported screw type");
module hexNutPocketNegative(
innerRadius,
widthAcrossCorners,
thickness)
{
module hexNutPocket_N(screwType) {
if (screwType == "m3") {
hexNutPocketHelper_N(m3RadiusSlacked, m3HexNutWidthAcrossCorners / 2 + 0.1, m3HexNutThickness + 0.2);
} else if (screwType == "m4") {
hexNutPocketHelper_N(m4RadiusSlacked, m4HexNutWidthAcrossCorners / 2 + 0.1, m4HexNutThickness + 0.2);
} else {
error("Unsupported screw type");
}
}
module hexNutPocketHelper_N(innerRadius, widthAcrossCorners, thickness) {
union() {
hull() {
// hexagonal cylinder representing where the nut should fit
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
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);
translate(v = [inf50, 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);
translate(v = [0, 0, - 10])
cylinder(r = innerRadius, h = inf50, $fn = 32);
hull() {
translate(v=[inf,0,0])
cylinder(r=innerRadius, h = inf, $fn=32);
cylinder(r=innerRadius, h = inf, $fn=32);
translate(v = [inf50, 0, 0])
cylinder(r = innerRadius, h = inf50, $fn = 32);
cylinder(r = innerRadius, h = inf50, $fn = 32);
}
}
}
// 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);

File diff suppressed because it is too large Load Diff

111
rack/stackConnector.scad Normal file
View File

@ -0,0 +1,111 @@
include <../helper/math.scad>
include <../misc/magnet.scad>
include <../helper/common.scad>
connectorTaperStartHeight = 2;
connectorRectWidth = 10;
connectorRectDepth = 10;
connectorTotalHeight = 5;
connectorRectPlugSlack = -0.1;
connectorRectSocketSlack = 0.1;
connectorSocketMagnetExtrudeHeight = 1;
module stackConnectorBase(rectSlack) {
_wSlacked = connectorRectWidth + rectSlack;
_dSlacked = connectorRectDepth + rectSlack;
module connRect() {
linear_extrude(height=eps)
square(size = [_wSlacked, _dSlacked]);
}
module connMagnetMount() {
linear_extrude(height=eps)
circle(r=magnetRSlacked);
}
hull() {
connRect();
translate(v=[0,0,connectorTaperStartHeight])
connRect();
}
hull() {
translate(v = [0, 0, connectorTaperStartHeight])
connRect();
translate(v=[_wSlacked/2, _dSlacked/2, connectorTotalHeight])
connMagnetMount();
}
}
module stackConnectorPlug() {
assert(magnetHSlacked > connectorSocketMagnetExtrudeHeight);
_wSlacked = connectorRectWidth + connectorRectPlugSlack;
_dSlacked = connectorRectDepth + connectorRectPlugSlack;
magnetLevelHeight = connectorTotalHeight - (magnetHSlacked - connectorSocketMagnetExtrudeHeight);
difference() {
intersection() {
stackConnectorBase(connectorRectPlugSlack);
cube(size=[_dSlacked, _wSlacked, magnetLevelHeight]);
}
translate(v = [_wSlacked/2, _dSlacked/2, magnetLevelHeight - magnetHSlacked])
cylinder(r = magnetRSlacked, h = magnetHSlacked);
}
}
module stackConnectorSocket_N() {
_wSlacked = connectorRectWidth + connectorRectSocketSlack;
_dSlacked = connectorRectDepth + connectorRectSocketSlack;
_bevelSlack = 0.5;
_bevelR = _wSlacked + _bevelSlack;
_bevelW = _dSlacked + _bevelSlack;
_bevelH = 0.5;
stackConnectorBase(connectorRectSocketSlack);
translate(v=[_wSlacked/2, _wSlacked/2, connectorTotalHeight - connectorSocketMagnetExtrudeHeight])
cylinder(r=magnetRSlacked, h=magnetHSlacked);
// bevel at the lip of the socket to guide the plug, as well as mitigate elephant foot during 3d printing
hull() {
translate(v=[0,0,_bevelH])
linear_extrude(height=eps)
square(size = [_wSlacked, _dSlacked]);
translate(v=[-_bevelSlack/2, -_bevelSlack/2, 0])
linear_extrude(height=eps)
square(size = [_bevelR, _bevelW]);
}
}
module test() {
difference() {
union() {
translate(v = [-2.5, -2.5, 0])
cube(size = [15, 15, 10]);
translate(v = [0, 0, 10])
stackConnectorPlug();
}
stackConnectorSocket_N();
}
}
*test();

34
rack/xBar.scad Normal file
View File

@ -0,0 +1,34 @@
include <../helper/sphericalFilet.scad>
include <../helper/cylindricalFilet.scad>
include <./config.scad>
include <./screws.scad>
xBarDepth = 180;
xBarWidth = 32;
xBarHeight = 15;
xBarWallThickness = 3;
xBarRoundness = 5;
module xBar() {
module positive() {
mirror(v=[0,1,0])
rotate(a=[0,0,-90])
difference() {
cylindricalFiletEdge(xBarWidth, xBarDepth, xBarHeight, xBarRoundness);
translate(v = [xBarWallThickness, xBarWallThickness, xBarWallThickness])
cylindricalFiletEdge(xBarWidth, xBarDepth - 2*xBarWallThickness, xBarHeight, xBarRoundness);
}
}
module xBar() {
positive();
}
xBar();
}
//xBar();

114
rack/yBar.scad Normal file
View File

@ -0,0 +1,114 @@
include <../helper/math.scad>
include <../misc/magnet.scad>
include <../helper/sphericalFilet.scad>
include <../helper/cylindricalFilet.scad>
include <./config.scad>
include <./screws.scad>
include <./mainRail.scad>
include <./stackConnector.scad>
// TODO clean up
// TODO: How do I nicely explain this?
railSlotSpacing = 3;
sideSpacing = 12;
yBarDepth = maxUnitDepth + 2*railSlotSpacing;
yBarWidth = railSlotSpacing + railTotalWidth + sideSpacing;
yBarHeight = 15;
yBarWallThickness = 3;
yBarRoundness = 5;
echo("Bar total depth: ", yBarDepth);
echo("Bar total width: ", yBarWidth);
module yBar() {
module positive() {
difference() {
sphericalFiletEdge(yBarWidth, yBarDepth, yBarHeight, yBarRoundness);
translate(v = [yBarWallThickness, 32, yBarWallThickness])
cylindricalFiletEdge(yBarWidth, yBarDepth-32*2, yBarHeight, yBarRoundness);
}
}
// TODO move this to custom file
// negatives on the y-z plane to be imprinted on the side of the main
module frontBarConnector_N() {
y1 = 6;
y2 = 27;
z = 6;
translate(v = [-m3HeatSetInsertSlotHeightSlacked, y1, z])
rotate(a = [0, 90, 0])
heatSetInsertSlot_N(rackFrameScrewType);
translate(v = [-m3HeatSetInsertSlotHeightSlacked, y2, z])
rotate(a = [0, 90, 0])
heatSetInsertSlot_N(rackFrameScrewType);
// TODO fix this up, no center=true
translate(v = [-1, y1+(y2-y1)/2, 0])
rotate(a = [0, 45, 0])
cube(size = [3, 10, 6], center = true);
}
// TODO move this in custom file, like for railFeetSlot_N
module sideWallConnector_N() {
lugW = 7;
lugD = 20;
lugH = 2;
insertDw = lugW/2;
insertDd = lugD-4;
translate(v = [0, 0, -lugH])
cube(size = [lugW, lugD, lugH]);
translate(v = [insertDw, insertDd, -(m3HeatSetInsertSlotHeightSlacked+lugH)])
heatSetInsertSlot_N(rackFrameScrewType);
}
module singleCornerNoStackConnector_N() {
union() {
translate(v = [5, 5, 0])
stackConnectorSocket_N();
translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing), railSlotSpacing, yBarHeight-railFootThickness])
railFeetSlot_N();
translate(v = [yBarWidth+eps, 0, 0])
frontBarConnector_N();
translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing)-9, railSlotSpacing, yBarHeight])
sideWallConnector_N();
}
}
module sideBar() {
module mirrorOtherCorner() {
children(0);
translate(v = [0, yBarDepth, 0])
mirror(v = [0, 1, 0]) {
children(0);
}
}
difference() {
positive();
mirrorOtherCorner()
singleCornerNoStackConnector_N();
}
}
sideBar();
}