chiark / gitweb /
47272c49cdd86a0fa70dadb52d336338e7f8c0ef
[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 // fudgeish
26
27 cut_rotation = 2;
28 holes_rotation = 9;
29 pin_y_offset = 5.5;
30 pin_x_offset = 0.5;
31 ridge_rotation = 8.5;
32 lock_hang_ratio = 2;
33
34 // computed
35
36 body_depth = pin_width + body_depth_each*2;
37
38 module Holes(forbody=false){
39   translate([0, -pump_dia/2]);
40   rotate(-holes_rotation){
41     translate([-(pump_seatstay_gap/2 + pump_dia/2),
42                0]) {
43       if (!forbody)
44         rotate(-ridge_rotation + holes_rotation)
45           translate([-50, -pump_ridge_width/2])
46           square([50, pump_ridge_width]);
47       circle(r=pump_dia/2, $fn=80);
48     }
49     translate([+(pump_seatstay_gap/2 + seatstay_mindia/2),
50                pump_dia/2 -seatstay_maxdia/2 -pump_seatstay_delta]) {
51       hull(){
52         for (ud=[-1,1])
53           translate([0, ud * (seatstay_maxdia-seatstay_mindia)/2])
54             circle(r=seatstay_mindia/2, $fn=50);
55       }
56     }
57   }
58 }
59
60 module BodyPlan(){
61    minkowski(){
62     circle(body_thick);
63     hull()
64       Holes(true);
65   }
66 }
67
68 module Body(){
69   translate([0,0,-body_depth/2])
70     linear_extrude(height=body_depth){
71     difference(){
72       BodyPlan();
73       Holes();
74     }
75   }
76 }
77
78 module Pin(){
79   translate([pin_x_offset, pin_y_offset, 0]) rotate([0,90,0]){
80     translate([0, 0, -pin_thick/2])
81       linear_extrude(height=pin_thick){
82       translate([-pin_base/2, 0]) square([pin_base, 50]);
83       translate([-pin_width/2, -100]) square([pin_width, 101]);
84     }
85     hull() for (d=[0,10]) {
86       translate([d*lock_hang_ratio,-d,0])
87         translate([-lock_manouvre_thick/2,
88                    -pin_workdepth-100,
89                    -lock_manouvre_len_smaller])
90         cube([lock_manouvre_thick, 100,
91               lock_manouvre_len + lock_manouvre_len_smaller]);
92     }
93     translate([-lock_manouvre_thick/2, -pin_workdepth-50,
94                -lock_hang_width/2])
95       cube([50, 50, lock_hang_width]);
96   }
97 }
98
99 module All(){
100   difference(){
101     Body();
102     Pin();
103   }
104 }
105
106 module Piece(pc,interval){
107   translate([0,-pc*interval,0])
108     intersection(){
109       rotate([0,0,pc*180-cut_rotation])
110       translate([-200,clatter_gap/2,-200]) cube([400,400,400]);
111     All();
112   }
113 }
114
115 module PiecePrint(pc){
116   rotate([0,180,0])
117     Piece(pc,4);
118 }
119
120 module PiecesPrint(){
121   PiecePrint(0);
122   PiecePrint(1);
123 }
124
125 module Demo(){
126   for (pc=[0,1])
127     Piece(pc,0);
128 }
129
130 //Holes();
131 //Demo();
132 //All();
133 //Pin();
134 //Pieces();
135 PiecesPrint();
136 //PiecePrint(0);
137 //PiecePrint(1);