refactor yBar with new application pattern
This commit is contained in:
@ -3,8 +3,8 @@
|
||||
This file contains parameters used for declaring/generating a customized rack frame.
|
||||
|
||||
- All dimensions are in millimetres (mm) unless stated otherwise.
|
||||
- A "_N" appended to a module is meant to denote that this module is a negative volume, and should only be used to
|
||||
substract from other volumes.
|
||||
- "_N" appended to a module is meant to denote that this module is a negative volume, and should only be used to
|
||||
substract from other volumes. "_P" is meant to denote a positive value. Modules are positive by default.
|
||||
*/
|
||||
|
||||
// Maximum width for rackmount units. Change this according your max expected enclosure width.
|
||||
@ -33,5 +33,5 @@ rackFrameScrewType = "m3";
|
||||
// Currently, only m3 screws are supported here (tolerance issues)
|
||||
assert(rackFrameScrewType == "m3");
|
||||
|
||||
// Fillet radius
|
||||
// Fillet radius for main rack profile
|
||||
baseRoundness = 5;
|
||||
@ -30,10 +30,18 @@ joinCornerDepth = 32;
|
||||
echo("Bar total depth: ", yBarDepth);
|
||||
echo("Bar total width: ", yBarWidth);
|
||||
|
||||
*yBar();
|
||||
|
||||
module yBar() {
|
||||
|
||||
module positive() {
|
||||
applyBaseConnector()
|
||||
applyStackConnector()
|
||||
applySideWallConnector()
|
||||
applyRailConnector()
|
||||
applyXBarConnector()
|
||||
base();
|
||||
|
||||
module base() {
|
||||
difference() {
|
||||
sphericalFiletEdge(yBarWidth, yBarDepth, yBarHeight, yBarRoundness);
|
||||
|
||||
@ -42,58 +50,68 @@ module yBar() {
|
||||
}
|
||||
}
|
||||
|
||||
module singleCornerNoStackConnector_N() {
|
||||
union() {
|
||||
module applyBaseConnector() {
|
||||
apply_pn() {
|
||||
mirrorOtherCorner() {
|
||||
translate(v = [yBarWidth-12, joinCornerDepth, 0.01]) // why do we need 0.01 here???
|
||||
yBarBasePlateMount_P();
|
||||
}
|
||||
|
||||
mirrorOtherCorner() {
|
||||
translate(v = [yBarWidth-12, joinCornerDepth, 0])
|
||||
yBarBasePlateMount_N();
|
||||
}
|
||||
|
||||
children(0);
|
||||
}
|
||||
}
|
||||
|
||||
module applyStackConnector() {
|
||||
apply_n() {
|
||||
mirrorOtherCorner()
|
||||
translate(v = [5, 5, 0])
|
||||
stackConnectorSocket_N();
|
||||
|
||||
children(0);
|
||||
}
|
||||
}
|
||||
|
||||
module applySideWallConnector() {
|
||||
apply_n() {
|
||||
mirrorOtherCorner()
|
||||
translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing)-9, railSlotSpacing, yBarHeight])
|
||||
sideWallConnector_N();
|
||||
|
||||
children(0);
|
||||
}
|
||||
}
|
||||
|
||||
module applyRailConnector() {
|
||||
apply_n() {
|
||||
mirrorOtherCorner()
|
||||
translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing), railSlotSpacing, yBarHeight-railFootThickness])
|
||||
railFeetSlot_N();
|
||||
|
||||
children(0);
|
||||
}
|
||||
}
|
||||
|
||||
module applyXBarConnector() {
|
||||
apply_n() {
|
||||
mirrorOtherCorner()
|
||||
translate(v = [yBarWidth+eps, 0, 0])
|
||||
xBarConnectorFromY_N();
|
||||
|
||||
translate(v = [yBarWidth-(railTotalWidth+railSlotSpacing)-9, railSlotSpacing, yBarHeight])
|
||||
sideWallConnector_N();
|
||||
children(0);
|
||||
}
|
||||
}
|
||||
|
||||
module yBar() {
|
||||
|
||||
module mirrorOtherCorner() {
|
||||
children(0);
|
||||
|
||||
translate(v = [0, yBarDepth, 0])
|
||||
mirror(v = [0, 1, 0]) {
|
||||
mirror(v = [0, 1, 0])
|
||||
children(0);
|
||||
}
|
||||
}
|
||||
|
||||
difference() {
|
||||
|
||||
union() {
|
||||
positive();
|
||||
|
||||
mirrorOtherCorner()
|
||||
translate(v=[yBarWidth-12, joinCornerDepth,0.01])
|
||||
yBarBasePlateMount_P(mountX=12, mountZ=yBarHeight);
|
||||
}
|
||||
union() {
|
||||
mirrorOtherCorner()
|
||||
singleCornerNoStackConnector_N();
|
||||
|
||||
mirrorOtherCorner()
|
||||
translate(v=[yBarWidth-12, joinCornerDepth, 0])
|
||||
yBarBasePlateMount_N();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
yBar();
|
||||
}
|
||||
|
||||
translate(v=[yBarWidth-12, joinCornerDepth, m3CounterSunkHeadLength])
|
||||
*yBarBasePlateMount_N();
|
||||
yBar();
|
||||
|
||||
//counterSunkHead_N("m3", 1, 1);
|
||||
@ -1,21 +1,25 @@
|
||||
include <../helper/common.scad>
|
||||
include <../helper/halfspace.scad>
|
||||
include <../helper/screws.scad>
|
||||
include <./config.scad>
|
||||
|
||||
_mountX = 12;
|
||||
_mountY = 12;
|
||||
_mountZ = 12;
|
||||
_mountY = 14;
|
||||
_mountZ = 13;
|
||||
|
||||
// x and y faces of the yBarBasePlateMount_P block
|
||||
_innerXFaceToScrew = 6;
|
||||
_innerYFaceToScrew = 6;
|
||||
_innerYFaceToScrew = 8;
|
||||
|
||||
_baseConnRecession = 3;
|
||||
_baseConnY = 8;
|
||||
_baseConnOuterXFaceToScrew = 2;
|
||||
|
||||
module yBarBasePlateMount_P() {
|
||||
cube(size=[_mountX, _mountY, _mountZ]);
|
||||
intersection() {
|
||||
cube(size = [_mountX, _mountY, _mountZ]);
|
||||
halfspace(vpos=[0, -1, -1], p=[0, _mountY-1, _mountZ-1]);
|
||||
}
|
||||
}
|
||||
|
||||
module yBarBasePlateMount_N() {
|
||||
@ -27,11 +31,18 @@ module yBarBasePlateMount_N() {
|
||||
mirror(v=[0,0,1])
|
||||
heatSetInsertSlot_N(rackFrameScrewType, topExtension=inf10);
|
||||
|
||||
translate(v=[_baseConnOuterXFaceToScrew, heatSetY - _baseConnY/2,0])
|
||||
cube(size=[inf50, _baseConnY, _baseConnRecession]);
|
||||
|
||||
hull() {
|
||||
|
||||
translate(v = [heatSetX, heatSetY, 0])
|
||||
cylinder(r=_baseConnY/2, h=_baseConnRecession);
|
||||
|
||||
translate(v = [inf50, heatSetY-_baseConnY/2, 0])
|
||||
cube(size = [eps, _baseConnY, _baseConnRecession]);
|
||||
}
|
||||
}
|
||||
|
||||
difference() {
|
||||
*difference() {
|
||||
yBarBasePlateMount_P();
|
||||
yBarBasePlateMount_N();
|
||||
}
|
||||
|
||||
34218
stl/rack/yBar.stl
Normal file
34218
stl/rack/yBar.stl
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user