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