chiark / gitweb /
air-hockey-puck: wip
[reprap-play.git] / rope-adjuster.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 hole_dia = 10;
6 around_hole = 4;
7 thick = 3;
8 lever_len = 50;
9
10 teeth_n = 4;
11 teeth_bite = 4;
12 teeth_pitch = 4;
13 teeth_gap = 3;
14 teeth_back = 1;
15 teeth_height = 12;
16 teeth_chamfer = 3;
17
18 // calculated
19
20 teeth_x_mid = lever_len/2 - hole_dia/2 - teeth_bite - teeth_gap*1.5;
21 teeth_height_total = teeth_height + teeth_chamfer;
22
23 module Circles(r) {
24   for (x = [-1,+1] * 0.5 * lever_len) {
25     translate([x, 0])
26       circle(r);
27   }
28 }
29
30 module Plan() {
31   difference(){
32     hull(){
33       Circles(hole_dia/2 + around_hole);
34     }
35     Circles(hole_dia/2);
36     translate([ teeth_x_mid - teeth_bite - teeth_back - teeth_gap - hole_dia/2,
37                 0 ])
38       circle(hole_dia/2);
39   }
40 }
41
42 module TeethPlan(){
43   translate([
44              teeth_x_mid,
45              -0.5 * teeth_n * teeth_pitch,
46              ]) {
47     for (m=[0,1]) {
48       mirror([m,0]) {
49         translate([ teeth_bite + teeth_gap/2, 0 ])
50           rectfromto([ -0.1, 0 ],
51                      [ teeth_back, teeth_n * teeth_pitch ]);
52         for (i= [ 0: teeth_n-1 ]) {
53           translate([teeth_gap/2, teeth_pitch*i])
54             polygon([[ 0,0 ],
55                      [ teeth_bite, 0 ],
56                      [ teeth_bite, teeth_pitch ]]);
57         }
58       }
59     }
60   }
61 }
62
63 module Adjuster(){
64   linextr(0,thick)
65     Plan();
66   difference(){
67     linextr(thick - 0.1, thick + teeth_height_total)
68       TeethPlan();
69     translate([ teeth_x_mid, 0, thick + teeth_height_total + 1])
70       linextr_y_xz(-teeth_pitch * teeth_n,
71                  +teeth_pitch * teeth_n)
72       rotate(45)
73       square(sqrt(2) * (teeth_gap/2 + teeth_chamfer + 1), center=true);
74   }
75 }
76
77 Adjuster();