add to xBar, also refactor
This commit is contained in:
@ -5,10 +5,7 @@ include <./common.scad>
|
|||||||
|
|
||||||
module halfspace(vpos, p) {
|
module halfspace(vpos, p) {
|
||||||
translate(p)
|
translate(p)
|
||||||
align(a=[0,0,1], b=vpos)
|
align(a=[0,0,-1], b=vpos)
|
||||||
translate(v=[0,0,-inf/2])
|
translate(v=[0,0,-inf/2])
|
||||||
cube(size=[inf, inf, inf], center=true);
|
cube(size=[inf, inf, inf], center=true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
halfspace(vpos=[1,1,1], p=[10,10,10]);
|
|
||||||
@ -13,9 +13,20 @@ function mirror4XY(midpoint, offsetX, offsetY) =
|
|||||||
|
|
||||||
|
|
||||||
module align(a,b) {
|
module align(a,b) {
|
||||||
|
|
||||||
|
echo("a", a);
|
||||||
|
echo("b", b);
|
||||||
rot_axis = cross(a,b);
|
rot_axis = cross(a,b);
|
||||||
angle = acos(a*b/ (norm(a)*norm(b)));
|
|
||||||
|
if (rot_axis == 0) {
|
||||||
|
error("Can't align - provided vectors are parallel");
|
||||||
|
}
|
||||||
|
|
||||||
|
echo("rot_axis", rot_axis);
|
||||||
|
|
||||||
|
angle = acos(a*b/(norm(a)*norm(b)));
|
||||||
|
echo("angle", angle)
|
||||||
|
|
||||||
rotate(v=rot_axis, a=angle)
|
rotate(v=rot_axis, a=angle)
|
||||||
children(0);
|
children(0);
|
||||||
}
|
}
|
||||||
@ -32,3 +32,6 @@ mainRailSideMountScrewType = "m4";
|
|||||||
rackFrameScrewType = "m3";
|
rackFrameScrewType = "m3";
|
||||||
// Currently, only m3 screws are supported here (tolerance issues)
|
// Currently, only m3 screws are supported here (tolerance issues)
|
||||||
assert(rackFrameScrewType == "m3");
|
assert(rackFrameScrewType == "m3");
|
||||||
|
|
||||||
|
// Fillet radius
|
||||||
|
baseRoundness = 5;
|
||||||
@ -1,4 +1,6 @@
|
|||||||
// Config file for derived variables. These variables are calculated from profile variables and are used by
|
// Config file for derived variables. These variables are calculated from profile variables and are used by
|
||||||
// multiple components.
|
// multiple components.
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
include <./config.scad>
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
include <./config.scad>
|
include <./config.scad>
|
||||||
include <../helper/screws.scad>
|
include <../helper/screws.scad>
|
||||||
include <../helper/math.scad>
|
include <../helper/math.scad>
|
||||||
|
include <../helper/halfspace.scad>
|
||||||
|
|
||||||
/* Small horizontal planes at the top and bottom of the main rails. Used so we can fasten the rail to the frame
|
/* 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 */
|
Note that this value is also used for a depression at the bottom/top of the frame for aligning the rail */
|
||||||
@ -29,25 +30,43 @@ frontFaceWidth = railScrewHoleToInnerEdge + railScrewHoleToOuterEdge;
|
|||||||
railTotalWidth = frontFaceWidth;
|
railTotalWidth = frontFaceWidth;
|
||||||
railTotalDepth = railFrontThickness+sideSupportDepth;
|
railTotalDepth = railFrontThickness+sideSupportDepth;
|
||||||
|
|
||||||
|
*mainRail();
|
||||||
|
|
||||||
echo("Total Rail Height: ", railTotalHeight);
|
echo("Total Rail Height: ", railTotalHeight);
|
||||||
|
|
||||||
// Also known as the z-bar :)
|
// Also known as the z-bar :)
|
||||||
module mainRail() {
|
module mainRail() {
|
||||||
|
|
||||||
union() {
|
mainRail();
|
||||||
_frontRailSegment();
|
|
||||||
|
|
||||||
translate(v = [railSideMountThickness, railFrontThickness, 0])
|
module mainRail() {
|
||||||
rotate(a = [0, 0, 90])
|
b = 0.75; // bevel value
|
||||||
_sideSupportSegment();
|
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]);
|
||||||
|
|
||||||
translate(v = [0, railFrontThickness, 0]) {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
translate(v=[railSideMountThickness,0,0])
|
|
||||||
_railFeet();
|
|
||||||
|
|
||||||
translate(v = [railSideMountThickness, 0, railTotalHeight - railFootThickness])
|
module mainRailSharp() {
|
||||||
_railFeet();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,13 +2,24 @@ include <../helper/sphericalFilet.scad>
|
|||||||
include <../helper/cylindricalFilet.scad>
|
include <../helper/cylindricalFilet.scad>
|
||||||
include <../helper/screws.scad>
|
include <../helper/screws.scad>
|
||||||
include <./config.scad>
|
include <./config.scad>
|
||||||
|
include <./derivedConfig.scad>
|
||||||
|
include <./xyBarConnector.scad>
|
||||||
|
include <./xBarBasePlateConnector.scad>
|
||||||
|
|
||||||
|
|
||||||
|
// Temporary
|
||||||
|
include <./yBar.scad>
|
||||||
|
include <./mainRail.scad>
|
||||||
|
|
||||||
|
xBarDepth = maxUnitWidth - 2*(railSlotSpacing + railScrewHoleToInnerEdge);
|
||||||
|
|
||||||
xBarDepth = 180;
|
|
||||||
xBarWidth = 32;
|
xBarWidth = 32;
|
||||||
xBarHeight = 15;
|
xBarHeight = 15;
|
||||||
|
|
||||||
xBarWallThickness = 3;
|
xBarWallThickness = 2;
|
||||||
xBarRoundness = 5;
|
xBarRoundness = baseRoundness;
|
||||||
|
|
||||||
|
//echo(xBarDepth);
|
||||||
|
|
||||||
module xBar() {
|
module xBar() {
|
||||||
|
|
||||||
@ -24,11 +35,55 @@ module xBar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module xBar() {
|
module xBar() {
|
||||||
positive();
|
|
||||||
|
module mirrorOtherCorner() {
|
||||||
|
children(0);
|
||||||
|
|
||||||
|
// TODO rename xBarDepth to xBarLength/xBarWidth
|
||||||
|
translate(v = [xBarDepth, 0, 0])
|
||||||
|
mirror(v = [1, 0, 0]) {
|
||||||
|
children(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO refactor - probably better off mirroring the side faces and hulling the shell
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
intersection () {
|
||||||
|
positive();
|
||||||
|
halfspace(vpos = [1, 0, 1], p = [0.5, 0, 0]);
|
||||||
|
|
||||||
|
halfspace(vpos = [-1, 0, 1], p = [xBarDepth-0.5, 0, 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
yBarConnectorFromXLug();
|
||||||
|
|
||||||
|
mirrorOtherCorner()
|
||||||
|
yBarConnectorFromXLug();
|
||||||
|
}
|
||||||
|
|
||||||
|
union() {
|
||||||
|
yBarConnectorFromX_N();
|
||||||
|
|
||||||
|
mirrorOtherCorner()
|
||||||
|
yBarConnectorFromX_N();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO change me?
|
||||||
|
translate(v=[0,xBarWidth,0])
|
||||||
|
basePlateMount();
|
||||||
|
|
||||||
|
translate(v=[xBarDepth,xBarWidth,0])
|
||||||
|
mirror(v=[1,0,0])
|
||||||
|
basePlateMount();
|
||||||
}
|
}
|
||||||
|
|
||||||
xBar();
|
xBar();
|
||||||
}
|
}
|
||||||
|
translate(v=[-30,0,0])
|
||||||
|
*yBar();
|
||||||
|
xBar();
|
||||||
|
|
||||||
|
|
||||||
//xBar();
|
|
||||||
53
rack/xBarBasePlateConnector.scad
Normal file
53
rack/xBarBasePlateConnector.scad
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
include <../helper/common.scad>
|
||||||
|
include <../helper/screws.scad>
|
||||||
|
include <./config.scad>
|
||||||
|
|
||||||
|
module basePlateMount() {
|
||||||
|
|
||||||
|
screwHoleToBase = 6;
|
||||||
|
mountHeight = 10;
|
||||||
|
mountWidth = 10;
|
||||||
|
mountThickness = 2;
|
||||||
|
|
||||||
|
module support() {
|
||||||
|
r = 4;
|
||||||
|
|
||||||
|
difference () {
|
||||||
|
translate(v = [0, mountThickness, r/2])
|
||||||
|
rotate(a = [90, 0, 0])
|
||||||
|
rotate(a = [0, 0, 90])
|
||||||
|
cylinder(h = mountThickness, r = r, $fn = 3);
|
||||||
|
|
||||||
|
cube(size=[inf10, inf10, inf10]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//translate([-r/2, -2,0])
|
||||||
|
//cube(size=[r/2, 0.1, 0.1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
module positive() {
|
||||||
|
cube(size = [mountWidth, mountThickness, mountHeight]);
|
||||||
|
|
||||||
|
translate(v=[mountWidth,0,0])
|
||||||
|
mirror(v=[1,0,0])
|
||||||
|
hull() {
|
||||||
|
support();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module basePlateMount() {
|
||||||
|
translate(v=[0,-mountThickness,0])
|
||||||
|
difference() {
|
||||||
|
positive();
|
||||||
|
|
||||||
|
translate(v = [mountWidth/2, inf50/2, screwHoleToBase])
|
||||||
|
rotate(a = [90, 0, 0])
|
||||||
|
cylinder(h = inf50, r = screwRadiusSlacked(rackFrameScrewType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
basePlateMount();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1,22 +1,54 @@
|
|||||||
include <../helper/screws.scad>
|
include <../helper/screws.scad>
|
||||||
|
include <../helper/halfspace.scad>
|
||||||
include <./config.scad>
|
include <./config.scad>
|
||||||
|
|
||||||
module frontBarConnector_N() {
|
module xBarConnectorFromY_N() {
|
||||||
|
|
||||||
y1 = 6;
|
y1 = 6;
|
||||||
y2 = 27;
|
y2 = 27;
|
||||||
z = 6;
|
z = 6;
|
||||||
|
|
||||||
translate(v = [-m3HeatSetInsertSlotHeightSlacked, y1, z])
|
translate(v = [-m3HeatSetInsertSlotHeightSlacked, y1, z])
|
||||||
rotate(a = [0, 90, 0])
|
rotate(a = [0, 90, 0])
|
||||||
heatSetInsertSlot_N(rackFrameScrewType);
|
heatSetInsertSlot_N(rackFrameScrewType);
|
||||||
|
|
||||||
translate(v = [-m3HeatSetInsertSlotHeightSlacked, y2, z])
|
translate(v = [-m3HeatSetInsertSlotHeightSlacked, y2, z])
|
||||||
rotate(a = [0, 90, 0])
|
rotate(a = [0, 90, 0])
|
||||||
heatSetInsertSlot_N(rackFrameScrewType);
|
heatSetInsertSlot_N(rackFrameScrewType);
|
||||||
|
|
||||||
// TODO fix this up, no center=true
|
// TODO fix this up, no center=true
|
||||||
translate(v = [-1, y1+(y2-y1)/2, 0])
|
translate(v = [-1, y1+(y2-y1)/2, 0])
|
||||||
|
rotate(a = [0, 45, 0])
|
||||||
|
cube(size = [3, 10, 6], center = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module yBarConnectorFromX_N() {
|
||||||
|
y1 = 6;
|
||||||
|
y2 = 27;
|
||||||
|
z = 6;
|
||||||
|
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])
|
||||||
|
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;
|
||||||
|
|
||||||
|
intersection() {
|
||||||
|
// TODO fix this up, no center=true
|
||||||
|
translate(v = [-1, y1+(y2-y1)/2, 0])
|
||||||
rotate(a = [0, 45, 0])
|
rotate(a = [0, 45, 0])
|
||||||
cube(size = [3, 10, 6], center = true);
|
scale(v=[0.90,0.90,0.95])
|
||||||
|
cube(size = [3, 10, 6], center = true);
|
||||||
|
|
||||||
|
mirror(v=[0,0,1])
|
||||||
|
halfspace(vpos=[0,0,1], p=[0,0,0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ yBarWidth = railSlotSpacing + railTotalWidth + sideSpacing;
|
|||||||
yBarHeight = 15;
|
yBarHeight = 15;
|
||||||
|
|
||||||
yBarWallThickness = 3;
|
yBarWallThickness = 3;
|
||||||
yBarRoundness = 5;
|
yBarRoundness = baseRoundness;
|
||||||
|
|
||||||
echo("Bar total depth: ", yBarDepth);
|
echo("Bar total depth: ", yBarDepth);
|
||||||
echo("Bar total width: ", yBarWidth);
|
echo("Bar total width: ", yBarWidth);
|
||||||
@ -48,7 +48,7 @@ module yBar() {
|
|||||||
railFeetSlot_N();
|
railFeetSlot_N();
|
||||||
|
|
||||||
translate(v = [yBarWidth+eps, 0, 0])
|
translate(v = [yBarWidth+eps, 0, 0])
|
||||||
frontBarConnector_N();
|
xBarConnectorFromY_N();
|
||||||
|
|
||||||
translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing)-9, railSlotSpacing, yBarHeight])
|
translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing)-9, railSlotSpacing, yBarHeight])
|
||||||
sideWallConnector_N();
|
sideWallConnector_N();
|
||||||
|
|||||||
Reference in New Issue
Block a user