chiark / gitweb /
topeak-seatstay-lock: roof/skirt: prototype
[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 = 7;
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])mirror([0,0,1]){
70     linear_extrude(height=body_depth){
71       difference(){
72         BodyPlan();
73         Holes();
74       }
75     }
76     linear_extrude(height=2.5){
77       difference(){
78         hull(){
79           BodyPlan();
80           translate([0,-7,0]) BodyPlan();
81         }
82         Holes();
83       }
84     }
85   }
86 }
87
88 module Pin(){
89   translate([pin_x_offset, pin_y_offset, 0]) rotate([0,90,0]){
90     translate([0, 0, -pin_thick/2])
91       linear_extrude(height=pin_thick){
92       translate([-pin_base/2, 0]) square([pin_base, 50]);
93       translate([-pin_width/2, -100]) square([pin_width, 101]);
94     }
95     hull() for (d=[0,10]) {
96       translate([d*lock_hang_ratio,-d,0])
97         translate([-lock_manouvre_thick/2,
98                    -pin_workdepth-100,
99                    -lock_manouvre_len_smaller])
100         cube([lock_manouvre_thick, 100,
101               lock_manouvre_len + lock_manouvre_len_smaller]);
102     }
103   }
104 }
105
106 module All(){
107   difference(){
108     Body();
109     Pin();
110   }
111 }
112
113 module Piece(pc,interval){
114   translate([0,-pc*interval,0])
115     intersection(){
116       rotate([0,0,pc*180-cut_rotation])
117       translate([-200,clatter_gap/2,-200]) cube([400,400,400]);
118     All();
119   }
120 }
121
122 module PiecePrint(pc){
123   rotate([0,180,0])
124     Piece(pc,4);
125 }
126
127 module PiecesPrint(){
128   PiecePrint(0);
129   PiecePrint(1);
130 }
131
132 module Demo(){
133   for (pc=[0,1])
134     Piece(pc,0);
135 }
136
137 //Holes();
138 //Demo();
139 //All();
140 //Pin();
141 //Pieces();
142 PiecesPrint();
143 //PiecePrint(0);
144 //PiecePrint(1);