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 = 43.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.00;
34 brk_bolt_dia = 5.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; // inside of recess, to end of bolt
39 brk_bolt_len_slop = 0.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.0;
50 foreaftmaint_y_slop = -0.25;
51 foreaftmaint_top_block_zs = [34.0, 39.0]; // rearwards from bolt hole
53 main_sz_y = $strf * 18;
55 grasp_thin_sz = $strf * 0.5;
56 beside_strap_sz = $strf * 8;
57 main_sz_core_z = $strf * 18;
59 // "length" in for-aft direction of interaction with rack rail
60 min_on_rail_sz_z = $strf * 25;
67 bolt_z = -brk_block_z/2;
69 main_sz_rhs_z = max(min_on_rail_sz_z, beside_strap_sz*2 + strap_w);
70 main_sz_lhs_z = min_on_rail_sz_z;
72 main_sz_x_fam = main_sz_y;
74 brk_bottom_y = -brk_recess_actual;
75 adapt_main_top_y = brk_bottom_y - general_gap_y;
78 rack_rail_x = -(rack_width_inner/2 + rack_rail_dia/2);
79 rack_rail_outer_x = -(rack_width_inner/2 + rack_rail_dia);
81 grasp_large_r = (rack_rail_dia + grasp_sz)/2;
82 grasp_small_r = (rack_rail_dia + grasp_thin_sz)/2;
83 grasp_large_x = rack_rail_outer_x + grasp_large_r;
84 grasp_small_x = rack_rail_outer_x + grasp_small_r;
86 block_x = grasp_large_x + grasp_large_r;
87 block_y_min = adapt_main_top_y - main_sz_y;
89 strap_barrel_x = rack_width_inner/2 + strap_barrel_dia/2;
91 rack_shear_ratio = -rear_elevation_nominal / rear_to_front_distance;
93 brk_bolt_nut_top_y = -brk_nearbolt_recess_depth
94 - brk_bolt_eff_len + brk_bolt_nut_th + brk_bolt_len_slop;
96 brk_bolt_nut_r = brk_bolt_nut_across_flats/2 / cos(360/12);
98 function elevation_of_bolt_for(z) = rear_elevation_nominal
99 + (z - brk_block_z/2) * rack_shear_ratio;
101 function rack_rail_y_of_elevation(elevation_nominal) =
102 brk_bottom_y - elevation_nominal - general_gap_y - rack_rail_dia/2;
104 echo(rack_shear_ratio);
106 module GraspElevation(){
108 translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
109 circle(grasp_large_r);
111 translate([ grasp_small_x, $rack_rail_y - rack_rail_dia/2 ])
112 circle(grasp_small_r);
114 translate([ rack_rail_x + grasp_large_r/2,
115 $rack_rail_y - rack_rail_dia/2 ])
116 circle(grasp_small_r);
118 translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ])
119 circle(grasp_large_r);
121 translate([ grasp_large_x + grasp_large_r/2,
122 $rack_rail_y + rack_rail_dia/2 ])
123 circle(grasp_large_r);
127 module BlockElevation(){
129 rectfromto([ +block_x, adapt_main_top_y ],
130 [ -block_x, block_y_min ]);
131 rectfromto([ -grasp_large_x, adapt_main_top_y ],
132 [ +grasp_large_x, adapt_main_top_y - 0.1 ]);
135 rectfromto([ +block_x, adapt_main_top_y ],
136 [ -block_x, block_y_min ]);
137 rectfromto([ grasp_large_x, block_y_min ],
138 [ 0, block_y_min + 0.1 ]);
142 module MainExtrude(z){
147 s = rack_shear_ratio;
148 multmatrix([ [ 1, 0, 0, 0 ],
155 module GraspFixingElevation(){
162 translate([ -block_x, block_y_min ] + [0,0.1]*1 )
165 translate([ strap_barrel_x, $strap_barrel_y ])
166 circle(strap_barrel_dia/2 + strap_guide_sz);
169 rectfromto([0, $rack_rail_y],
170 [rack_width_inner, 50]);
172 translate([ rack_rail_x, $rack_rail_y ])
173 circle(r = rack_width_inner/2 - rack_rail_x);
174 polygon([ [ -block_x-0.1, 0 ],
175 [ rack_width_inner/2, 0 ],
176 $rail_fixing_fit_corner,
177 $rail_fixing_fit_corner + [-1,-1] * fit_slope_len,
178 [ -grasp_large_x - grasp_large_r*2, block_y_min ],
179 [ -block_x-0.1 -2, block_y_min +2 ]]);
185 module StrapBarrelElevation(){
186 translate([ strap_barrel_x, $strap_barrel_y ])
187 circle(strap_barrel_dia/2);
190 // Bracket support block, goes up inside bracket
191 // Z origin is bolt hole
193 linextr( -brk_block_z/2,
195 rectfromto([ -brk_block_xw/2, adapt_main_top_y - 0.1 ],
196 [ +brk_block_xw/2, 0 ]);
200 // Z origin is bolt hole
202 linextr_y_xz( -100, 10 )
203 circle(brk_bolt_dia/2);
205 linextr_y_xz( -brk_nearbolt_recess_depth, 10)
206 circle(brk_nearbolt_recess_dia/2);
208 linextr_y_xz( -100, brk_bolt_nut_top_y ) {
209 circle( r= brk_bolt_nut_r, $fn = 6 );
210 translate([ 0, brk_bolt_nut_across_flats/2 ])
211 circle( r=brk_bolt_nut_r/2, $fn = 4);
216 if ($foreaftmaint_dz) {
223 linextr_x_yz(-main_sz_x_fam/2, +main_sz_x_fam/2)
228 module FamGraspElevation(){
231 ybot = $rack_rail_y - rack_rail_dia/2 + grasp_large_r
232 - fit_slope_len * 0.5;
235 adapt_main_top_y - grasp_large_r
237 for (dx= [-1,+1] * rack_rail_dia/2)
238 translate([ -$foreaftmaint_rail_z + dx, y ])
239 circle(r= grasp_large_r);
241 translate([0, adapt_main_top_y])
242 rectfromto([-500, 0], [500, 500]);
248 $rack_rail_y = rack_rail_y_of_elevation($elevation_nominal);
250 $strap_barrel_y = $rack_rail_y + rack_rail_dia/2 + strap_barrel_dia/2;
252 $rail_fixing_fit_corner = [
254 $rack_rail_y - rack_rail_dia/2
257 $foreaftmaint_rail_z = brk_block_z/2 + $foreaftmaint_dz - foreaftmaint_y_slop;
261 MainExtrude(main_sz_lhs_z){
264 RackShear() MainExtrude(main_sz_rhs_z){
265 StrapBarrelElevation();
267 translate([ 0,0, brk_block_z/2]) {
273 MainExtrude(main_sz_core_z){
277 MainExtrude(max(brk_block_z, main_sz_rhs_z)){
280 rectfromto([-block_x -5, adapt_main_top_y],
281 [-grasp_large_x, block_y_min]);
284 RackShear() MainExtrude(main_sz_rhs_z){
285 GraspFixingElevation();
289 translate([0,0, main_sz_rhs_z/2]) linextr(-strap_w/2, +strap_w/2) {
290 translate([ rack_width_inner/2 - strap_th, 0 ])
291 rectfromto([ 0, -50 ], [ 50, 50 ]);
296 rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
298 rectfromto([ -foreaftmaint_top_block_zs[0] + bolt_z, 0 ],
299 [ -foreaftmaint_top_block_zs[1] + bolt_z, block_y_min] );
307 RackShear() linextr(-10, main_sz_lhs_z+main_sz_rhs_z) {
310 translate([ rack_rail_x, $rack_rail_y ]){
312 for (dx = [-rack_rail_dia, 0])
314 circle(r= rack_rail_dia/2);
322 // Distance from bolt hole, in backwards direction
323 cr = rack_rail_dia/2 + foreaftmaint_r_slop;
324 translate([ 0, $rack_rail_y, $foreaftmaint_rail_z ])
325 linextr_x_yz(+rack_rail_x,
334 for (dd=[[0,0], [-1,-1], [-1,+1]]) {
336 [-1, 0] * (rack_rail_dia - fit_slope_len)
345 translate([ 0,0, brk_block_z/2]) BoltHole();
349 module RackForDemo(){ ////toplevel
350 elevation = elevation_of_bolt_for(rear_to_cross_rail);
351 rack_rail_y = rack_rail_y_of_elevation(elevation);
353 rotate([-atan(rack_shear_ratio), 0,0])
354 translate([0, rack_rail_y, brk_block_z/2 + rack_rail_y*rack_shear_ratio]) {
355 for (m=[0]) mirror([m,0,0]) {
356 linextr(-50, 50 + rear_to_cross_rail)
357 translate([rack_rail_x, 0])
358 circle(r= rack_rail_dia/2);
360 translate([0,0, rear_to_cross_rail])
361 linextr_x_yz(rack_rail_x, -rack_rail_x)
362 circle(r= rack_rail_dia/2);
366 module Front(){ ////toplevel
367 // xxx elevation is wrong
368 Principal($elevation_nominal=
369 elevation_of_bolt_for(rear_to_cross_rail + rear_bolt_to_front_bolt),
370 $foreaftmaint_dz= 0);
373 module Rear(){ ////toplevel
374 Principal($elevation_nominal=
375 elevation_of_bolt_for(rear_to_cross_rail),
376 $foreaftmaint_dz= rear_to_cross_rail);
384 translate([ 0, -2, -4 ])
385 square(center=true, [ brk_overall_w, 1 ]);
388 translate([ 0, -brk_nearbolt_recess_depth, -4 ])
389 linextr_y_xz(-brk_bolt_eff_len, 0)
390 circle(r = brk_bolt_dia/2);
395 module FrontDemo(){ ////toplevel
398 module RearDemo(){ ////toplevel
401 module RearRackDemo(){ ////toplevel
402 rotate([atan(rack_shear_ratio),0,0]) SomeDemo() {