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;
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 main_sz_rhs_z = max(min_on_rail_sz_z, beside_strap_sz*2 + strap_w);
68 main_sz_lhs_z = min_on_rail_sz_z;
70 main_sz_x_fam = main_sz_y;
72 brk_bottom_y = -brk_recess_actual;
73 adapt_main_top_y = brk_bottom_y - general_gap_y;
76 rack_rail_x = -(rack_width_inner/2 + rack_rail_dia/2);
77 rack_rail_outer_x = -(rack_width_inner/2 + rack_rail_dia);
79 grasp_large_r = (rack_rail_dia + grasp_sz)/2;
80 grasp_small_r = (rack_rail_dia + grasp_thin_sz)/2;
81 grasp_large_x = rack_rail_outer_x + grasp_large_r;
82 grasp_small_x = rack_rail_outer_x + grasp_small_r;
84 block_x = grasp_large_x + grasp_large_r;
85 block_y_min = adapt_main_top_y - main_sz_y;
87 strap_barrel_x = rack_width_inner/2 + strap_barrel_dia/2;
89 rack_shear_ratio = -rear_elevation_nominal / rear_to_front_distance;
91 brk_bolt_nut_top_y = -brk_nearbolt_recess_depth
92 - brk_bolt_eff_len + brk_bolt_nut_th + brk_bolt_len_slop;
94 brk_bolt_nut_r = brk_bolt_nut_across_flats/2 / cos(360/12);
96 function elevation_of_bolt_for(z) = rear_elevation_nominal
97 + (z - brk_block_z/2) * rack_shear_ratio;
99 function rack_rail_y_of_elevation(elevation_nominal) =
100 brk_bottom_y - elevation_nominal - general_gap_y - rack_rail_dia/2;
102 echo(rack_shear_ratio);
104 module GraspElevation(){
106 translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ])
107 circle(grasp_large_r);
109 translate([ grasp_small_x, $rack_rail_y - rack_rail_dia/2 ])
110 circle(grasp_small_r);
112 translate([ rack_rail_x + grasp_large_r/2,
113 $rack_rail_y - rack_rail_dia/2 ])
114 circle(grasp_small_r);
116 translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ])
117 circle(grasp_large_r);
119 translate([ grasp_large_x + grasp_large_r/2,
120 $rack_rail_y + rack_rail_dia/2 ])
121 circle(grasp_large_r);
125 module BlockElevation(){
127 rectfromto([ +block_x, adapt_main_top_y ],
128 [ -block_x, block_y_min ]);
129 rectfromto([ -grasp_large_x, adapt_main_top_y ],
130 [ +grasp_large_x, adapt_main_top_y - 0.1 ]);
133 rectfromto([ +block_x, adapt_main_top_y ],
134 [ -block_x, block_y_min ]);
135 rectfromto([ grasp_large_x, block_y_min ],
136 [ 0, block_y_min + 0.1 ]);
140 module MainExtrude(z){
145 s = rack_shear_ratio;
146 multmatrix([ [ 1, 0, 0, 0 ],
153 module GraspFixingElevation(){
160 translate([ -block_x, block_y_min ] + [0,0.1]*1 )
163 translate([ strap_barrel_x, $strap_barrel_y ])
164 circle(strap_barrel_dia/2 + strap_guide_sz);
167 rectfromto([0, $rack_rail_y],
168 [rack_width_inner, 50]);
170 translate([ rack_rail_x, $rack_rail_y ])
171 circle(r = rack_width_inner/2 - rack_rail_x);
172 polygon([ [ -block_x-0.1, 0 ],
173 [ rack_width_inner/2, 0 ],
174 $rail_fixing_fit_corner,
175 $rail_fixing_fit_corner + [-1,-1] * fit_slope_len,
176 [ -grasp_large_x - grasp_large_r*2, block_y_min ],
177 [ -block_x-0.1 -2, block_y_min +2 ]]);
183 module StrapBarrelElevation(){
184 translate([ strap_barrel_x, $strap_barrel_y ])
185 circle(strap_barrel_dia/2);
188 // Bracket support block, goes up inside bracket
189 // Z origin is bolt hole
191 linextr( -brk_block_z/2,
193 rectfromto([ -brk_block_xw/2, adapt_main_top_y - 0.1 ],
194 [ +brk_block_xw/2, 0 ]);
198 // Z origin is bolt hole
200 linextr_y_xz( -100, 10 )
201 circle(brk_bolt_dia/2);
203 linextr_y_xz( -brk_nearbolt_recess_depth, 10)
204 circle(brk_nearbolt_recess_dia/2);
206 linextr_y_xz( -100, brk_bolt_nut_top_y ) {
207 circle( r= brk_bolt_nut_r, $fn = 6 );
208 translate([ 0, brk_bolt_nut_across_flats/2 ])
209 circle( r=brk_bolt_nut_r/2, $fn = 4);
214 if ($foreaftmaint_dz) {
221 linextr_x_yz(-main_sz_x_fam/2, +main_sz_x_fam/2)
226 module FamGraspElevation(){
229 ybot = $rack_rail_y - rack_rail_dia/2 + grasp_large_r
230 - fit_slope_len * 0.5;
233 adapt_main_top_y - grasp_large_r
235 for (dx= [-1,+1] * rack_rail_dia/2)
236 translate([ -$foreaftmaint_rail_z + dx, y ])
237 circle(r= grasp_large_r);
239 translate([0, adapt_main_top_y])
240 rectfromto([-500, 0], [500, 500]);
246 $rack_rail_y = rack_rail_y_of_elevation($elevation_nominal);
248 $strap_barrel_y = $rack_rail_y + rack_rail_dia/2 + strap_barrel_dia/2;
250 $rail_fixing_fit_corner = [
252 $rack_rail_y - rack_rail_dia/2
255 $foreaftmaint_rail_z = brk_block_z/2 + $foreaftmaint_dz - foreaftmaint_y_slop;
259 MainExtrude(main_sz_lhs_z){
262 RackShear() MainExtrude(main_sz_rhs_z){
263 StrapBarrelElevation();
265 translate([ 0,0, brk_block_z/2]) {
271 MainExtrude(main_sz_core_z){
275 MainExtrude(max(brk_block_z, main_sz_rhs_z)){
278 rectfromto([-block_x -5, adapt_main_top_y],
279 [-grasp_large_x, block_y_min]);
282 RackShear() MainExtrude(main_sz_rhs_z){
283 GraspFixingElevation();
287 translate([0,0, main_sz_rhs_z/2]) linextr(-strap_w/2, +strap_w/2) {
288 translate([ rack_width_inner/2 - strap_th, 0 ])
289 rectfromto([ 0, -50 ], [ 50, 50 ]);
294 rectfromto([ -$foreaftmaint_rail_z, adapt_main_top_y ],
296 rectfromto([ -foreaftmaint_top_block_zs[0], 0 ],
297 [ -foreaftmaint_top_block_zs[1], block_y_min] );
305 RackShear() linextr(-10, main_sz_lhs_z+main_sz_rhs_z) {
308 translate([ rack_rail_x, $rack_rail_y ]){
310 for (dx = [-rack_rail_dia, 0])
312 circle(r= rack_rail_dia/2);
320 // Distance from bolt hole, in backwards direction
321 cr = rack_rail_dia/2 + foreaftmaint_r_slop;
322 translate([ 0, $rack_rail_y, $foreaftmaint_rail_z ])
323 linextr_x_yz(+rack_rail_x,
332 for (dd=[[0,0], [-1,-1], [-1,+1]]) {
334 [-1, 0] * (rack_rail_dia - fit_slope_len)
343 translate([ 0,0, brk_block_z/2]) BoltHole();
347 module RackForDemo(){ ////toplevel
348 elevation = elevation_of_bolt_for(rear_to_cross_rail);
349 rack_rail_y = rack_rail_y_of_elevation(elevation);
351 rotate([-atan(rack_shear_ratio), 0,0])
352 translate([0, rack_rail_y, brk_block_z/2 + rack_rail_y*rack_shear_ratio]) {
353 for (m=[0]) mirror([m,0,0]) {
354 linextr(-50, 50 + rear_to_cross_rail)
355 translate([rack_rail_x, 0])
356 circle(r= rack_rail_dia/2);
358 translate([0,0, rear_to_cross_rail])
359 linextr_x_yz(rack_rail_x, -rack_rail_x)
360 circle(r= rack_rail_dia/2);
364 module Front(){ ////toplevel
365 // xxx elevation is wrong
366 Principal($elevation_nominal=
367 elevation_of_bolt_for(rear_to_cross_rail + rear_bolt_to_front_bolt),
368 $foreaftmaint_dz= 0);
371 module Rear(){ ////toplevel
372 Principal($elevation_nominal=
373 elevation_of_bolt_for(rear_to_cross_rail),
374 $foreaftmaint_dz= rear_to_cross_rail);
382 translate([ 0, -2, -4 ])
383 square(center=true, [ brk_overall_w, 1 ]);
386 translate([ 0, -brk_nearbolt_recess_depth, -4 ])
387 linextr_y_xz(-brk_bolt_eff_len, 0)
388 circle(r = brk_bolt_dia/2);
393 module FrontDemo(){ ////toplevel
396 module RearDemo(){ ////toplevel
399 module RearRackDemo(){ ////toplevel
400 rotate([atan(rack_shear_ratio),0,0]) SomeDemo() {