add profiles.scad

This commit is contained in:
zhao
2023-01-15 20:54:50 -05:00
parent 3ef4ea5cf9
commit 742e16dca5
9 changed files with 27400 additions and 30 deletions

View File

@ -20,8 +20,8 @@ m3HexNutThickness = 2.18;
m3HeatSetInsertSlotRadiusSlack = -0.1;
m3HeatSetInsertSlotHeightSlack = 0.5;
m3HeatSetInsertSlotRadius = 2.5;
m3HeatSetInsertSlotHeight = 6;
m3HeatSetInsertSlotRadius = 2.3;
m3HeatSetInsertSlotHeight = 5.7;
m3HeatSetInsertSlotRadiusSlacked = m3HeatSetInsertSlotRadius+m3HeatSetInsertSlotRadiusSlack;
m3HeatSetInsertSlotHeightSlacked = m3HeatSetInsertSlotHeight+m3HeatSetInsertSlotHeightSlack;

View File

@ -6,32 +6,39 @@
- "_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.
*/
include <./profiles.scad>
profile = "default";
echo("Profile:", profile);
// Maximum width for rackmount units. Change this according your max expected enclosure width.
// Changing this will directly affect the required build volume.
maxUnitWidth = 200;
maxUnitWidth = getConfigValue(profile, "maxUnitWidth");
// Maximum (recommended) unit depth. There technically isn't a max unit depth because there's no physical bound on
// how far a rack unit can extrude back. This parameter basically controls the distance between the front of the front
// rails and the back of the back rails. Changing this will directly affect the required build volume.
maxUnitDepth = 200;
maxUnitDepth = getConfig("maxUnitDepth");
// Vertical distance between the midpoint of adjacent screws mounts. Affects build volume.
screwDiff = 10;
screwDiff = getConfig("screwDiff");
// Number screw slots on the main rail. Affects build volume.
numRailScrews = 20;
numRailScrews = getConfig("numRailScrews");
// Screw type used for rackmount units. See screws.scad.
mainRailScrewType = "m4";
mainRailScrewType = getConfig("mainRailScrewType");
// Screw type used to affix side rails.
mainRailSideMountScrewType = "m4";
mainRailSideMountScrewType = getConfig("mainRailSideMountScrewType");
// Screw type used for constructing the actual rack frame.
rackFrameScrewType = "m3";
rackFrameScrewType = getConfig("rackFrameScrewType");
// Currently, only m3 screws are supported here (tolerance issues)
assert(rackFrameScrewType == "m3");
// Fillet radius for main rack profile
baseRoundness = 5;
baseRoundness = getConfig("baseRoundness");
echo("numRailScrews", numRailScrews);

View File

@ -9,21 +9,21 @@ mainRail();
translate(v=[12,2 + 200,18])
mirror(v=[0,1,0])
mainRail();
*mainRail();
translate(v=[12 + 216,2,18])
mirror(v=[1,0,0])
mainRail();
*mainRail();
translate(v=[12 + 216,2 + 200,18])
rotate(a=[0,0,180])
mainRail();
*mainRail();
xyPlane();
*xyPlane();
translate(v=[0,0,250])
mirror(v=[0,0,1])
xyPlane();
*xyPlane();
module xyPlane() {
yBar();
@ -39,3 +39,8 @@ module xyPlane() {
mirror(v = [0, 1, 0])
xBar();
}
yBar();
translate(v = [30, 0, 0])
xBar();

View File

@ -30,7 +30,7 @@ frontFaceWidth = railScrewHoleToInnerEdge + railScrewHoleToOuterEdge;
railTotalWidth = frontFaceWidth;
railTotalDepth = railFrontThickness+sideSupportDepth;
*mainRail();
mainRail();
echo("Total Rail Height: ", railTotalHeight);

44
rack/profiles.scad Normal file
View File

@ -0,0 +1,44 @@
/*
case-files v2
This file contains
Example usage:
profileName = "mini";
varName = "mainRailSideMountScrewType";
profile = getProfile(profileName);
echo("val:", getConfigValue(profile, varName));
*/
_profileConfigs = [
["default", [
["maxUnitWidth", 205],
["maxUnitDepth", 205],
["screwDiff", 10],
["numRailScrews", 20],
["mainRailScrewType", "m4"],
["mainRailSideMountScrewType", "m4"],
["rackFrameScrewType", "m3"],
["baseRoundness", 5],
]],
["micro", [
["maxUnitWidth", 105],
["maxUnitDepth", 105],
["numRailScrews", 10],
["baseRoundness", 5]
]],
["mini", [
["maxUnitWidth", 205],
["maxUnitDepth", 205],
["numRailScrews", 20],
["baseRoundness", 5]
]]
];
function _getConfigValueRaw(profile, varName) = profile[search([varName], profile)[0]][1];
function _getProfileRaw(profileName) = _profileConfigs[search([profileName], _profileConfigs)[0]][1];
function _getConfigValueOrThrowError(val) = val == undef? assert(false, "blah") 0: val;
function getConfigValue(profile, varName) = _getConfigValueOrThrowError(_getConfigValueRaw(profile, varName));
function getProfile(profileName) = _getConfigValueOrThrowError(_getProfileRaw(profileName));

View File

@ -17,7 +17,7 @@ xBarHeight = 15;
xBarWallThickness = 2;
xBarRoundness = baseRoundness;
//echo(xBarDepth);
*xBar();
module xBar() {
@ -71,6 +71,4 @@ module xBar() {
xBar();
}
xBar();

View File

@ -42,18 +42,22 @@ module yBar() {
yBarBase();
module yBarBase() {
difference() {
sphericalFiletEdge(yBarWidth, yBarDepth, yBarHeight, yBarRoundness);
intersection() {
difference() {
sphericalFiletEdge(yBarWidth, yBarDepth, yBarHeight, yBarRoundness);
translate(v = [yBarWallThickness, joinCornerDepth, yBarWallThickness])
cylindricalFiletEdge(yBarWidth, yBarDepth-2*joinCornerDepth, yBarHeight, yBarRoundness);
translate(v = [yBarWallThickness, joinCornerDepth, yBarWallThickness])
cylindricalFiletEdge(yBarWidth, yBarDepth-2*joinCornerDepth, yBarHeight, yBarRoundness);
}
halfspace(vpos=[-1, 0, 1], p=[yBarWidth-0.5, 0,0]);
}
}
module applyBasePlateConnector() {
apply_pn() {
mirrorOtherCorner() {
translate(v = [yBarWidth-12, joinCornerDepth, 0.01]) // why do we need 0.01 here???
translate(v = [yBarWidth-12, joinCornerDepth, yBarWallThickness]) // why do we need 0.01 here???
yBarBasePlateMount_P();
}

View File

@ -5,7 +5,7 @@ include <./config.scad>
_mountX = 12;
_mountY = 14;
_mountZ = 13;
_mountZ = 10;
// x and y faces of the yBarBasePlateMount_P block
_innerXFaceToScrew = 6;
@ -31,20 +31,30 @@ module yBarBasePlateMount_N() {
mirror(v=[0,0,1])
heatSetInsertSlot_N(rackFrameScrewType, topExtension=inf10);
hull() {
translate(v = [heatSetX, heatSetY, 0])
cylinder(r=_baseConnY/2, h=_baseConnRecession);
translate(v = [inf50, heatSetY-_baseConnY/2, 0])
cube(size = [eps, _baseConnY, _baseConnRecession]);
}
hull() {
translate(v = [heatSetX, heatSetY, 0])
cylinder(r=_baseConnY/2+0.25, h=eps);
translate(v = [inf50, heatSetY-_baseConnY/2, 0])
cube(size = [eps, _baseConnY + 0.5, eps]);
translate(v = [heatSetX, heatSetY, 1])
cylinder(r=_baseConnY/2, h=eps);
translate(v = [inf50, heatSetY-_baseConnY/2, 1])
cube(size = [eps, _baseConnY, eps]);
}
}
*difference() {
yBarBasePlateMount_P();
yBarBasePlateMount_N();
}
//yBarBasePlateMount_N();

27302
stl/rack/mainRail.stl Normal file

File diff suppressed because it is too large Load Diff