summaryrefslogtreecommitdiff
path: root/unbacklash.scad
blob: 7b01cf5c919a706a71c94ec494056eaa8a84e775 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// The diameter of the inner collet
inner_diameter = 6;
// The diameter of the inner collet top lip
outer_diameter = 10;
// Thickness
thickness = 1.5;

/* [Hidden] */
layer_height=0.15; extrusion_width=0.4;
epsilon=.01;

module unbacklash(
 id=inner_diameter,
 od=outer_diameter,
 h=thickness,
 alpha=10,
 overlap=0.8,
 split=2*extrusion_width,
) {
 fnd=PI*4; fnr=2*fnd;
 sd = (od-id)/2+overlap;
 s = sd;
 r = sd/2;
 H=3*h;
 % translate([0,0,-h]) cylinder(d=id,h=3*h,$fn=id*fnd);
 difference() {
  union() {
   translate([-od/2,0,0])
   cube(size=[od,od/2+s-r,h]);
   hull() for(sx=[-1,1])
    translate([sx*(od/2-r),od/2+s-r,0])
    cylinder(r=r,h=H,$fn=r*fnr);
   for(sx=[-1,1])
    hull() for(y=[0,-od/2+sd/2])
     translate([sx*(od/2-sd/2),y,0])
     cylinder(d=sd,h=h,$fn=sd*fnd);
   * translate([-od/2,od/2,0])
   cube(size=[od,r,H]);
  }
  translate([0,0,-1]) cylinder(d=id,h=h+2,$fn=od*fnd);
  translate([-id/2+overlap,-od/2-1,-1]) cube(size=[id-2*overlap,od/2+1,h+2]);
  translate([0,0,h])
  rotate([alpha,0,0])
  translate([-od/2-1,-od,0])
  cube(size=[od+2,od,h]);
  hull() for(y=[0,od/2-split/2])
   translate([0,y,-1])
   cylinder(d=split,h=h+2,$fn=split*fnd);
  translate([0,od/2-split,-1]) cylinder(r=split,h=h+2,$fn=split*fnr);
 }
}

unbacklash();