chiark / gitweb /
topeak-mtx-tortec-expeditionrack-adapter: wip
[reprap-play.git] / topeak-mtx-tortec-expeditionrack-adapter.scad
1 // -*- C -*-
2
3 // brk_*: "bracket", the Topeak MTX bracket
4 // rack_*: the Tortec rack
5 // adapt_*: the adapter, ie this file
6
7 include <utils.scad>
8
9 brk_recess_actual = 5.20;
10
11 rack_rail_dia = 10.40 + 0.50;
12 rack_width_inner = 115.86 + 1.0; // between insides of rails
13
14 rear_elevation_nominal = 10.04; // top of rack to bottom of bracket
15 rear_to_front_distance = 230;
16
17 general_gap_y = 1.0;
18
19 strap_w = 8.0;
20 strap_th = 2.5;
21 strap_barrel_dia = 8;
22
23 main_sz_y = 20;
24 grasp_sz = 12;
25 beside_strap_sz = 8;
26
27 // calculated
28
29 main_sz_z = beside_strap_sz*2 + strap_w;
30
31 brk_bottom_y = -brk_recess_actual;
32 adapt_main_top_y = brk_bottom_y + general_gap_y;
33
34 // on LHS, so -ve
35 rack_rail_x = -(rack_width_inner/2 + rack_rail_dia/2);
36 rack_rail_outer_x = -(rack_width_inner/2 + rack_rail_dia);
37
38 grasp_large_r = (rack_rail_dia + grasp_sz)/2;
39 grasp_large_x = rack_rail_outer_x + grasp_large_r;
40
41 block_x = grasp_large_x + grasp_large_r/2;
42 block_y_min = adapt_main_top_y - main_sz_y;
43
44 module GraspElevation(){
45   hull(){
46     translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
47       circle(grasp_large_r);
48
49     translate([ grasp_large_x, $rack_rail_y - rack_rail_dia/2 ])
50       circle(grasp_large_r);
51
52     translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ])
53       circle(grasp_large_r);
54   }
55 }
56
57 module BlockElevation(){
58   rectfromto([ +block_x, adapt_main_top_y ],
59              [ -block_x, block_y_min ]);
60 }
61
62 module GraspFixingElevation(){
63   intersection(){
64     mirror([1,0]) GraspElevation();
65     union(){
66       rectfromto([0, $rack_rail_y],
67                  [rack_width_inner, 50]);
68       intersection(){
69         translate([ rack_rail_x, $rack_rail_y ])
70           circle(r = rack_width_inner/2 - rack_rail_x, $fa=1);
71         polygon([ [ 0, 0 ],
72                   [ rack_width_inner/2, 0 ],
73                   [ rack_width_inner/2, $rack_rail_y - rack_rail_dia/2 ],
74                   [ -block_x, block_y_min ],
75                   [ 0, block_y_min ]]);
76       }
77     }
78   }
79 }
80
81 module StrapBarrelElevation(){
82   translate([ rack_width_inner/2 + strap_barrel_dia/2,
83               $rack_rail_y + rack_rail_dia/2 + strap_barrel_dia/2 ])
84     circle(strap_barrel_dia/2);
85 }
86
87 module Principal(){
88   // calculated
89   $rack_rail_y = brk_bottom_y - $elevation_nominal
90     - general_gap_y  - rack_rail_dia/2;
91
92   difference(){
93     union(){
94       linextr(0, main_sz_z){
95         GraspElevation();
96         BlockElevation();
97         StrapBarrelElevation();
98       }
99
100       difference(){
101         linextr(0, main_sz_z){
102           GraspFixingElevation();
103         }
104
105         translate([0,0, main_sz_z/2]) linextr(-strap_w/2, +strap_w/2) {
106           translate([ rack_width_inner/2 - strap_th, 0 ])
107             rectfromto([ 0, -50 ], [ 50, 50 ]);
108         }
109       }
110     }
111
112     linextr(-10, main_sz_z+10) {
113       for (mx=[0,1]) {
114         mirror([mx,0]) {
115           translate([ rack_rail_x, $rack_rail_y ]){
116             hull(){
117               for (dx = [-rack_rail_dia, 0])
118                 translate([dx, 0])
119                   circle(r= rack_rail_dia/2);
120             }
121           }
122         }
123       }
124     }
125   }
126 }
127
128 Principal($elevation_nominal=0);