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