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