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

@ -15,7 +15,7 @@ m3CounterSunkHeadLength = 1.7;
m3HexNutWidthAcrossFlats = 5.41; m3HexNutWidthAcrossFlats = 5.41;
m3HexNutWidthAcrossCorners = FtoG(m3HexNutWidthAcrossFlats); m3HexNutWidthAcrossCorners = FtoG(m3HexNutWidthAcrossFlats);
m3HexNutThickness = 2.18; m3HexNutThickness = 2.2;
m3HeatSetInsertSlotRadiusSlack = -0.1; m3HeatSetInsertSlotRadiusSlack = -0.1;
m3HeatSetInsertSlotHeightSlack = 0.5; m3HeatSetInsertSlotHeightSlack = 0.5;
@ -80,17 +80,17 @@ module counterSunkHead_N(screwType, screwExtension=0, headExtension=0) {
} }
module hexNutPocket_N(screwType) { module hexNutPocket_N(screwType, openSide=true) {
if (screwType == "m3") { if (screwType == "m3") {
hexNutPocketHelper_N(m3RadiusSlacked, m3HexNutWidthAcrossCorners / 2 + 0.1, m3HexNutThickness + 0.2); hexNutPocketHelper_N(m3RadiusSlacked, m3HexNutWidthAcrossCorners / 2 + 0.1, m3HexNutThickness + 0.2, openSide=openSide);
} else if (screwType == "m4") { } else if (screwType == "m4") {
hexNutPocketHelper_N(m4RadiusSlacked, m4HexNutWidthAcrossCorners / 2 + 0.1, m4HexNutThickness + 0.2); hexNutPocketHelper_N(m4RadiusSlacked, m4HexNutWidthAcrossCorners / 2 + 0.1, m4HexNutThickness + 0.2, openSide=openSide);
} else { } else {
error("Unsupported screw type"); error("Unsupported screw type");
} }
} }
module hexNutPocketHelper_N(innerRadius, widthAcrossCorners, thickness) { module hexNutPocketHelper_N(innerRadius, widthAcrossCorners, thickness, openSide=true) {
union() { union() {
hull() { hull() {
// hexagonal cylinder representing where the nut should fit // hexagonal cylinder representing where the nut should fit
@ -105,10 +105,12 @@ module hexNutPocketHelper_N(innerRadius, widthAcrossCorners, thickness) {
translate(v = [0, 0, - 10]) translate(v = [0, 0, - 10])
cylinder(r = innerRadius, h = inf50, $fn = 32); cylinder(r = innerRadius, h = inf50, $fn = 32);
hull() { if (openSide) {
translate(v = [inf50, 0, 0]) hull() {
cylinder(r = innerRadius, h = inf50, $fn = 32); translate(v = [inf50, 0, 0])
cylinder(r = innerRadius, h = inf50, $fn = 32); cylinder(r = innerRadius, h = inf50, $fn = 32);
cylinder(r = innerRadius, h = inf50, $fn = 32);
}
} }
} }
} }

View File

@ -4,13 +4,15 @@ include <../misc/magnet.scad>
connectorRectWidth = 10; connectorRectWidth = 10;
connectorRectDepth = 10; connectorRectDepth = 10;
connectorTotalHeight = 5; connectorTotalHeight = 10;
connectorSocketMagnetExtrudeHeight = 1; connectorSocketMagnetExtrudeHeight = 1;
connectorTaperStartHeight = 2; connectorTaperStartHeight = 3;
connectorRectPlugSlack = -0.1; connectorRectPlugSlack = -0.1;
connectorRectSocketSlack = 0.1; connectorRectSocketSlack = 0.1;
connectorBottomToScrew = 6;
module stackConnectorBase(rectSlack) { module stackConnectorBase(rectSlack) {
wSlacked = connectorRectWidth + rectSlack; wSlacked = connectorRectWidth + rectSlack;
@ -21,9 +23,9 @@ module stackConnectorBase(rectSlack) {
square(size = [wSlacked, dSlacked]); square(size = [wSlacked, dSlacked]);
} }
module connMagnetMount() { module connTop() {
linear_extrude(height=eps) linear_extrude(height=eps)
circle(r=magnetRSlacked); circle(r=3);
} }
hull() { hull() {
@ -38,54 +40,51 @@ module stackConnectorBase(rectSlack) {
connRect(); connRect();
translate(v=[wSlacked/2, dSlacked/2, connectorTotalHeight]) 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() { module stackConnectorSocket_N() {
wSlacked = connectorRectWidth + connectorRectSocketSlack; wSlacked = connectorRectWidth + connectorRectSocketSlack;
dSlacked = connectorRectDepth + connectorRectSocketSlack; dSlacked = connectorRectDepth + connectorRectSocketSlack;
bevelSlack = 0.5; bevelSlack = 0.6;
bevelR = wSlacked + bevelSlack; bevelR = wSlacked + bevelSlack;
bevelW = dSlacked + bevelSlack; bevelW = dSlacked + bevelSlack;
bevelH = 0.5; bevelH = 0.6;
stackConnectorBase(connectorRectSocketSlack); screwExtension = 4;
translate(v=[wSlacked/2, wSlacked/2, connectorTotalHeight - connectorSocketMagnetExtrudeHeight]) union() {
cylinder(r=magnetRSlacked, h=magnetHSlacked); stackConnectorBase(connectorRectSocketSlack);
// bevel at the lip of the socket to guide the plug, as well as mitigate elephant foot during 3d printing translate(v = [-screwExtension, connectorRectDepth/2, connectorBottomToScrew])
hull() { rotate(a = [0, -90, 0])
translate(v=[0,0,bevelH]) counterSunkHead_N(rackFrameScrewType, screwExtension = 5, headExtension = 10);
linear_extrude(height=eps)
square(size = [wSlacked, dSlacked]);
translate(v=[-bevelSlack/2, -bevelSlack/2, 0]) // bevel at the lip of the socket to guide the plug, as well as mitigate elephant foot during 3d printing
linear_extrude(height=eps) hull() {
square(size = [bevelR, bevelW]); 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 <./side/yBarSideWallConnector.scad>
include <./sharedVariables.scad> include <./sharedVariables.scad>
*yBar(); yBar();
translate(v=[20,0,0])
*stackConnectorPlug();
*stackConnectorSocket_N();
module yBar() { module yBar() {