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 tube (fam)
20 rear_to_front_distance = 230; // rack cross tube (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;
61 main_sz_z = beside_strap_sz*2 + strap_w;
62 main_sz_x_fam = main_sz_y;
64 brk_bottom_y = -brk_recess_actual;
65 adapt_main_top_y = brk_bottom_y - general_gap_y;
68 rack_rail_x = -(rack_width_inner/2 + rack_rail_dia/2);
69 rack_rail_outer_x = -(rack_width_inner/2 + rack_rail_dia);
71 grasp_large_r = (rack_rail_dia + grasp_sz)/2;
72 grasp_small_r = (rack_rail_dia + grasp_thin_sz)/2;
73 grasp_large_x = rack_rail_outer_x + grasp_large_r;
74 grasp_small_x = rack_rail_outer_x + grasp_small_r;
76 block_x = grasp_large_x + grasp_large_r;
77 block_y_min = adapt_main_top_y - main_sz_y;
79 strap_barrel_x = rack_width_inner/2 + strap_barrel_dia/2;
81 rack_shear_ratio = -rear_elevation_nominal / rear_to_front_distance;
83 brk_bolt_nut_top_y = -brk_nearbolt_recess_depth
84 - brk_bolt_eff_len + brk_bolt_nut_th + brk_bolt_len_slop;
86 brk_bolt_nut_r = brk_bolt_nut_across_flats/2 / cos(360/12);
88 function elevation_of_bolt_for(z) = rear_elevation_nominal
89 - (z - brk_block_z/2) * rack_shear_ratio;
91 echo(rack_shear_ratio);
93 module GraspElevation(){
95 translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
96 circle(grasp_large_r);
98 translate([ grasp_small_x, $rack_rail_y - rack_rail_dia/2 ])
99 circle(grasp_small_r);
101 translate([ rack_rail_x + grasp_large_r/2,
102 $rack_rail_y - rack_rail_dia/2 ])
103 circle(grasp_small_r);
105 translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ])
106 circle(grasp_large_r);
108 translate([ grasp_large_x + grasp_large_r/2,
109 $rack_rail_y + rack_rail_dia/2 ])
110 circle(grasp_large_r);
114 module BlockElevation(){
116 rectfromto([ +block_x, adapt_main_top_y ],
117 [ -block_x, block_y_min ]);
118 rectfromto([ -grasp_large_x, adapt_main_top_y ],
119 [ +grasp_large_x, adapt_main_top_y - 0.1 ]);
122 rectfromto([ +block_x, adapt_main_top_y ],
123 [ -block_x, block_y_min ]);
124 rectfromto([ grasp_large_x, block_y_min ],
125 [ 0, block_y_min + 0.1 ]);
129 module MainExtrude(){
130 linextr(0, main_sz_z)
134 s = rack_shear_ratio;
135 multmatrix([ [ 1, 0, 0, 0 ],
142 module GraspFixingElevation(){
149 translate([ -block_x, block_y_min ] + [0,0.1]*1 )
152 translate([ strap_barrel_x, $strap_barrel_y ])
153 circle(strap_barrel_dia/2 + strap_guide_sz);
156 rectfromto([0, $rack_rail_y],
157 [rack_width_inner, 50]);
159 translate([ rack_rail_x, $rack_rail_y ])
160 circle(r = rack_width_inner/2 - rack_rail_x);
161 polygon([ [ -block_x-0.1, 0 ],
162 [ rack_width_inner/2, 0 ],
163 $rail_fixing_fit_corner,
164 $rail_fixing_fit_corner + [-1,-1] * fit_slope_len,
165 [ -grasp_large_x - grasp_large_r*2, block_y_min ],
166 [ -block_x-0.1 -2, block_y_min +2 ]]);
172 module StrapBarrelElevation(){
173 translate([ strap_barrel_x, $strap_barrel_y ])
174 circle(strap_barrel_dia/2);
177 // Bracket support block, goes up inside bracket
178 // Z origin is bolt hole
180 linextr( -brk_block_z/2,
182 rectfromto([ -brk_block_xw/2, adapt_main_top_y - 0.1 ],
183 [ +brk_block_xw/2, 0 ]);
187 // Z origin is bolt hole
189 linextr_y_xz( -100, 10 )
190 circle(brk_bolt_dia/2);
192 linextr_y_xz( -brk_nearbolt_recess_depth, 10)
193 circle(brk_nearbolt_recess_dia/2);
195 linextr_y_xz( -100, brk_bolt_nut_top_y ) {
196 circle( r= brk_bolt_nut_r, $fn = 6 );
197 translate([ 0, brk_bolt_nut_across_flats/2 ])
198 circle( r=brk_bolt_nut_r/2, $fn = 4);
202 module AsForeAftMaint(){
203 if ($foreaftmaint_dz) {
210 $rack_rail_y = brk_bottom_y - $elevation_nominal
211 - general_gap_y - rack_rail_dia/2;
213 $strap_barrel_y = $rack_rail_y + rack_rail_dia/2 + strap_barrel_dia/2;
215 $rail_fixing_fit_corner = [
217 $rack_rail_y - rack_rail_dia/2
220 $foreaftmaint_rail_z = brk_block_z/2 + $foreaftmaint_dz;
221 $foreaftmaint_rail_y = $rack_rail_y
222 + $foreaftmaint_rail_z * rack_shear_ratio;
229 RackShear() MainExtrude(){
230 StrapBarrelElevation();
232 translate([ 0,0, brk_block_z/2]) {
241 RackShear() MainExtrude(){
242 GraspFixingElevation();
246 translate([0,0, main_sz_z/2]) linextr(-strap_w/2, +strap_w/2) {
247 translate([ rack_width_inner/2 - strap_th, 0 ])
248 rectfromto([ 0, -50 ], [ 50, 50 ]);
252 RackShear() AsForeAftMaint(){
253 linextr_x_yz(-main_sz_x_fam/2,
258 rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
261 ybot = $foreaftmaint_rail_y - rack_rail_dia/2 + grasp_large_r
262 - fit_slope_len * 0.5;
265 adapt_main_top_y - grasp_large_r
267 for (dx= [-1,+1] * rack_rail_dia/2)
268 translate([ -$foreaftmaint_rail_z + dx, y ])
269 circle(r= grasp_large_r);
272 translate([0, adapt_main_top_y])
273 rectfromto([-500, 0], [500, 500]);
279 RackShear() linextr(-10, main_sz_z+10) {
282 translate([ rack_rail_x, $rack_rail_y ]){
284 for (dx = [-rack_rail_dia, 0])
286 circle(r= rack_rail_dia/2);
293 // Distance from bolt hole, in backwards direction
294 RackShear() AsForeAftMaint(){
295 cr = rack_rail_dia/2 + foreaftmaint_r_slop;
296 translate([ 0, $foreaftmaint_rail_y, $foreaftmaint_rail_z ])
297 linextr_x_yz(+rack_rail_x,
306 for (dd=[[0,0], [-1,-1], [-1,+1]]) {
308 [-1, 0] * (rack_rail_dia - fit_slope_len)
317 translate([ 0,0, brk_block_z/2]) BoltHole();
321 module Front(){ ////toplevel
322 // xxx elevation is wrong
323 Principal($elevation_nominal=
324 elevation_of_bolt_for(rear_to_cross_rail + rear_bolt_to_front_bolt),
325 $foreaftmaint_dz= 0);
328 module Rear(){ ////toplevel
329 Principal($elevation_nominal=
330 elevation_of_bolt_for(rear_to_cross_rail),
331 $foreaftmaint_dz= rear_to_cross_rail);
339 translate([ 0, -2, -4 ])
340 square(center=true, [ brk_overall_w, 1 ]);
345 module FrontDemo(){ ////toplevel
348 module RearDemo(){ ////toplevel