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(z) = rear_elevation_nominal - z * rack_shear_ratio;
90 echo(rack_shear_ratio);
92 module GraspElevation(){
94 translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
95 circle(grasp_large_r);
97 translate([ grasp_small_x, $rack_rail_y - rack_rail_dia/2 ])
98 circle(grasp_small_r);
100 translate([ rack_rail_x + grasp_large_r/2,
101 $rack_rail_y - rack_rail_dia/2 ])
102 circle(grasp_small_r);
104 translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ])
105 circle(grasp_large_r);
107 translate([ grasp_large_x + grasp_large_r/2,
108 $rack_rail_y + rack_rail_dia/2 ])
109 circle(grasp_large_r);
113 module BlockElevation(){
115 rectfromto([ +block_x, adapt_main_top_y ],
116 [ -block_x, block_y_min ]);
117 rectfromto([ -grasp_large_x, adapt_main_top_y ],
118 [ +grasp_large_x, adapt_main_top_y - 0.1 ]);
121 rectfromto([ +block_x, adapt_main_top_y ],
122 [ -block_x, block_y_min ]);
123 rectfromto([ grasp_large_x, block_y_min ],
124 [ 0, block_y_min + 0.1 ]);
128 module MainExtrude(){
129 linextr(0, main_sz_z)
133 s = rack_shear_ratio;
134 multmatrix([ [ 1, 0, 0, 0 ],
141 module GraspFixingElevation(){
148 translate([ -block_x, block_y_min ] + [0,0.1]*1 )
151 translate([ strap_barrel_x, $strap_barrel_y ])
152 circle(strap_barrel_dia/2 + strap_guide_sz);
155 rectfromto([0, $rack_rail_y],
156 [rack_width_inner, 50]);
158 translate([ rack_rail_x, $rack_rail_y ])
159 circle(r = rack_width_inner/2 - rack_rail_x);
160 polygon([ [ -block_x-0.1, 0 ],
161 [ rack_width_inner/2, 0 ],
162 $rail_fixing_fit_corner,
163 $rail_fixing_fit_corner + [-1,-1] * fit_slope_len,
164 [ -grasp_large_x - grasp_large_r*2, block_y_min ],
165 [ -block_x-0.1 -2, block_y_min +2 ]]);
171 module StrapBarrelElevation(){
172 translate([ strap_barrel_x, $strap_barrel_y ])
173 circle(strap_barrel_dia/2);
176 // Bracket support block, goes up inside bracket
177 // Z origin is bolt hole
179 linextr( -brk_block_z/2,
181 rectfromto([ -brk_block_xw/2, adapt_main_top_y - 0.1 ],
182 [ +brk_block_xw/2, 0 ]);
186 // Z origin is bolt hole
188 linextr_y_xz( -100, 10 )
189 circle(brk_bolt_dia/2);
191 linextr_y_xz( -brk_nearbolt_recess_depth, 10)
192 circle(brk_nearbolt_recess_dia/2);
194 linextr_y_xz( -100, brk_bolt_nut_top_y ) {
195 circle( r= brk_bolt_nut_r, $fn = 6 );
196 translate([ 0, brk_bolt_nut_across_flats/2 ])
197 circle( r=brk_bolt_nut_r/2, $fn = 4);
201 module AsForeAftMaint(){
202 if ($foreaftmaint_dz) {
209 $rack_rail_y = brk_bottom_y - $elevation_nominal
210 - general_gap_y - rack_rail_dia/2;
212 $strap_barrel_y = $rack_rail_y + rack_rail_dia/2 + strap_barrel_dia/2;
214 $rail_fixing_fit_corner = [
216 $rack_rail_y - rack_rail_dia/2
219 $foreaftmaint_rail_z = brk_block_z/2 + $foreaftmaint_dz;
220 $foreaftmaint_rail_y = $rack_rail_y
221 + $foreaftmaint_rail_z * rack_shear_ratio;
228 RackShear() MainExtrude(){
229 StrapBarrelElevation();
231 translate([ 0,0, brk_block_z/2]) {
240 RackShear() MainExtrude(){
241 GraspFixingElevation();
245 translate([0,0, main_sz_z/2]) linextr(-strap_w/2, +strap_w/2) {
246 translate([ rack_width_inner/2 - strap_th, 0 ])
247 rectfromto([ 0, -50 ], [ 50, 50 ]);
251 RackShear() AsForeAftMaint(){
252 linextr_x_yz(-main_sz_x_fam/2,
257 rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
260 ybot = $foreaftmaint_rail_y - rack_rail_dia/2 + grasp_large_r
261 - fit_slope_len * 0.5;
264 adapt_main_top_y - grasp_large_r
266 for (dx= [-1,+1] * rack_rail_dia/2)
267 translate([ -$foreaftmaint_rail_z + dx, y ])
268 circle(r= grasp_large_r);
271 translate([0, adapt_main_top_y])
272 rectfromto([-500, 0], [500, 500]);
278 RackShear() linextr(-10, main_sz_z+10) {
281 translate([ rack_rail_x, $rack_rail_y ]){
283 for (dx = [-rack_rail_dia, 0])
285 circle(r= rack_rail_dia/2);
292 // Distance from bolt hole, in backwards direction
293 RackShear() AsForeAftMaint(){
294 cr = rack_rail_dia/2 + foreaftmaint_r_slop;
295 translate([ 0, $foreaftmaint_rail_y, $foreaftmaint_rail_z ])
296 linextr_x_yz(+rack_rail_x,
305 for (dd=[[0,0], [-1,-1], [-1,+1]]) {
307 [-1, 0] * (rack_rail_dia - fit_slope_len)
316 translate([ 0,0, brk_block_z/2]) BoltHole();
320 module Front(){ ////toplevel
321 // xxx elevation is wrong
322 Principal($elevation_nominal=
323 elevation_of(rear_to_cross_rail + rear_bolt_to_front_bolt),
324 $foreaftmaint_dz= 0);
327 module Rear(){ ////toplevel
328 Principal($elevation_nominal=
329 elevation_of(rear_to_cross_rail),
330 $foreaftmaint_dz= rear_to_cross_rail);
338 translate([ 0, -2, -4 ])
339 square(center=true, [ brk_overall_w, 1 ]);
344 module FrontDemo(){ ////toplevel
347 module RearDemo(){ ////toplevel