chiark / gitweb /
f2b974401fc1f8ecc695d5a181d28682d15ec67a
[reprap-play.git] / topeak-seatstay-lock.scad
1 // -*- C -*-
2
3 pump_dia = 27;
4 seatstay_mindia = 14;
5 seatstay_maxdia = 19;
6 pump_seatstay_gap = 12.3;
7 pump_seatstay_delta = 0.1;
8
9 body_thick_x = 5;
10 body_thick_y = 5;
11
12 pin_workdepth = 16;
13 pin_width = 11 + 0.5;
14 pin_thick = 3 + 0.4;
15 pin_base = 25;
16
17 lock_manouvre_thick = 3.5 + 0.5;
18 lock_manouvre_len = 18;
19 lock_hang_width = 17.5;
20
21 // fudgeish
22
23 holes_rotation = 9;
24 pin_offset = 6;
25
26 // computed
27
28 body_depth = pin_width + 8;
29
30 module Holes(){
31   translate([0, -pump_dia/2]);
32   rotate(-holes_rotation){
33     translate([-(pump_seatstay_gap/2 + pump_dia/2),
34                0])
35       circle(r=pump_dia/2);
36     translate([+(pump_seatstay_gap/2 + seatstay_mindia/2),
37                pump_dia/2 -seatstay_maxdia/2 -pump_seatstay_delta]) {
38       hull(){
39         for (ud=[-1,1])
40           translate([0, ud * (seatstay_maxdia-seatstay_mindia)/2])
41             circle(r=seatstay_mindia/2);
42       }
43     }
44   }
45 }
46
47 module BodyPlan(){
48   hull(){
49     for(x=[-1,1]) for(y=[-1,1])
50       translate([x*body_thick_x, y*body_thick_y])
51         Holes();
52   }
53 }
54
55 module Body(){
56   translate([0,0,-body_depth/2])
57     linear_extrude(height=body_depth){
58     difference(){
59       BodyPlan();
60       Holes();
61     }
62   }
63 }
64
65 module Pin(){
66   translate([0, pin_offset, 0]) rotate([0,90,0]){
67     translate([0, 0, -pin_thick/2])
68       linear_extrude(height=pin_thick){
69       translate([-pin_base/2, 0]) square([pin_base, 50]);
70       translate([-pin_width/2, -100]) square([pin_width, 101]);
71     }
72     translate([-lock_manouvre_thick/2, -pin_workdepth-100, -lock_manouvre_len])
73       cube([lock_manouvre_thick, 100, lock_manouvre_len*2]);
74     translate([- lock_manouvre_thick/2, -pin_workdepth-50,
75                -lock_hang_width/2])
76       cube([50, 50, lock_hang_width]);
77   }
78 }
79
80 module Demo(){
81   %Body();
82   Pin();
83 }
84
85 module All(){
86   difference(){
87     Body();
88     Pin();
89   }
90 }
91
92 Demo();
93 //All();
94 //Pin();