added MCAD for gears; updated bom with fixes; removed old X carriage; added ATX holde...
[clinton/wilson.git] / scad / MCAD / screw.scad
1 // Parametric screw-like things (ball screws, augers)
2 // License: GNU LGPL 2.1 or later.
3 // © 2010 by Elmo Mäntynen
4
5 include <curves.scad>
6
7 /* common screw parameter
8 length
9 pitch = length/rotations: the distance between the turns of the thread
10 outside_diameter
11 inner_diameter: thickness of the shaft
12 */
13
14 //Uncomment to see examples
15 //test_auger();
16 //test_ball_groove();
17 //test_ball_groove2();
18 //test_ball_screw();
19
20 module helix(pitch, length, slices=500){
21 rotations = length/pitch;
22 linear_extrude(height=length, center=false, convexity=10, twist=360*rotations, slices=slices, $fn=100)
23 child(0);
24 }
25
26 module auger(pitch, length, outside_radius, inner_radius, taper_ratio = 0.25) {
27 union(){
28 helix(pitch, length)
29 polygon(points=[[0,inner_radius],[outside_radius,(inner_radius * taper_ratio)],[outside_radius,(inner_radius * -1 * taper_ratio)],[0,(-1 * inner_radius)]], paths=[[0,1,2,3]]);
30 cylinder(h=length, r=inner_radius);
31 }
32 }
33
34 module test_auger(){translate([50, 0, 0]) auger(40, 80, 25, 5);}
35
36
37 module ball_groove(pitch, length, diameter, ball_radius=10) {
38 helix(pitch, length, slices=100)
39 translate([diameter, 0, 0])
40 circle(r = ball_radius);
41 }
42
43 module test_ball_groove(){ translate([0, 300, 0]) ball_groove(100, 300, 10);}
44
45 module ball_groove2(pitch, length, diameter, ball_radius, slices=200){
46 rotations = length/pitch;
47 radius=diameter/2;
48 offset = length/slices;
49 union(){
50 for (i = [0:slices]) {
51 assign (z = i*offset){
52 translate(helix_curve(pitch, radius, z)) sphere(ball_radius, $fa=5, $fs=1);
53 }
54 }
55 }
56 }
57
58 module test_ball_groove2(){translate([0, 0, 0]) ball_groove2(100, 300, 100, 10);}
59
60 module ball_screw(pitch, length, bearing_radius=2) {
61
62 }
63
64 module test_ball_screw(){}