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