This commit is contained in:
zhao
2023-02-25 13:19:27 -08:00
parent 97a5783d0d
commit 8d3f205f6d
11 changed files with 174 additions and 75 deletions

View File

@ -15,7 +15,7 @@ echo("Profile:", profile);
function getConfig(name) = getConfigValue(profile, name);
// Maximum width for rackmount units. Change this according your max expected enclosure width.
// Maximum width for rack-mount units. Change this according your max expected enclosure width.
// Changing this will directly affect the required build volume.
maxUnitWidth = getConfig("maxUnitWidth");

View File

@ -6,44 +6,35 @@ include <./sharedVariables.scad>
*mainRail();
echo("Total Rail Height: ", railTotalHeight);
// Also known as the z-bar :)
module mainRail() {
mainRail();
module mainRail() {
b = 0.75; // bevel value
intersection() {
mainRailSharp();
halfspace(vpos=[1,1,0], p=[b,b,0]);
halfspace(vpos=[1,0,1], p=[b,0,b]);
halfspace(vpos=[1,0,-1], p=[b,0,railTotalHeight-b]);
}
}
module mainRailSharp() {
union() {
_frontRailSegment();
frontRailSegment();
translate(v = [railSideMountThickness, railFrontThickness, 0])
rotate(a = [0, 0, 90])
_sideSupportSegment();
sideSupportSegment();
translate(v = [0, railFrontThickness, 0]) {
translate(v = [railSideMountThickness, 0, 0])
_railFeet();
railFeet();
translate(v = [railSideMountThickness, 0, railTotalHeight-railFootThickness])
_railFeet();
railFeet();
}
}
}
module _frontRailSegment() {
module frontRailSegment() {
difference() {
cube(size = [frontFaceWidth, railFrontThickness, railTotalHeight]);
@ -55,7 +46,7 @@ module mainRail() {
}
}
module _sideSupportSegment() {
module sideSupportSegment() {
difference() {
cube(size = [sideSupportDepth, railSideMountThickness, railTotalHeight]);
@ -67,7 +58,7 @@ module mainRail() {
}
}
module _railFeet() {
module railFeet() {
difference() {
cube(size = [frontFaceWidth - railSideMountThickness, sideSupportDepth, railFootThickness]);

View File

@ -2,25 +2,23 @@ include <../helper/math.scad>
include <../helper/common.scad>
include <../misc/magnet.scad>
connectorTaperStartHeight = 2;
connectorRectWidth = 10;
connectorRectDepth = 10;
connectorTotalHeight = 5;
connectorSocketMagnetExtrudeHeight = 1;
connectorTaperStartHeight = 2;
connectorRectPlugSlack = -0.1;
connectorRectSocketSlack = 0.1;
connectorSocketMagnetExtrudeHeight = 1;
module stackConnectorBase(rectSlack) {
_wSlacked = connectorRectWidth + rectSlack;
_dSlacked = connectorRectDepth + rectSlack;
wSlacked = connectorRectWidth + rectSlack;
dSlacked = connectorRectDepth + rectSlack;
module connRect() {
linear_extrude(height=eps)
square(size = [_wSlacked, _dSlacked]);
square(size = [wSlacked, dSlacked]);
}
module connMagnetMount() {
@ -39,7 +37,7 @@ module stackConnectorBase(rectSlack) {
translate(v = [0, 0, connectorTaperStartHeight])
connRect();
translate(v=[_wSlacked/2, _dSlacked/2, connectorTotalHeight])
translate(v=[wSlacked/2, dSlacked/2, connectorTotalHeight])
connMagnetMount();
}
}
@ -47,8 +45,8 @@ module stackConnectorBase(rectSlack) {
module stackConnectorPlug() {
assert(magnetHSlacked > connectorSocketMagnetExtrudeHeight);
_wSlacked = connectorRectWidth + connectorRectPlugSlack;
_dSlacked = connectorRectDepth + connectorRectPlugSlack;
wSlacked = connectorRectWidth + connectorRectPlugSlack;
dSlacked = connectorRectDepth + connectorRectPlugSlack;
magnetLevelHeight = connectorTotalHeight - (magnetHSlacked - connectorSocketMagnetExtrudeHeight);
@ -56,10 +54,10 @@ module stackConnectorPlug() {
intersection() {
stackConnectorBase(connectorRectPlugSlack);
cube(size=[_dSlacked, _wSlacked, magnetLevelHeight]);
cube(size=[dSlacked, wSlacked, magnetLevelHeight]);
}
translate(v = [_wSlacked/2, _dSlacked/2, magnetLevelHeight - magnetHSlacked])
translate(v = [wSlacked/2, dSlacked/2, magnetLevelHeight - magnetHSlacked])
cylinder(r = magnetRSlacked, h = magnetHSlacked);
}
@ -67,45 +65,27 @@ module stackConnectorPlug() {
module stackConnectorSocket_N() {
_wSlacked = connectorRectWidth + connectorRectSocketSlack;
_dSlacked = connectorRectDepth + connectorRectSocketSlack;
_bevelSlack = 0.5;
_bevelR = _wSlacked + _bevelSlack;
_bevelW = _dSlacked + _bevelSlack;
_bevelH = 0.5;
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])
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])
translate(v=[0,0,bevelH])
linear_extrude(height=eps)
square(size = [_wSlacked, _dSlacked]);
square(size = [wSlacked, dSlacked]);
translate(v=[-_bevelSlack/2, -_bevelSlack/2, 0])
translate(v=[-bevelSlack/2, -bevelSlack/2, 0])
linear_extrude(height=eps)
square(size = [_bevelR, _bevelW]);
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();

View File

@ -13,11 +13,6 @@ include <./yBarBasePlateConnector.scad>
include <./side/yBarSideWallConnector.scad>
include <./sharedVariables.scad>
echo("Bar total depth: ", yBarDepth);
echo("Bar total width: ", yBarWidth);
echo("Bar total height: ", yBarHeight);
*yBar();
module yBar() {
@ -71,7 +66,11 @@ module yBar() {
module applySideWallConnector() {
apply_n() {
mirrorOtherCorner()
translate(v = [yBarWidth-(railTotalWidth+railSlotToInnerYEdge+railSlotToSideWallSlot+sideWallConnectorSlotWidth), sideWallSlotToXZ, yBarHeight])
translate(v = [
yBarWidth-(railTotalWidth+railSlotToInnerYEdge+railSlotToSideWallSlot+sideWallConnectorSlotWidth),
sideWallSlotToXZ,
yBarHeight
])
yBarSideWallConnector_N();
children(0);