diff --git a/bearing.scad b/bearing.scad index 2efea7ec..4149dbf8 100644 --- a/bearing.scad +++ b/bearing.scad @@ -5,8 +5,8 @@ * Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later */ -include -include +include +include // Example, uncomment to view //test_bearing(); diff --git a/bitmap/bitmap.scad b/bitmap/bitmap.scad index 38a0d0dc..1b489002 100644 --- a/bitmap/bitmap.scad +++ b/bitmap/bitmap.scad @@ -962,7 +962,7 @@ module 8bit_char(char, block_size, height, include_base) { 0,1,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 ], block_size, height, 8); - } else if (char == "\") { + } else if (char == "\\") { bitmap([ 0,0,0,0,0,0,0,0, 0,1,1,0,0,0,0,0, diff --git a/curves.scad b/curves.scad index 87c675af..63dbd10a 100644 --- a/curves.scad +++ b/curves.scad @@ -2,8 +2,8 @@ // Licensed under the MIT license. // © 2010 by Elmo Mäntynen -include -use +include +use /* A circular helix of radius a and pitch 2πb is described by the following parametrisation: diff --git a/math.scad b/math.scad index 25b67210..033d8b3d 100644 --- a/math.scad +++ b/math.scad @@ -1,6 +1,6 @@ // MIT license -include +include function deg(angle) = 360*angle/TAU; diff --git a/motors.scad b/motors.scad index ac3161ad..1b6f68af 100644 --- a/motors.scad +++ b/motors.scad @@ -1,10 +1,11 @@ // License: GPL 2.0 -include +include + //generates a motor mount for the specified nema standard #. -module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true) +module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true, tolerance=0) { //dimensions from: // http://www.numberfactory.com/NEMA%20Motor%20Dimensions.htm @@ -19,7 +20,8 @@ module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true) bolt_hole_size = 3.5, bolt_hole_distance = 1.220*mm_per_inch, slide_distance = slide_distance, - mochup = mochup); + mochup = mochup, + tolerance=tolerance); } if (nema_standard == 23) { @@ -32,7 +34,8 @@ module stepper_motor_mount(nema_standard,slide_distance=0, mochup=true) bolt_hole_size = 0.195*mm_per_inch, bolt_hole_distance = 1.856*mm_per_inch, slide_distance = slide_distance, - mochup = mochup); + mochup = mochup, + tolerance=tolerance); } } @@ -49,46 +52,46 @@ module _stepper_motor_mount( bolt_hole_distance, slide_distance = 0, motor_length = 40, //arbitray - not standardized - mochup + mochup, + tolerance = 0 ) { union() { - // == centered mount points == - //mounting circle inset - translate([0,slide_distance/2,0]) circle(r = pilot_diameter/2); - square([pilot_diameter,slide_distance],center=true); - translate([0,-slide_distance/2,0]) circle(r = pilot_diameter/2); + // == centered mount points == + //mounting circle inset + translate([0,slide_distance/2,0]) circle(r = pilot_diameter/2 + tolerance); + //was causing segfaults.. wtf? + //square([pilot_diameter+tolerance*2,slide_distance],center=true); + translate([0,-slide_distance/2,0]) circle(r = pilot_diameter/2+tolerance); - //todo: motor shaft hole + //todo: motor shaft hole - //mounting screw holes - for (x = [-1,1]) - { - for (y = [-1,1]) + //mounting screw holes + for (x = [-1,1]) for (y = [-1,1]) { translate([x*bolt_hole_distance/2,y*bolt_hole_distance/2,0]) { - translate([0,slide_distance/2,0]) circle(bolt_hole_size/2); - translate([0,-slide_distance/2,0]) circle(bolt_hole_size/2); - square([bolt_hole_size,slide_distance],center=true); + translate([0,slide_distance/2,0]) circle(bolt_hole_size/2+tolerance); + translate([0,-slide_distance/2,0]) circle(bolt_hole_size/2+tolerance); + //was causing segfaults.. wtf? + //square([bolt_hole_size+tolerance*2,slide_distance],center=true); } } - } - // == motor mock-up == - //motor box - if (mochup == true) - { - %translate([0,0,-5]) cylinder(h = 5, r = pilot_diameter/2); - %translate(v=[0,0,-motor_length/2]) - { - cube(size=[bolt_hole_distance+bolt_hole_size+5,bolt_hole_distance+bolt_hole_size+5,motor_length], center = true); - } - //shaft - %translate(v=[0,0,-(motor_length-motor_shaft_length-2)/2]) + // == motor mock-up == + //motor box + if (mochup == true) { - %cylinder(r=motor_shaft_diameter/2,h=motor_length+motor_shaft_length--1, center = true); + %translate([0,0,-5]) cylinder(h = 5, r = pilot_diameter/2); + %translate(v=[0,0,-motor_length/2]) + { + cube(size=[bolt_hole_distance+bolt_hole_size+5,bolt_hole_distance+bolt_hole_size+5,motor_length], center = true); + } + //shaft + %translate(v=[0,0,-(motor_length-motor_shaft_length-2)/2]) + { + %cylinder(r=motor_shaft_diameter/2,h=motor_length+motor_shaft_length--1, center = true); + } } } - }; } diff --git a/nuts_and_bolts.scad b/nuts_and_bolts.scad index 3ad37f3b..b3126c8e 100644 --- a/nuts_and_bolts.scad +++ b/nuts_and_bolts.scad @@ -163,11 +163,12 @@ module boltHole(size, units=MM, length, tolerance = +0.0001, proj = -1) capRadius = METRIC_NUT_AC_WIDTHS[size]/2+tolerance; //METRIC_BOLT_CAP_RADIUS[size]+tolerance; if (proj == -1) - { + { union() { translate([0, 0, -capHeight]) - cylinder(r= capRadius, h=capHeight); + cylinder(r= capRadius, h=capHeight+tolerance); cylinder(r = radius, h = length); } + } if (proj == 1) { circle(r = radius); diff --git a/screw.scad b/screw.scad index cd4ce2bc..b540a901 100644 --- a/screw.scad +++ b/screw.scad @@ -2,7 +2,7 @@ // License: GNU LGPL 2.1 or later. // © 2010 by Elmo Mäntynen -include +include /* common screw parameter length diff --git a/servos.scad b/servos.scad index b751835e..a903180e 100644 --- a/servos.scad +++ b/servos.scad @@ -7,7 +7,7 @@ * License: LGPL 2.1 */ -use +use /** * Align DS420 digital servo diff --git a/stepper.scad b/stepper.scad index 4baddc38..90e3bb4f 100644 --- a/stepper.scad +++ b/stepper.scad @@ -5,8 +5,8 @@ * Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later */ -include -include +include +include // Demo, uncomment to show: diff --git a/utilities.scad b/utilities.scad index 174d4baa..77bdf826 100644 --- a/utilities.scad +++ b/utilities.scad @@ -5,7 +5,7 @@ * Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later */ -include +include function distance(a, b) = sqrt( (a[0] - b[0])*(a[0] - b[0]) + (a[1] - b[1])*(a[1] - b[1]) +