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 module GraspElevation(){
36   hull(){
37     translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
38       circle(grasp_large_r);
39
40     translate([ grasp_large_x, $rack_rail_y - rack_rail_dia/2 ])
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 }
47
48 module BlockElevation(){
49   rectfromto([ -rack_width_inner/2, adapt_main_top_y ],
50              [ +rack_width_inner/2, adapt_main_top_y - main_sz_y ]);
51 }
52
53 module Principal(){
54   // calculated
55   $rack_rail_y = brk_bottom_y - $elevation_nominal
56     - general_gap_y  - rack_rail_dia/2;
57
58   difference(){
59     linextr(0, main_sz_z){
60       GraspElevation();
61       BlockElevation();
62       mirror([1,0]) GraspElevation();
63     }
64
65     linextr(-10, main_sz_z+10) {
66       for (mx=[0,1]) {
67         mirror([mx,0]) {
68           translate([ rack_rail_x, $rack_rail_y ]){
69             hull(){
70               for (dx = [-rack_rail_dia, 0])
71                 translate([dx, 0])
72                   circle(r= rack_rail_dia/2);
73             }
74           }
75         }
76       }
77     }
78   }
79 }
80
81 Principal($elevation_nominal=0);