-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added an epsilon to the inside diameter of the rings to prevent bolts through holes resulting in 'WARNING: CSG normalisation resulted in empty tree'; switched to using cubes for hexagons; added 626 bearing size; #16
base: master
Are you sure you want to change the base?
Changes from all commits
ae61080
16128b6
48c511d
48d4050
c5007f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,7 @@ | ||||||
include <units.scad> | ||||||
// Copyright 2010 D1plo1d | ||||||
// modified by Ben Howes 2012 | ||||||
// uses hexagon module from https://github.com/josefprusa/PrusaMendel | ||||||
|
||||||
// This library is dual licensed under the GPL 3.0 and the GNU Lesser General Public License as per http://creativecommons.org/licenses/LGPL/2.1/ . | ||||||
|
||||||
|
@@ -137,14 +140,23 @@ COURSE_METRIC_BOLT_MAJOR_THREAD_DIAMETERS = | |||||
35.940//m36 | ||||||
]; | ||||||
|
||||||
module hexagon(height, depth) { | ||||||
boxWidth=height/1.75; | ||||||
union(){ | ||||||
cube([boxWidth, height, depth], true); | ||||||
rotate([0,0,60]) cube([boxWidth, height, depth], true); | ||||||
rotate([0,0,-60]) cube([boxWidth, height, depth], true); | ||||||
} | ||||||
} | ||||||
|
||||||
module nutHole(size, units=MM, tolerance = +0.0001, proj = -1) | ||||||
{ | ||||||
//takes a metric screw/nut size and looksup nut dimensions | ||||||
radius = METRIC_NUT_AC_WIDTHS[size]/2+tolerance; | ||||||
height = METRIC_NUT_THICKNESS[size]+tolerance; | ||||||
radius = METRIC_NUT_AC_WIDTHS[size]+2*tolerance; | ||||||
height = METRIC_NUT_THICKNESS[size]+tolerance*2; | ||||||
if (proj == -1) | ||||||
{ | ||||||
cylinder(r= radius, h=height, $fn = 6, center=[0,0]); | ||||||
translate([0,0,(height/2)-tolerance]) hexagon(height=radius, depth=height); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
if (proj == 1) | ||||||
{ | ||||||
|
@@ -166,8 +178,8 @@ module boltHole(size, units=MM, length, tolerance = +0.0001, proj = -1) | |||||
|
||||||
if (proj == -1) | ||||||
{ | ||||||
translate([0, 0, -capHeight]) | ||||||
cylinder(r= capRadius, h=capHeight); | ||||||
translate([0, 0, -capHeight-epsilon]) | ||||||
cylinder(r= capRadius, h=capHeight+2*epsilon); | ||||||
cylinder(r = radius, h = length); | ||||||
} | ||||||
if (proj == 1) | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,7 +135,7 @@ Nema17 = [ | |
[NemaRoundExtrusionDiameter, 22*mm], | ||
[NemaRoundExtrusionHeight, 1.9*mm], | ||
[NemaAxleDiameter, 5*mm], | ||
[NemaFrontAxleLength, 18*mm], | ||
[NemaFrontAxleLength, 21*mm], | ||
[NemaBackAxleLength, 15*mm], | ||
[NemaAxleFlatDepth, 0.5*mm], | ||
[NemaAxleFlatLengthFront, 15*mm], | ||
|
@@ -186,6 +186,43 @@ Nema34 = [ | |
[NemaAxleFlatLengthBack, 25*mm] | ||
]; | ||
|
||
NemaDefinitions = [ | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
Nema08, | ||
-1, | ||
-1, | ||
Nema11, | ||
-1, | ||
-1, | ||
Nema14, | ||
-1, | ||
-1, | ||
Nema17, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
Nema23, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
-1, | ||
Nema34 | ||
]; | ||
|
||
|
||
function motorWidth(model=Nema23) = lookup(NemaSideSize, model); | ||
|
@@ -194,36 +231,38 @@ function motorLength(model=Nema23, size=NemaMedium) = lookup(size, model); | |
|
||
module motor(model=Nema23, size=NemaMedium, dualAxis=false, pos=[0,0,0], orientation = [0,0,0]) { | ||
|
||
length = lookup(size, model); | ||
motorDef = NemaDefinitions[model]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this changes the format of the |
||
echo(NemaDefinitions[14]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This echo shouldn't be here, I think. |
||
length = lookup(size, motorDef); | ||
|
||
echo(str(" Motor: Nema",lookup(NemaModel, model),", length= ",length,"mm, dual axis=",dualAxis)); | ||
echo(str(" Motor: Nema",lookup(NemaModel, motorDef),", length= ",length,"mm, dual axis=",dualAxis)); | ||
|
||
stepperBlack = BlackPaint; | ||
stepperAluminum = Aluminum; | ||
|
||
side = lookup(NemaSideSize, model); | ||
side = lookup(NemaSideSize, motorDef); | ||
|
||
cutR = lookup(NemaMountingHoleCutoutRadius, model); | ||
lip = lookup(NemaMountingHoleLip, model); | ||
holeDepth = lookup(NemaMountingHoleDepth, model); | ||
cutR = lookup(NemaMountingHoleCutoutRadius, motorDef); | ||
lip = lookup(NemaMountingHoleLip, motorDef); | ||
holeDepth = lookup(NemaMountingHoleDepth, motorDef); | ||
|
||
axleLengthFront = lookup(NemaFrontAxleLength, model); | ||
axleLengthBack = lookup(NemaBackAxleLength, model); | ||
axleRadius = lookup(NemaAxleDiameter, model) * 0.5; | ||
axleLengthFront = lookup(NemaFrontAxleLength, motorDef); | ||
axleLengthBack = lookup(NemaBackAxleLength, motorDef); | ||
axleRadius = lookup(NemaAxleDiameter, motorDef) * 0.5; | ||
|
||
extrSize = lookup(NemaRoundExtrusionHeight, model); | ||
extrRad = lookup(NemaRoundExtrusionDiameter, model) * 0.5; | ||
extrSize = lookup(NemaRoundExtrusionHeight, motorDef); | ||
extrRad = lookup(NemaRoundExtrusionDiameter, motorDef) * 0.5; | ||
|
||
holeDist = lookup(NemaDistanceBetweenMountingHoles, model) * 0.5; | ||
holeRadius = lookup(NemaMountingHoleDiameter, model) * 0.5; | ||
holeDist = lookup(NemaDistanceBetweenMountingHoles, motorDef) * 0.5; | ||
holeRadius = lookup(NemaMountingHoleDiameter, motorDef) * 0.5; | ||
|
||
mid = side / 2; | ||
|
||
roundR = lookup(NemaEdgeRoundingRadius, model); | ||
roundR = lookup(NemaEdgeRoundingRadius, motorDef); | ||
|
||
axleFlatDepth = lookup(NemaAxleFlatDepth, model); | ||
axleFlatLengthFront = lookup(NemaAxleFlatLengthFront, model); | ||
axleFlatLengthBack = lookup(NemaAxleFlatLengthBack, model); | ||
axleFlatDepth = lookup(NemaAxleFlatDepth, motorDef); | ||
axleFlatLengthFront = lookup(NemaAxleFlatLengthFront, motorDef); | ||
axleFlatLengthBack = lookup(NemaAxleFlatLengthBack, motorDef); | ||
|
||
color(stepperBlack){ | ||
translate(pos) rotate(orientation) { | ||
|
@@ -305,9 +344,3 @@ module motor(model=Nema23, size=NemaMedium, dualAxis=false, pos=[0,0,0], orienta | |
} | ||
} | ||
} | ||
|
||
module roundedBox(size, edgeRadius) { | ||
cube(size); | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't really a radius any more.