chiark / gitweb /
9bb5238f3e3f2f738dedd429b5f8dbc56cddbe32
[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
20 // fudgeish
21
22 holes_rotation = 9;
23 pin_offset = 2;
24
25 // computed
26
27 body_depth = pin_width + 8;
28
29 module Holes(){
30   translate([0, -pump_dia/2]);
31   rotate(-holes_rotation){
32     translate([-(pump_seatstay_gap/2 + pump_dia/2),
33                0])
34       circle(r=pump_dia/2);
35     translate([+(pump_seatstay_gap/2 + seatstay_mindia/2),
36                pump_dia/2 -seatstay_maxdia/2 -pump_seatstay_delta]) {
37       hull(){
38         for (ud=[-1,1])
39           translate([0, ud * (seatstay_maxdia-seatstay_mindia)/2])
40             circle(r=seatstay_mindia/2);
41       }
42     }
43   }
44 }
45
46 module BodyPlan(){
47   hull(){
48     for(x=[-1,1]) for(y=[-1,1])
49       translate([x*body_thick_x, y*body_thick_y])
50         Holes();
51   }
52 }
53
54 module Body(){
55   translate([0,0,-body_depth/2])
56     linear_extrude(height=body_depth){
57     difference(){
58       BodyPlan();
59       Holes();
60     }
61   }
62 }
63
64 module Pin(){
65   translate([0, pin_offset, 0]) rotate([0,90,0]){
66     translate([0, 0, -pin_thick/2])
67       linear_extrude(height=pin_thick){
68       translate([-pin_base/2, 0]) square([pin_base, 50]);
69       translate([-pin_width/2, -100]) square([pin_width, 101]);
70     }
71     translate([-lock_manouvre_thick/2, -pin_workdepth-100, -lock_manouvre_len])
72       cube([lock_manouvre_thick, 100, lock_manouvre_len*2]);
73   }
74 }
75
76 module Demo(){
77   %Body();
78   Pin();
79 }
80
81 module All(){
82   difference(){
83     Body();
84     Pin();
85   }
86 }
87
88 Demo();
89 //All();