update stack connector

This commit is contained in:
zhao
2023-03-18 17:34:41 -04:00
parent bccf606ae7
commit 4fc9786639
3 changed files with 54 additions and 48 deletions

View File

@ -4,13 +4,15 @@ include <../misc/magnet.scad>
connectorRectWidth = 10;
connectorRectDepth = 10;
connectorTotalHeight = 5;
connectorTotalHeight = 10;
connectorSocketMagnetExtrudeHeight = 1;
connectorTaperStartHeight = 2;
connectorTaperStartHeight = 3;
connectorRectPlugSlack = -0.1;
connectorRectSocketSlack = 0.1;
connectorBottomToScrew = 6;
module stackConnectorBase(rectSlack) {
wSlacked = connectorRectWidth + rectSlack;
@ -21,9 +23,9 @@ module stackConnectorBase(rectSlack) {
square(size = [wSlacked, dSlacked]);
}
module connMagnetMount() {
module connTop() {
linear_extrude(height=eps)
circle(r=magnetRSlacked);
circle(r=3);
}
hull() {
@ -38,54 +40,51 @@ module stackConnectorBase(rectSlack) {
connRect();
translate(v=[wSlacked/2, dSlacked/2, connectorTotalHeight])
connMagnetMount();
connTop();
}
}
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;
bevelSlack = 0.6;
bevelR = wSlacked + bevelSlack;
bevelW = dSlacked + bevelSlack;
bevelH = 0.5;
bevelH = 0.6;
stackConnectorBase(connectorRectSocketSlack);
screwExtension = 4;
translate(v=[wSlacked/2, wSlacked/2, connectorTotalHeight - connectorSocketMagnetExtrudeHeight])
cylinder(r=magnetRSlacked, h=magnetHSlacked);
union() {
stackConnectorBase(connectorRectSocketSlack);
// 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 = [-screwExtension, connectorRectDepth/2, connectorBottomToScrew])
rotate(a = [0, -90, 0])
counterSunkHead_N(rackFrameScrewType, screwExtension = 5, headExtension = 10);
translate(v=[-bevelSlack/2, -bevelSlack/2, 0])
linear_extrude(height=eps)
square(size = [bevelR, bevelW]);
// 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 stackConnectorPlug() {
difference() {
stackConnectorBase(connectorRectPlugSlack);
translate(v=[connectorRectWidth/2,connectorRectDepth/2,connectorBottomToScrew])
rotate(a=[0,0,90])
rotate(a=[90,0,0])
hexNutPocket_N(rackFrameScrewType, openSide=false);
}
}

View File

@ -13,7 +13,12 @@ include <./yBarBasePlateConnector.scad>
include <./side/yBarSideWallConnector.scad>
include <./sharedVariables.scad>
*yBar();
yBar();
translate(v=[20,0,0])
*stackConnectorPlug();
*stackConnectorSocket_N();
module yBar() {