1 // Parametric screw-like things (ball screws, augers)
2 // License: GNU LGPL 2.1 or later.
3 // © 2010 by Elmo Mäntynen
7 /* common screw parameter
9 pitch = length/rotations: the distance between the turns of the thread
11 inner_diameter: thickness of the shaft
14 //Uncomment to see examples
17 //test_ball_groove2();
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)
26 module auger(pitch, length, outside_radius, inner_radius, taper_ratio = 0.25) {
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);
34 module test_auger(){translate([50, 0, 0]) auger(40, 80, 25, 5);}
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);
43 module test_ball_groove(){ translate([0, 300, 0]) ball_groove(100, 300, 10);}
45 module ball_groove2(pitch, length, diameter, ball_radius, slices=200){
46 rotations = length/pitch;
48 offset = length/slices;
50 for (i = [0:slices]) {
51 assign (z = i*offset){
52 translate(helix_curve(pitch, radius, z)) sphere(ball_radius, $fa=5, $fs=1);
58 module test_ball_groove2(){translate([0, 0, 0]) ball_groove2(100, 300, 100, 10);}
60 module ball_screw(pitch, length, bearing_radius=2) {
64 module test_ball_screw(){}