chiark / gitweb /
air-hockey-puck: wip
[reprap-play.git] / topeak-seatstay-lock.scad
1 // -*- C -*-
2
3 pump_dia = 27 + 0.9;
4 seatstay_mindia = 14 + 0.5;
5 seatstay_maxdia = 19 + 0.7;
6 pump_seatstay_gap = 12.3;
7 pump_seatstay_delta = 0.1;
8 pump_ridge_width = 8 + 2.0;
9
10 body_thick = 5;
11
12 pin_workdepth = 16 - 1.0;
13 pin_width = 11 + 1.0;
14 pin_thick = 3 + 0.7;
15 pin_base = 25;
16
17 lock_manouvre_thick = 3.7 + 0.6;
18 lock_manouvre_len = 18;
19 lock_hang_width = 17.5;
20 lock_manouvre_len_smaller = 13;
21
22 body_depth_each = 5;
23 clatter_gap = 0.5;
24
25 roof_extent = 7;
26 roof_thick = 2;
27
28 // fudgeish
29
30 cut_rotation = 2;
31 holes_rotation = 9;
32 pin_y_offset = 5.5;
33 pin_x_offset = 0.5;
34 ridge_rotation = 8.5;
35 lock_hang_ratio = 7;
36
37 // computed
38
39 body_depth = pin_width + body_depth_each*2;
40
41 module Holes(forbody=false){
42   translate([0, -pump_dia/2]);
43   rotate(-holes_rotation){
44     translate([-(pump_seatstay_gap/2 + pump_dia/2),
45                0]) {
46       if (!forbody)
47         rotate(-ridge_rotation + holes_rotation)
48           translate([-50, -pump_ridge_width/2])
49           square([50, pump_ridge_width]);
50       circle(r=pump_dia/2, $fn=80);
51     }
52     translate([+(pump_seatstay_gap/2 + seatstay_mindia/2),
53                pump_dia/2 -seatstay_maxdia/2 -pump_seatstay_delta]) {
54       hull(){
55         for (ud=[-1,1])
56           translate([0, ud * (seatstay_maxdia-seatstay_mindia)/2])
57             circle(r=seatstay_mindia/2, $fn=50);
58       }
59     }
60   }
61 }
62
63 module BodyPlan(){
64    minkowski(){
65     circle(body_thick);
66     hull()
67       Holes(true);
68   }
69 }
70
71 module Body(){
72   translate([0,0,body_depth/2])mirror([0,0,1]){
73     linear_extrude(height=body_depth){
74       difference(){
75         BodyPlan();
76         Holes();
77       }
78     }
79     linear_extrude(height=roof_thick){
80       difference(){
81         hull(){
82           BodyPlan();
83           translate([0,-roof_extent,0]) BodyPlan();
84         }
85         Holes();
86       }
87     }
88   }
89 }
90
91 module Pin(){
92   translate([pin_x_offset, pin_y_offset, 0]) rotate([0,90,0]){
93     translate([0, 0, -pin_thick/2])
94       linear_extrude(height=pin_thick){
95       translate([-pin_base/2, 0]) square([pin_base, 50]);
96       translate([-pin_width/2, -100]) square([pin_width, 101]);
97     }
98     hull() for (d=[0,10]) {
99       translate([d*lock_hang_ratio,-d,0])
100         translate([-lock_manouvre_thick/2,
101                    -pin_workdepth-100,
102                    -lock_manouvre_len_smaller])
103         cube([lock_manouvre_thick, 100,
104               lock_manouvre_len + lock_manouvre_len_smaller]);
105     }
106   }
107 }
108
109 module All(){
110   difference(){
111     Body();
112     Pin();
113   }
114 }
115
116 module Piece(pc,interval){
117   translate([0,-pc*interval,0])
118     intersection(){
119       rotate([0,0,pc*180-cut_rotation])
120       translate([-200,clatter_gap/2,-200]) cube([400,400,400]);
121     All();
122   }
123 }
124
125 module PiecePrint(pc){
126   rotate([0,0,90]) rotate([0,180,0])
127     Piece(pc,4);
128 }
129
130 module PiecesPrint(){
131   PiecePrint(0);
132   PiecePrint(1);
133 }
134
135 module Demo(){
136   for (pc=[0,1])
137     Piece(pc,0);
138 }
139
140 //Holes();
141 //Demo();
142 //All();
143 //Pin();
144 //Pieces();
145 PiecesPrint();
146 //PiecePrint(0);
147 //PiecePrint(1);