wip for dovetail join for x-y bar

This commit is contained in:
zhao
2023-03-22 00:40:25 -04:00
parent bfe262affc
commit 1b9ecd514e
6 changed files with 103 additions and 56 deletions

61
helper/dovetail.scad Normal file
View File

@ -0,0 +1,61 @@
include <./common.scad>
// centered on z axis
module dovetail(
topWidth,
bottomWidth,
height,
length,
headExtension=0,
baseExtension=0,
frontFaceLength = 0,
frontFaceScale = 0,
backFaceLength = 0,
backFaceScale = 0,
) {
translate(v=[0,0,frontFaceLength])
linear_extrude(length-(frontFaceLength+backFaceLength))
dovetailFace(topWidth,bottomWidth,height,headExtension,baseExtension);
translate(v=[0,0,frontFaceLength])
mirror(v=[0,0,1])
linear_extrude(frontFaceLength, scale=[frontFaceScale, frontFaceScale])
dovetailFace(topWidth,bottomWidth,height,headExtension,baseExtension);
translate(v=[0,0,length-backFaceLength])
linear_extrude(backFaceLength, scale=[backFaceScale,1])
dovetailFace(topWidth,bottomWidth,height,headExtension,baseExtension);
module dovetailFace(topWidth, bottomWidth, height, headExtension, baseExtension) {
union() {
// base
polygon(points =
[[-bottomWidth/2, 0],
[-topWidth/2, height],
[topWidth/2, height],
[bottomWidth/2, 0]]
);
polygon(points =
[[-bottomWidth/2, -baseExtension],
[-bottomWidth/2,0 ],
[bottomWidth/2, 0],
[bottomWidth/2, -baseExtension]]
);
translate(v=[0,height])
polygon(points =
[[-topWidth/2, headExtension],
[-topWidth/2,0 ],
[topWidth/2, 0],
[topWidth/2, headExtension]]
);
}
}
}

View File

@ -24,6 +24,7 @@ module mirror4XY(p, dx, dy) {
children(0);
}
// TODO: rename to simple align
module align(a,b) {
rot_axis = cross(a,b);

View File

@ -1,5 +1,11 @@
include <../yBar.scad>
include <../xBar.scad>
// Oriented for 3d printing.
// Supports required at XY wall connections, and depending on roundness
yBar();
translate(v=[140,0,0])
rotate(a=[0,0,90])
xBar();

View File

@ -12,6 +12,7 @@ xBarY = 32;
xBarHeight = 15;
xBarWallThickness = 2;
xBarSideThickness = 6;
xBarRoundness = baseRoundness;
*xBar();
@ -27,8 +28,8 @@ module xBar() {
difference() {
cylindricalFiletEdge(xBarY, xBarX, xBarHeight, xBarRoundness);
translate(v = [xBarWallThickness, xBarWallThickness, xBarWallThickness])
cylindricalFiletEdge(xBarY, xBarX-2*xBarWallThickness, xBarHeight, xBarRoundness);
translate(v = [xBarWallThickness, xBarSideThickness, xBarWallThickness])
cylindricalFiletEdge(xBarY, xBarX-2*xBarSideThickness, xBarHeight, xBarRoundness);
}
// Shave off bottom corners to reduce elephant's foot at where xBar and YBar join
@ -47,11 +48,7 @@ module xBar() {
}
module applyYBarConnector() {
apply_pn() {
mirrorOtherCorner()
rotate(a=[0,0,-90])
yBarConnectorFromXLug();
apply_n() {
mirrorOtherCorner()
rotate(a=[0,0,-90])

View File

@ -1,61 +1,43 @@
include <../helper/screws.scad>
include <../helper/dovetail.scad>
include <../helper/halfspace.scad>
include <./config.scad>
//xBarConnectorFromY_N();
module xBarConnectorFromY_N() {
y1 = 6;
y2 = 27;
y = 27;
z = 6;
slack = 0.4;
translate(v = [-m3HeatSetInsertSlotHeightSlacked, y1, z])
translate(v = [-m3HeatSetInsertSlotHeightSlacked, y, 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
// TODO need to add slack values
translate(v = [-1, y1+(y2-y1)/2, 0])
rotate(a = [0, 45, 0])
cube(size = [3+slack, 10+slack, 6+slack], center = true);
module xBarConnectorFromY_P() {
rotate(a=[0,0,-90])
dovetail(topWidth = 15, bottomWidth = 12, height = 2, length = yBarHeight, headExtension = 1, baseExtension = 2, frontFaceLength = 0.5,
frontFaceScale = 0.90,
backFaceLength = 5,
backFaceScale = 1.2);
}
module yBarConnectorFromX_N() {
y1 = 6;
y2 = 27;
y = 27;
z = 6;
slack = 0.2;
slack = 0.3;
translate(v = [-inf50/2, y1, z])
rotate(a = [0, 90, 0])
cylinder(r = screwRadiusSlacked(rackFrameScrewType), h = inf50, $fn = 32);
translate(v = [-inf50/2, y2, z])
translate(v=[-0.5,14,0])
mirror(v=[1,0,0])
rotate(a=[0,0,-90])
dovetail(topWidth = 15+slack, bottomWidth = 12+slack, height = 2+slack, length = yBarHeight, headExtension = 1, baseExtension = 2, frontFaceLength = 0.5,
frontFaceScale = 1.1,
backFaceLength = 5,
backFaceScale = 1.2);
translate(v = [-inf50/2, y, z])
rotate(a = [0, 90, 0])
cylinder(r = screwRadiusSlacked(rackFrameScrewType), h = inf50, $fn = 32);
}
// TODO: figure out nice abstraction to apply both positive and negative mods
module yBarConnectorFromXLug() {
y1 = 6;
y2 = 27;
z = 6;
slack = 0.2;
intersection() {
// TODO fix this up, no center=true
translate(v = [-1, y1+(y2-y1)/2, 0])
rotate(a = [0, 45, 0])
scale(v=[0.90,0.95,0.90])
cube(size = [3-slack, 10-slack, 6-slack], center = true);
halfspace(vpos=[0,0,1], p=[0,0,0]);
halfspace(vpos=[1,0,0], p=[-2,0,0]);
}
}

View File

@ -15,11 +15,6 @@ include <./sharedVariables.scad>
*yBar();
translate(v=[20,0,0])
*stackConnectorPlug();
*stackConnectorSocket_N();
module yBar() {
applyBasePlateConnector()
@ -93,7 +88,12 @@ module yBar() {
}
module applyXBarConnector() {
apply_n() {
apply_pn() {
mirrorOtherCorner()
translate(v=[yBarWidth + 0.5,14,0])
xBarConnectorFromY_P();
mirrorOtherCorner()
translate(v = [yBarWidth+eps, 0, 0])
xBarConnectorFromY_N();