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 main_sz_z = 20; // xxx
20 main_sz_y = 20;
21 grasp_sz = 12;
22
23 // calculated
24
25 brk_bottom_y = -brk_recess_actual;
26 adapt_main_top_y = brk_bottom_y + general_gap_y;
27
28 // on LHS, so -ve
29 rack_rail_x = -(rack_width_inner/2 + rack_rail_dia/2);
30 rack_rail_outer_x = -(rack_width_inner/2 + rack_rail_dia);
31
32 grasp_large_r = (rack_rail_dia + grasp_sz)/2;
33 grasp_large_x = rack_rail_outer_x + grasp_large_r;
34
35 block_x = grasp_large_x + grasp_large_r/2;
36 block_y_min = adapt_main_top_y - main_sz_y;
37
38 module GraspElevation(){
39   hull(){
40     translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
41       circle(grasp_large_r);
42
43     translate([ grasp_large_x, $rack_rail_y - rack_rail_dia/2 ])
44       circle(grasp_large_r);
45
46     translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ])
47       circle(grasp_large_r);
48   }
49 }
50
51 module BlockElevation(){
52   rectfromto([ +block_x, adapt_main_top_y ],
53              [ -block_x, block_y_min ]);
54 }
55
56 module GraspFixingElevation(){
57   intersection(){
58     mirror([1,0]) GraspElevation();
59     union(){
60       rectfromto([0, $rack_rail_y],
61                  [rack_width_inner, 50]);
62       intersection(){
63         translate([ rack_rail_x, $rack_rail_y ])
64           circle(r = rack_width_inner/2 - rack_rail_x, $fa=1);
65         polygon([ [ 0, 0 ],
66                   [ rack_width_inner/2, 0 ],
67                   [ rack_width_inner/2, $rack_rail_y - rack_rail_dia/2 ],
68                   [ -block_x, block_y_min ],
69                   [ 0, block_y_min ]]);
70       }
71     }
72   }
73 }
74
75 module Principal(){
76   // calculated
77   $rack_rail_y = brk_bottom_y - $elevation_nominal
78     - general_gap_y  - rack_rail_dia/2;
79
80   difference(){
81     linextr(0, main_sz_z){
82       GraspElevation();
83       BlockElevation();
84       GraspFixingElevation();
85     }
86
87     linextr(-10, main_sz_z+10) {
88       for (mx=[0,1]) {
89         mirror([mx,0]) {
90           translate([ rack_rail_x, $rack_rail_y ]){
91             hull(){
92               for (dx = [-rack_rail_dia, 0])
93                 translate([dx, 0])
94                   circle(r= rack_rail_dia/2);
95             }
96           }
97         }
98       }
99     }
100   }
101 }
102
103 Principal($elevation_nominal=0);