Skip to content

Rewrite pathes to lib/mcad/foo.scad #13

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bearing.scad
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later
*/

include <units.scad>
include <materials.scad>
include <lib/mcad/units.scad>
include <lib/mcad/materials.scad>

// Example, uncomment to view
//test_bearing();
Expand Down
2 changes: 1 addition & 1 deletion bitmap/bitmap.scad
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions curves.scad
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the MIT license.
// © 2010 by Elmo Mäntynen

include <constants.scad>
use <math.scad>
include <lib/mcad/constants.scad>
use <lib/mcad/math.scad>


/* A circular helix of radius a and pitch 2πb is described by the following parametrisation:
Expand Down
2 changes: 1 addition & 1 deletion math.scad
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MIT license

include <constants.scad>
include <lib/mcad/constants.scad>

function deg(angle) = 360*angle/TAU;

67 changes: 35 additions & 32 deletions motors.scad
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// License: GPL 2.0

include <math.scad>
include <lib/mcad/math.scad>



//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
Expand All @@ -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)
{
Expand All @@ -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);
}

}
Expand All @@ -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);
}
}
}
};
}
5 changes: 3 additions & 2 deletions nuts_and_bolts.scad
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion screw.scad
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License: GNU LGPL 2.1 or later.
// © 2010 by Elmo Mäntynen

include <curves.scad>
include <lib/mcad/curves.scad>

/* common screw parameter
length
Expand Down
2 changes: 1 addition & 1 deletion servos.scad
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* License: LGPL 2.1
*/

use <triangles.scad>
use <lib/mcad/triangles.scad>

/**
* Align DS420 digital servo
Expand Down
4 changes: 2 additions & 2 deletions stepper.scad
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later
*/

include <units.scad>
include <materials.scad>
include <lib/mcad/units.scad>
include <lib/mcad/materials.scad>


// Demo, uncomment to show:
Expand Down
2 changes: 1 addition & 1 deletion utilities.scad
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later
*/

include <units.scad>
include <lib/mcad/units.scad>

function distance(a, b) = sqrt( (a[0] - b[0])*(a[0] - b[0]) +
(a[1] - b[1])*(a[1] - b[1]) +
Expand Down