refactor
This commit is contained in:
113
old/screws.scad
Normal file
113
old/screws.scad
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
|
||||||
|
/* Some common screw dimensions */
|
||||||
|
|
||||||
|
|
||||||
|
inf = 400; // basically infinity
|
||||||
|
|
||||||
|
/********************************************************************************/
|
||||||
|
// M3 dimensions
|
||||||
|
|
||||||
|
m3HoleRadiusSlack = 0.15;
|
||||||
|
m3Diameter = 3.0;
|
||||||
|
m3Radius = m3Diameter/2.0;
|
||||||
|
|
||||||
|
m3RadiusSlacked = m3Radius + m3HoleRadiusSlack;
|
||||||
|
|
||||||
|
// legacy TODO: replace
|
||||||
|
m3ptr = m3RadiusSlacked;
|
||||||
|
|
||||||
|
// NUTS!
|
||||||
|
m3HexNutWidthAcrossFlats = 5.41;
|
||||||
|
m3HexNutWidthAcrossCorners = FtoG(m3HexNutWidthAcrossFlats);
|
||||||
|
|
||||||
|
m3HexNutThickness = 2.18;
|
||||||
|
|
||||||
|
module m3HexNutPocketNegative() {
|
||||||
|
hexNutPocketNegative(m3RadiusSlacked,
|
||||||
|
m3HexNutWidthAcrossCorners/2 + 0.1,
|
||||||
|
m3HexNutThickness + 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: remove test
|
||||||
|
|
||||||
|
*difference() {
|
||||||
|
cube(size=[8,12,5], center=true);
|
||||||
|
|
||||||
|
rotate(a=[0,0,20])
|
||||||
|
m3HexNutPocketNegative();
|
||||||
|
}
|
||||||
|
|
||||||
|
*m3HexNutPocketNegative();
|
||||||
|
|
||||||
|
|
||||||
|
/********************************************************************************/
|
||||||
|
// M4 dimensions
|
||||||
|
|
||||||
|
m4HoleRadiusSlack = 0.15;
|
||||||
|
m4Diameter = 4.0;
|
||||||
|
m4Radius = m4Diameter/2.0;
|
||||||
|
m4RadiusSlacked = m4Radius + m4HoleRadiusSlack;
|
||||||
|
|
||||||
|
m4HexNutWidthAcrossFlats = 6.89;
|
||||||
|
m4HexNutWidthAcrossCorners = FtoG(m4HexNutWidthAcrossFlats);
|
||||||
|
|
||||||
|
m4HexNutThickness = 3.07;
|
||||||
|
|
||||||
|
module m4HexNutPocketNegative() {
|
||||||
|
hexNutPocketNegative(m4RadiusSlacked,
|
||||||
|
m4HexNutWidthAcrossCorners/2 + 0.1,
|
||||||
|
m4HexNutThickness + 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: remove test
|
||||||
|
|
||||||
|
*difference() {
|
||||||
|
translate(v=[0,1,0])
|
||||||
|
cube(size=[10,12,6], center=true);
|
||||||
|
|
||||||
|
rotate(a=[0,0,20])
|
||||||
|
m4HexNutPocketNegative();
|
||||||
|
}
|
||||||
|
|
||||||
|
*m4HexNutPocketNegative();
|
||||||
|
|
||||||
|
/********************************************************************************/
|
||||||
|
|
||||||
|
// Convert a regular hexagon widthAcrossFlats to widthAcrossCorners
|
||||||
|
function FtoG(widthAcrossFlats) = widthAcrossFlats * (2/sqrt(3));
|
||||||
|
|
||||||
|
// Convert a regular hexagon widthAcrossCorners to widthAcrossFlats
|
||||||
|
function GtoF(widthAcrossCorners) = widthAcrossCorners * (sqrt(3)/2);
|
||||||
|
|
||||||
|
|
||||||
|
module hexNutPocketNegative(
|
||||||
|
innerRadius,
|
||||||
|
widthAcrossCorners,
|
||||||
|
thickness)
|
||||||
|
{
|
||||||
|
|
||||||
|
union() {
|
||||||
|
|
||||||
|
hull() {
|
||||||
|
// hexagonal cylinder representing where the nut should fit
|
||||||
|
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
|
||||||
|
|
||||||
|
// negative volume for sliding in the nut
|
||||||
|
translate(v=[inf,0,0])
|
||||||
|
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
|
||||||
|
}
|
||||||
|
|
||||||
|
// negative volume for screw lead
|
||||||
|
translate(v=[0,0,-10])
|
||||||
|
cylinder(r=innerRadius, h = inf, $fn=32);
|
||||||
|
|
||||||
|
hull() {
|
||||||
|
translate(v=[inf,0,0])
|
||||||
|
cylinder(r=innerRadius, h = inf, $fn=32);
|
||||||
|
cylinder(r=innerRadius, h = inf, $fn=32);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
include <../math.scad>
|
include <../helper/math.scad>
|
||||||
include <./config.scad>
|
include <./config.scad>
|
||||||
include <./mainRail.scad>
|
include <./mainRail.scad>
|
||||||
include <./yBar.scad>
|
include <./yBar.scad>
|
||||||
0
rack/connectors.scad
Normal file
0
rack/connectors.scad
Normal file
@ -1,6 +1,6 @@
|
|||||||
include <./config.scad>
|
include <./config.scad>
|
||||||
include <./screws.scad>
|
include <./screws.scad>
|
||||||
include <../math.scad>
|
include <../helper/math.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 */
|
||||||
124
rack/screws.scad
124
rack/screws.scad
@ -1,113 +1,97 @@
|
|||||||
|
/* Some common screw dimensions and helper functions/modules */
|
||||||
|
|
||||||
/* Some common screw dimensions */
|
include <../helper/math.scad>
|
||||||
|
include <../helper/common.scad>
|
||||||
|
|
||||||
inf = 400; // basically infinity
|
|
||||||
|
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
// M3 dimensions
|
// M3 dimensions
|
||||||
|
m3HoleRadiusSlack = 0.4; // higher slack for not-so straight heat set inserts
|
||||||
m3HoleRadiusSlack = 0.15;
|
|
||||||
m3Diameter = 3.0;
|
m3Diameter = 3.0;
|
||||||
m3Radius = m3Diameter/2.0;
|
m3Radius = m3Diameter / 2.0;
|
||||||
|
|
||||||
m3RadiusSlacked = m3Radius + m3HoleRadiusSlack;
|
m3RadiusSlacked = m3Radius + m3HoleRadiusSlack;
|
||||||
|
|
||||||
// legacy TODO: replace
|
|
||||||
m3ptr = m3RadiusSlacked;
|
|
||||||
|
|
||||||
// NUTS!
|
|
||||||
m3HexNutWidthAcrossFlats = 5.41;
|
m3HexNutWidthAcrossFlats = 5.41;
|
||||||
m3HexNutWidthAcrossCorners = FtoG(m3HexNutWidthAcrossFlats);
|
m3HexNutWidthAcrossCorners = FtoG(m3HexNutWidthAcrossFlats);
|
||||||
|
|
||||||
m3HexNutThickness = 2.18;
|
m3HexNutThickness = 2.18;
|
||||||
|
|
||||||
module m3HexNutPocketNegative() {
|
m3HeatSetInsertSlotRadiusSlack = -0.1;
|
||||||
hexNutPocketNegative(m3RadiusSlacked,
|
m3HeatSetInsertSlotHeightSlack = 0.5;
|
||||||
m3HexNutWidthAcrossCorners/2 + 0.1,
|
|
||||||
m3HexNutThickness + 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
m3HeatSetInsertSlotRadius = 2.5;
|
||||||
|
m3HeatSetInsertSlotHeight = 6;
|
||||||
|
|
||||||
// TODO: remove test
|
m3HeatSetInsertSlotRadiusSlacked = m3HeatSetInsertSlotRadius+m3HeatSetInsertSlotRadiusSlack;
|
||||||
|
m3HeatSetInsertSlotHeightSlacked = m3HeatSetInsertSlotHeight+m3HeatSetInsertSlotHeightSlack;
|
||||||
*difference() {
|
|
||||||
cube(size=[8,12,5], center=true);
|
|
||||||
|
|
||||||
rotate(a=[0,0,20])
|
|
||||||
m3HexNutPocketNegative();
|
|
||||||
}
|
|
||||||
|
|
||||||
*m3HexNutPocketNegative();
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
// M4 dimensions
|
// M4 dimensions
|
||||||
|
|
||||||
m4HoleRadiusSlack = 0.15;
|
m4HoleRadiusSlack = 0.15;
|
||||||
m4Diameter = 4.0;
|
m4Diameter = 4.0;
|
||||||
m4Radius = m4Diameter/2.0;
|
m4Radius = m4Diameter / 2.0;
|
||||||
m4RadiusSlacked = m4Radius + m4HoleRadiusSlack;
|
m4RadiusSlacked = m4Radius + m4HoleRadiusSlack;
|
||||||
|
|
||||||
m4HexNutWidthAcrossFlats = 6.89;
|
m4HexNutWidthAcrossFlats = 6.89;
|
||||||
m4HexNutWidthAcrossCorners = FtoG(m4HexNutWidthAcrossFlats);
|
m4HexNutWidthAcrossCorners = FtoG(m4HexNutWidthAcrossFlats);
|
||||||
|
|
||||||
m4HexNutThickness = 3.07;
|
m4HexNutThickness = 3.07;
|
||||||
|
|
||||||
module m4HexNutPocketNegative() {
|
|
||||||
hexNutPocketNegative(m4RadiusSlacked,
|
|
||||||
m4HexNutWidthAcrossCorners/2 + 0.1,
|
|
||||||
m4HexNutThickness + 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: remove test
|
|
||||||
|
|
||||||
*difference() {
|
|
||||||
translate(v=[0,1,0])
|
|
||||||
cube(size=[10,12,6], center=true);
|
|
||||||
|
|
||||||
rotate(a=[0,0,20])
|
|
||||||
m4HexNutPocketNegative();
|
|
||||||
}
|
|
||||||
|
|
||||||
*m4HexNutPocketNegative();
|
|
||||||
|
|
||||||
/********************************************************************************/
|
/********************************************************************************/
|
||||||
|
|
||||||
// Convert a regular hexagon widthAcrossFlats to widthAcrossCorners
|
module heatSetInsertSlot_N(screwType) {
|
||||||
function FtoG(widthAcrossFlats) = widthAcrossFlats * (2/sqrt(3));
|
if (screwType == "m3") {
|
||||||
|
union() {
|
||||||
|
// actual slot for insert
|
||||||
|
cylinder(h = m3HeatSetInsertSlotHeightSlacked, r = m3HeatSetInsertSlotRadiusSlacked);
|
||||||
|
|
||||||
// Convert a regular hexagon widthAcrossCorners to widthAcrossFlats
|
// extra space above slot to help with insertion
|
||||||
function GtoF(widthAcrossCorners) = widthAcrossCorners * (sqrt(3)/2);
|
translate(v=[0, 0, m3HeatSetInsertSlotHeightSlacked])
|
||||||
|
cylinder(h = inf50, r = 1.3*m3HeatSetInsertSlotRadiusSlacked);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
error("Unsupported screw type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function screwRadiusSlacked(screwType) =
|
||||||
|
(screwType == "m3")
|
||||||
|
? m3RadiusSlacked
|
||||||
|
: (screwType == "m4")
|
||||||
|
? m4RadiusSlacked
|
||||||
|
: error("Unsupported screw type");
|
||||||
|
|
||||||
module hexNutPocketNegative(
|
module hexNutPocket_N(screwType) {
|
||||||
innerRadius,
|
if (screwType == "m3") {
|
||||||
widthAcrossCorners,
|
hexNutPocketHelper_N(m3RadiusSlacked, m3HexNutWidthAcrossCorners / 2 + 0.1, m3HexNutThickness + 0.2);
|
||||||
thickness)
|
} else if (screwType == "m4") {
|
||||||
{
|
hexNutPocketHelper_N(m4RadiusSlacked, m4HexNutWidthAcrossCorners / 2 + 0.1, m4HexNutThickness + 0.2);
|
||||||
|
} else {
|
||||||
|
error("Unsupported screw type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module hexNutPocketHelper_N(innerRadius, widthAcrossCorners, thickness) {
|
||||||
union() {
|
union() {
|
||||||
|
|
||||||
hull() {
|
hull() {
|
||||||
// hexagonal cylinder representing where the nut should fit
|
// hexagonal cylinder representing where the nut should fit
|
||||||
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
|
cylinder(r = widthAcrossCorners, h = thickness, center = true, $fn = 6);
|
||||||
|
|
||||||
// negative volume for sliding in the nut
|
// negative volume for sliding in the nut
|
||||||
translate(v=[inf,0,0])
|
translate(v = [inf50, 0, 0])
|
||||||
cylinder(r=widthAcrossCorners, h=thickness, center=true, $fn=6);
|
cylinder(r = widthAcrossCorners, h = thickness, center = true, $fn = 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
// negative volume for screw lead
|
// negative volume for screw lead
|
||||||
translate(v=[0,0,-10])
|
translate(v = [0, 0, - 10])
|
||||||
cylinder(r=innerRadius, h = inf, $fn=32);
|
cylinder(r = innerRadius, h = inf50, $fn = 32);
|
||||||
|
|
||||||
hull() {
|
hull() {
|
||||||
translate(v=[inf,0,0])
|
translate(v = [inf50, 0, 0])
|
||||||
cylinder(r=innerRadius, h = inf, $fn=32);
|
cylinder(r = innerRadius, h = inf50, $fn = 32);
|
||||||
cylinder(r=innerRadius, h = inf, $fn=32);
|
cylinder(r = innerRadius, h = inf50, $fn = 32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert a regular hexagon widthAcrossFlats to widthAcrossCorners
|
||||||
|
function FtoG(widthAcrossFlats) = widthAcrossFlats * (2 / sqrt(3));
|
||||||
|
|
||||||
|
// Convert a regular hexagon widthAcrossCorners to widthAcrossFlats
|
||||||
|
function GtoF(widthAcrossCorners) = widthAcrossCorners * (sqrt(3) / 2);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
include <../math.scad>
|
include <../helper/math.scad>
|
||||||
include <../misc/magnet.scad>
|
include <../misc/magnet.scad>
|
||||||
include <../common.scad>
|
include <../helper/common.scad>
|
||||||
|
|
||||||
connectorTaperStartHeight = 2;
|
connectorTaperStartHeight = 2;
|
||||||
connectorRectWidth = 10;
|
connectorRectWidth = 10;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
include <../math.scad>
|
include <../helper/math.scad>
|
||||||
include <../misc/magnet.scad>
|
include <../misc/magnet.scad>
|
||||||
include <../helper/sphericalFilet.scad>
|
include <../helper/sphericalFilet.scad>
|
||||||
include <../helper/cylindricalFilet.scad>
|
include <../helper/cylindricalFilet.scad>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,97 +0,0 @@
|
|||||||
/* Some common screw dimensions and helper functions/modules */
|
|
||||||
|
|
||||||
include <../math.scad>
|
|
||||||
include <../common.scad>
|
|
||||||
|
|
||||||
/********************************************************************************/
|
|
||||||
// M3 dimensions
|
|
||||||
m3HoleRadiusSlack = 0.4; // higher slack for not-so straight heat set inserts
|
|
||||||
m3Diameter = 3.0;
|
|
||||||
m3Radius = m3Diameter / 2.0;
|
|
||||||
m3RadiusSlacked = m3Radius + m3HoleRadiusSlack;
|
|
||||||
|
|
||||||
m3HexNutWidthAcrossFlats = 5.41;
|
|
||||||
m3HexNutWidthAcrossCorners = FtoG(m3HexNutWidthAcrossFlats);
|
|
||||||
m3HexNutThickness = 2.18;
|
|
||||||
|
|
||||||
m3HeatSetInsertSlotRadiusSlack = -0.1;
|
|
||||||
m3HeatSetInsertSlotHeightSlack = 0.5;
|
|
||||||
|
|
||||||
m3HeatSetInsertSlotRadius = 2.5;
|
|
||||||
m3HeatSetInsertSlotHeight = 6;
|
|
||||||
|
|
||||||
m3HeatSetInsertSlotRadiusSlacked = m3HeatSetInsertSlotRadius+m3HeatSetInsertSlotRadiusSlack;
|
|
||||||
m3HeatSetInsertSlotHeightSlacked = m3HeatSetInsertSlotHeight+m3HeatSetInsertSlotHeightSlack;
|
|
||||||
|
|
||||||
/********************************************************************************/
|
|
||||||
// M4 dimensions
|
|
||||||
m4HoleRadiusSlack = 0.15;
|
|
||||||
m4Diameter = 4.0;
|
|
||||||
m4Radius = m4Diameter / 2.0;
|
|
||||||
m4RadiusSlacked = m4Radius + m4HoleRadiusSlack;
|
|
||||||
m4HexNutWidthAcrossFlats = 6.89;
|
|
||||||
m4HexNutWidthAcrossCorners = FtoG(m4HexNutWidthAcrossFlats);
|
|
||||||
m4HexNutThickness = 3.07;
|
|
||||||
|
|
||||||
/********************************************************************************/
|
|
||||||
|
|
||||||
module heatSetInsertSlot_N(screwType) {
|
|
||||||
if (screwType == "m3") {
|
|
||||||
union() {
|
|
||||||
// actual slot for insert
|
|
||||||
cylinder(h = m3HeatSetInsertSlotHeightSlacked, r = m3HeatSetInsertSlotRadiusSlacked);
|
|
||||||
|
|
||||||
// extra space above slot to help with insertion
|
|
||||||
translate(v=[0, 0, m3HeatSetInsertSlotHeightSlacked])
|
|
||||||
cylinder(h = inf50, r = 1.3*m3HeatSetInsertSlotRadiusSlacked);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
error("Unsupported screw type");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function screwRadiusSlacked(screwType) =
|
|
||||||
(screwType == "m3")
|
|
||||||
? m3RadiusSlacked
|
|
||||||
: (screwType == "m4")
|
|
||||||
? m4RadiusSlacked
|
|
||||||
: error("Unsupported screw type");
|
|
||||||
|
|
||||||
module hexNutPocket_N(screwType) {
|
|
||||||
if (screwType == "m3") {
|
|
||||||
hexNutPocketHelper_N(m3RadiusSlacked, m3HexNutWidthAcrossCorners / 2 + 0.1, m3HexNutThickness + 0.2);
|
|
||||||
} else if (screwType == "m4") {
|
|
||||||
hexNutPocketHelper_N(m4RadiusSlacked, m4HexNutWidthAcrossCorners / 2 + 0.1, m4HexNutThickness + 0.2);
|
|
||||||
} else {
|
|
||||||
error("Unsupported screw type");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module hexNutPocketHelper_N(innerRadius, widthAcrossCorners, thickness) {
|
|
||||||
union() {
|
|
||||||
hull() {
|
|
||||||
// hexagonal cylinder representing where the nut should fit
|
|
||||||
cylinder(r = widthAcrossCorners, h = thickness, center = true, $fn = 6);
|
|
||||||
|
|
||||||
// negative volume for sliding in the nut
|
|
||||||
translate(v = [inf50, 0, 0])
|
|
||||||
cylinder(r = widthAcrossCorners, h = thickness, center = true, $fn = 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
// negative volume for screw lead
|
|
||||||
translate(v = [0, 0, - 10])
|
|
||||||
cylinder(r = innerRadius, h = inf50, $fn = 32);
|
|
||||||
|
|
||||||
hull() {
|
|
||||||
translate(v = [inf50, 0, 0])
|
|
||||||
cylinder(r = innerRadius, h = inf50, $fn = 32);
|
|
||||||
cylinder(r = innerRadius, h = inf50, $fn = 32);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert a regular hexagon widthAcrossFlats to widthAcrossCorners
|
|
||||||
function FtoG(widthAcrossFlats) = widthAcrossFlats * (2 / sqrt(3));
|
|
||||||
|
|
||||||
// Convert a regular hexagon widthAcrossCorners to widthAcrossFlats
|
|
||||||
function GtoF(widthAcrossCorners) = widthAcrossCorners * (sqrt(3) / 2);
|
|
||||||
Binary file not shown.
Reference in New Issue
Block a user