3 // brk_*: "bracket", the Topeak MTX bracket
4 // rack_*: the Tortec rack
5 // adapt_*: the adapter, ie this file
9 // strength factor, set to 1 for real prints
13 brk_recess_actual = 5.20;
15 rack_rail_dia = 10.40 + 0.30;
16 rack_width_inner = 115.86 - 1.0; // between insides of rails
18 rear_elevation_nominal = 10.04;
19 // ^ top of rack to bottom of bracket, at rack cross rail (fam)
20 rear_to_front_distance = 230; // rack cross rail (fam) to very front end
21 rear_to_cross_rail = 35.05; // bolt centre to rail centre, rail to rear
22 rear_bolt_to_front_bolt = 155.4;
28 strap_barrel_dia = 14;
32 brk_block_z = 14.55 - 0.75;
34 brk_bolt_dia = 4.0 + 0.5;
35 brk_nearbolt_recess_dia = 8.86 + 1.5;
36 brk_nearbolt_recess_depth = 1.09 + 0.25;
38 brk_bolt_eff_len = 11.78 - 1.0; // inside of recess, to end of bolt
39 brk_bolt_len_slop = 2.0;;
40 brk_bolt_nut_th = 3.89;
41 brk_bolt_nut_across_flats = 7.86 + 0.50;
43 brk_overall_w = 90.07;
47 // "foreaftmaint" aka "fam" is the hook-like part that stops
48 // the adapter sliding forwards/backwards along the rails
49 foreaftmaint_r_slop = 0.75;
51 main_sz_y = $strf * 18;
53 grasp_thin_sz = $strf * 0.5;
54 beside_strap_sz = $strf * 8;
55 main_sz_core_z = $strf * 18;
57 // "length" in for-aft direction of interaction with rack rail
58 min_on_rail_sz_z = $strf * 25;
65 main_sz_rhs_z = max(min_on_rail_sz_z, beside_strap_sz*2 + strap_w);
66 main_sz_lhs_z = min_on_rail_sz_z;
68 main_sz_x_fam = main_sz_y;
70 brk_bottom_y = -brk_recess_actual;
71 adapt_main_top_y = brk_bottom_y - general_gap_y;
74 rack_rail_x = -(rack_width_inner/2 + rack_rail_dia/2);
75 rack_rail_outer_x = -(rack_width_inner/2 + rack_rail_dia);
77 grasp_large_r = (rack_rail_dia + grasp_sz)/2;
78 grasp_small_r = (rack_rail_dia + grasp_thin_sz)/2;
79 grasp_large_x = rack_rail_outer_x + grasp_large_r;
80 grasp_small_x = rack_rail_outer_x + grasp_small_r;
82 block_x = grasp_large_x + grasp_large_r;
83 block_y_min = adapt_main_top_y - main_sz_y;
85 strap_barrel_x = rack_width_inner/2 + strap_barrel_dia/2;
87 rack_shear_ratio = -rear_elevation_nominal / rear_to_front_distance;
89 brk_bolt_nut_top_y = -brk_nearbolt_recess_depth
90 - brk_bolt_eff_len + brk_bolt_nut_th + brk_bolt_len_slop;
92 brk_bolt_nut_r = brk_bolt_nut_across_flats/2 / cos(360/12);
94 function elevation_of_bolt_for(z) = rear_elevation_nominal
95 - (z - brk_block_z/2) * rack_shear_ratio;
97 echo(rack_shear_ratio);
99 module GraspElevation(){
101 translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
102 circle(grasp_large_r);
104 translate([ grasp_small_x, $rack_rail_y - rack_rail_dia/2 ])
105 circle(grasp_small_r);
107 translate([ rack_rail_x + grasp_large_r/2,
108 $rack_rail_y - rack_rail_dia/2 ])
109 circle(grasp_small_r);
111 translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ])
112 circle(grasp_large_r);
114 translate([ grasp_large_x + grasp_large_r/2,
115 $rack_rail_y + rack_rail_dia/2 ])
116 circle(grasp_large_r);
120 module BlockElevation(){
122 rectfromto([ +block_x, adapt_main_top_y ],
123 [ -block_x, block_y_min ]);
124 rectfromto([ -grasp_large_x, adapt_main_top_y ],
125 [ +grasp_large_x, adapt_main_top_y - 0.1 ]);
128 rectfromto([ +block_x, adapt_main_top_y ],
129 [ -block_x, block_y_min ]);
130 rectfromto([ grasp_large_x, block_y_min ],
131 [ 0, block_y_min + 0.1 ]);
135 module MainExtrude(z){
140 s = rack_shear_ratio;
141 multmatrix([ [ 1, 0, 0, 0 ],
148 module GraspFixingElevation(){
155 translate([ -block_x, block_y_min ] + [0,0.1]*1 )
158 translate([ strap_barrel_x, $strap_barrel_y ])
159 circle(strap_barrel_dia/2 + strap_guide_sz);
162 rectfromto([0, $rack_rail_y],
163 [rack_width_inner, 50]);
165 translate([ rack_rail_x, $rack_rail_y ])
166 circle(r = rack_width_inner/2 - rack_rail_x);
167 polygon([ [ -block_x-0.1, 0 ],
168 [ rack_width_inner/2, 0 ],
169 $rail_fixing_fit_corner,
170 $rail_fixing_fit_corner + [-1,-1] * fit_slope_len,
171 [ -grasp_large_x - grasp_large_r*2, block_y_min ],
172 [ -block_x-0.1 -2, block_y_min +2 ]]);
178 module StrapBarrelElevation(){
179 translate([ strap_barrel_x, $strap_barrel_y ])
180 circle(strap_barrel_dia/2);
183 // Bracket support block, goes up inside bracket
184 // Z origin is bolt hole
186 linextr( -brk_block_z/2,
188 rectfromto([ -brk_block_xw/2, adapt_main_top_y - 0.1 ],
189 [ +brk_block_xw/2, 0 ]);
193 // Z origin is bolt hole
195 linextr_y_xz( -100, 10 )
196 circle(brk_bolt_dia/2);
198 linextr_y_xz( -brk_nearbolt_recess_depth, 10)
199 circle(brk_nearbolt_recess_dia/2);
201 linextr_y_xz( -100, brk_bolt_nut_top_y ) {
202 circle( r= brk_bolt_nut_r, $fn = 6 );
203 translate([ 0, brk_bolt_nut_across_flats/2 ])
204 circle( r=brk_bolt_nut_r/2, $fn = 4);
208 module AsForeAftMaint(){
209 if ($foreaftmaint_dz) {
216 $rack_rail_y = brk_bottom_y - $elevation_nominal
217 - general_gap_y - rack_rail_dia/2;
219 $strap_barrel_y = $rack_rail_y + rack_rail_dia/2 + strap_barrel_dia/2;
221 $rail_fixing_fit_corner = [
223 $rack_rail_y - rack_rail_dia/2
226 $foreaftmaint_rail_z = brk_block_z/2 + $foreaftmaint_dz;
227 $foreaftmaint_rail_y = $rack_rail_y
228 + $foreaftmaint_rail_z * rack_shear_ratio;
232 MainExtrude(main_sz_lhs_z){
235 RackShear() MainExtrude(main_sz_rhs_z){
236 StrapBarrelElevation();
238 translate([ 0,0, brk_block_z/2]) {
244 MainExtrude(main_sz_core_z){
248 MainExtrude(max(brk_block_z, main_sz_rhs_z)){
251 rectfromto([-block_x -5, adapt_main_top_y],
252 [-grasp_large_x, block_y_min]);
255 RackShear() MainExtrude(main_sz_rhs_z){
256 GraspFixingElevation();
260 translate([0,0, main_sz_rhs_z/2]) linextr(-strap_w/2, +strap_w/2) {
261 translate([ rack_width_inner/2 - strap_th, 0 ])
262 rectfromto([ 0, -50 ], [ 50, 50 ]);
266 RackShear() AsForeAftMaint(){
267 linextr_x_yz(-main_sz_x_fam/2,
272 rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
275 ybot = $foreaftmaint_rail_y - rack_rail_dia/2 + grasp_large_r
276 - fit_slope_len * 0.5;
279 adapt_main_top_y - grasp_large_r
281 for (dx= [-1,+1] * rack_rail_dia/2)
282 translate([ -$foreaftmaint_rail_z + dx, y ])
283 circle(r= grasp_large_r);
286 translate([0, adapt_main_top_y])
287 rectfromto([-500, 0], [500, 500]);
293 RackShear() linextr(-10, main_sz_lhs_z+main_sz_rhs_z) {
296 translate([ rack_rail_x, $rack_rail_y ]){
298 for (dx = [-rack_rail_dia, 0])
300 circle(r= rack_rail_dia/2);
307 RackShear() AsForeAftMaint(){
308 // Distance from bolt hole, in backwards direction
309 cr = rack_rail_dia/2 + foreaftmaint_r_slop;
310 translate([ 0, $foreaftmaint_rail_y, $foreaftmaint_rail_z ])
311 linextr_x_yz(+rack_rail_x,
320 for (dd=[[0,0], [-1,-1], [-1,+1]]) {
322 [-1, 0] * (rack_rail_dia - fit_slope_len)
331 translate([ 0,0, brk_block_z/2]) BoltHole();
335 module Front(){ ////toplevel
336 // xxx elevation is wrong
337 Principal($elevation_nominal=
338 elevation_of_bolt_for(rear_to_cross_rail + rear_bolt_to_front_bolt),
339 $foreaftmaint_dz= 0);
342 module Rear(){ ////toplevel
343 Principal($elevation_nominal=
344 elevation_of_bolt_for(rear_to_cross_rail),
345 $foreaftmaint_dz= rear_to_cross_rail);
353 translate([ 0, -2, -4 ])
354 square(center=true, [ brk_overall_w, 1 ]);
359 module FrontDemo(){ ////toplevel
362 module RearDemo(){ ////toplevel