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.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;
52 main_sz_y = $strf * 18;
54 grasp_thin_sz = $strf * 0.5;
55 beside_strap_sz = $strf * 8;
56 main_sz_core_z = $strf * 18;
58 // "length" in for-aft direction of interaction with rack rail
59 min_on_rail_sz_z = $strf * 25;
66 main_sz_rhs_z = max(min_on_rail_sz_z, beside_strap_sz*2 + strap_w);
67 main_sz_lhs_z = min_on_rail_sz_z;
69 main_sz_x_fam = main_sz_y;
71 brk_bottom_y = -brk_recess_actual;
72 adapt_main_top_y = brk_bottom_y - general_gap_y;
75 rack_rail_x = -(rack_width_inner/2 + rack_rail_dia/2);
76 rack_rail_outer_x = -(rack_width_inner/2 + rack_rail_dia);
78 grasp_large_r = (rack_rail_dia + grasp_sz)/2;
79 grasp_small_r = (rack_rail_dia + grasp_thin_sz)/2;
80 grasp_large_x = rack_rail_outer_x + grasp_large_r;
81 grasp_small_x = rack_rail_outer_x + grasp_small_r;
83 block_x = grasp_large_x + grasp_large_r;
84 block_y_min = adapt_main_top_y - main_sz_y;
86 strap_barrel_x = rack_width_inner/2 + strap_barrel_dia/2;
88 rack_shear_ratio = -rear_elevation_nominal / rear_to_front_distance;
90 brk_bolt_nut_top_y = -brk_nearbolt_recess_depth
91 - brk_bolt_eff_len + brk_bolt_nut_th + brk_bolt_len_slop;
93 brk_bolt_nut_r = brk_bolt_nut_across_flats/2 / cos(360/12);
95 function elevation_of_bolt_for(z) = rear_elevation_nominal
96 + (z - brk_block_z/2) * rack_shear_ratio;
98 function rack_rail_y_of_elevation(elevation_nominal) =
99 brk_bottom_y - elevation_nominal - general_gap_y - rack_rail_dia/2;
101 echo(rack_shear_ratio);
103 module GraspElevation(){
105 translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
106 circle(grasp_large_r);
108 translate([ grasp_small_x, $rack_rail_y - rack_rail_dia/2 ])
109 circle(grasp_small_r);
111 translate([ rack_rail_x + grasp_large_r/2,
112 $rack_rail_y - rack_rail_dia/2 ])
113 circle(grasp_small_r);
115 translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ])
116 circle(grasp_large_r);
118 translate([ grasp_large_x + grasp_large_r/2,
119 $rack_rail_y + rack_rail_dia/2 ])
120 circle(grasp_large_r);
124 module BlockElevation(){
126 rectfromto([ +block_x, adapt_main_top_y ],
127 [ -block_x, block_y_min ]);
128 rectfromto([ -grasp_large_x, adapt_main_top_y ],
129 [ +grasp_large_x, adapt_main_top_y - 0.1 ]);
132 rectfromto([ +block_x, adapt_main_top_y ],
133 [ -block_x, block_y_min ]);
134 rectfromto([ grasp_large_x, block_y_min ],
135 [ 0, block_y_min + 0.1 ]);
139 module MainExtrude(z){
144 s = rack_shear_ratio;
145 multmatrix([ [ 1, 0, 0, 0 ],
152 module GraspFixingElevation(){
159 translate([ -block_x, block_y_min ] + [0,0.1]*1 )
162 translate([ strap_barrel_x, $strap_barrel_y ])
163 circle(strap_barrel_dia/2 + strap_guide_sz);
166 rectfromto([0, $rack_rail_y],
167 [rack_width_inner, 50]);
169 translate([ rack_rail_x, $rack_rail_y ])
170 circle(r = rack_width_inner/2 - rack_rail_x);
171 polygon([ [ -block_x-0.1, 0 ],
172 [ rack_width_inner/2, 0 ],
173 $rail_fixing_fit_corner,
174 $rail_fixing_fit_corner + [-1,-1] * fit_slope_len,
175 [ -grasp_large_x - grasp_large_r*2, block_y_min ],
176 [ -block_x-0.1 -2, block_y_min +2 ]]);
182 module StrapBarrelElevation(){
183 translate([ strap_barrel_x, $strap_barrel_y ])
184 circle(strap_barrel_dia/2);
187 // Bracket support block, goes up inside bracket
188 // Z origin is bolt hole
190 linextr( -brk_block_z/2,
192 rectfromto([ -brk_block_xw/2, adapt_main_top_y - 0.1 ],
193 [ +brk_block_xw/2, 0 ]);
197 // Z origin is bolt hole
199 linextr_y_xz( -100, 10 )
200 circle(brk_bolt_dia/2);
202 linextr_y_xz( -brk_nearbolt_recess_depth, 10)
203 circle(brk_nearbolt_recess_dia/2);
205 linextr_y_xz( -100, brk_bolt_nut_top_y ) {
206 circle( r= brk_bolt_nut_r, $fn = 6 );
207 translate([ 0, brk_bolt_nut_across_flats/2 ])
208 circle( r=brk_bolt_nut_r/2, $fn = 4);
213 if ($foreaftmaint_dz) {
220 linextr_x_yz(-main_sz_x_fam/2, +main_sz_x_fam/2)
225 module FamGraspElevation(){
228 ybot = $rack_rail_y - rack_rail_dia/2 + grasp_large_r
229 - fit_slope_len * 0.5;
232 adapt_main_top_y - grasp_large_r
234 for (dx= [-1,+1] * rack_rail_dia/2)
235 translate([ -$foreaftmaint_rail_z + dx, y ])
236 circle(r= grasp_large_r);
238 translate([0, adapt_main_top_y])
239 rectfromto([-500, 0], [500, 500]);
245 $rack_rail_y = rack_rail_y_of_elevation($elevation_nominal);
247 $strap_barrel_y = $rack_rail_y + rack_rail_dia/2 + strap_barrel_dia/2;
249 $rail_fixing_fit_corner = [
251 $rack_rail_y - rack_rail_dia/2
254 $foreaftmaint_rail_z = brk_block_z/2 + $foreaftmaint_dz - foreaftmaint_y_slop;
258 MainExtrude(main_sz_lhs_z){
261 RackShear() MainExtrude(main_sz_rhs_z){
262 StrapBarrelElevation();
264 translate([ 0,0, brk_block_z/2]) {
270 MainExtrude(main_sz_core_z){
274 MainExtrude(max(brk_block_z, main_sz_rhs_z)){
277 rectfromto([-block_x -5, adapt_main_top_y],
278 [-grasp_large_x, block_y_min]);
281 RackShear() MainExtrude(main_sz_rhs_z){
282 GraspFixingElevation();
286 translate([0,0, main_sz_rhs_z/2]) linextr(-strap_w/2, +strap_w/2) {
287 translate([ rack_width_inner/2 - strap_th, 0 ])
288 rectfromto([ 0, -50 ], [ 50, 50 ]);
293 rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
302 RackShear() linextr(-10, main_sz_lhs_z+main_sz_rhs_z) {
305 translate([ rack_rail_x, $rack_rail_y ]){
307 for (dx = [-rack_rail_dia, 0])
309 circle(r= rack_rail_dia/2);
317 // Distance from bolt hole, in backwards direction
318 cr = rack_rail_dia/2 + foreaftmaint_r_slop;
319 translate([ 0, $rack_rail_y, $foreaftmaint_rail_z ])
320 linextr_x_yz(+rack_rail_x,
329 for (dd=[[0,0], [-1,-1], [-1,+1]]) {
331 [-1, 0] * (rack_rail_dia - fit_slope_len)
340 translate([ 0,0, brk_block_z/2]) BoltHole();
344 module RackForDemo(){ ////toplevel
345 elevation = elevation_of_bolt_for(rear_to_cross_rail);
346 rack_rail_y = rack_rail_y_of_elevation(elevation);
348 rotate([-atan(rack_shear_ratio), 0,0])
349 translate([0, rack_rail_y, brk_block_z/2 + rack_rail_y*rack_shear_ratio]) {
350 for (m=[0]) mirror([m,0,0]) {
351 linextr(-50, 50 + rear_to_cross_rail)
352 translate([rack_rail_x, 0])
353 circle(r= rack_rail_dia/2);
355 translate([0,0, rear_to_cross_rail])
356 linextr_x_yz(rack_rail_x, -rack_rail_x)
357 circle(r= rack_rail_dia/2);
361 module Front(){ ////toplevel
362 // xxx elevation is wrong
363 Principal($elevation_nominal=
364 elevation_of_bolt_for(rear_to_cross_rail + rear_bolt_to_front_bolt),
365 $foreaftmaint_dz= 0);
368 module Rear(){ ////toplevel
369 Principal($elevation_nominal=
370 elevation_of_bolt_for(rear_to_cross_rail),
371 $foreaftmaint_dz= rear_to_cross_rail);
379 translate([ 0, -2, -4 ])
380 square(center=true, [ brk_overall_w, 1 ]);
383 translate([ 0, -brk_nearbolt_recess_depth, -4 ])
384 linextr_y_xz(-brk_bolt_eff_len, 0)
385 circle(r = brk_bolt_dia/2);
390 module FrontDemo(){ ////toplevel
393 module RearDemo(){ ////toplevel
396 module RearRackDemo(){ ////toplevel
397 rotate([atan(rack_shear_ratio),0,0]) SomeDemo() {