// -*- C -*- // brk_*: "bracket", the Topeak MTX bracket // rack_*: the Tortec rack // adapt_*: the adapter, ie this file include brk_recess_actual = 5.20; rack_rail_dia = 10.40 + 0.50; rack_width_inner = 115.86 + 1.0; // between insides of rails rear_elevation_nominal = 10.04; // top of rack to bottom of bracket rear_to_front_distance = 230; general_gap_y = 1.0; strap_w = 8.0 + 1.0; strap_th = 2.5; strap_barrel_dia = 12; strap_guide_sz = 2; brk_block_xw = 68.5; brk_block_z = 14.55 - 0.75; brk_bolt_dia = 4.0 + 0.5; brk_nearbolt_recess_dia = 8.86 + 1.5; brk_nearbolt_recess_depth = 1.09 + 0.25; brk_overall_w = 90.07; main_sz_y = 20; grasp_sz = 12; beside_strap_sz = 8; $fa=10; $fs=1; // calculated main_sz_z = beside_strap_sz*2 + strap_w; brk_bottom_y = -brk_recess_actual; adapt_main_top_y = brk_bottom_y + general_gap_y; // on LHS, so -ve rack_rail_x = -(rack_width_inner/2 + rack_rail_dia/2); rack_rail_outer_x = -(rack_width_inner/2 + rack_rail_dia); grasp_large_r = (rack_rail_dia + grasp_sz)/2; grasp_large_x = rack_rail_outer_x + grasp_large_r; block_x = grasp_large_x + grasp_large_r/2; block_y_min = adapt_main_top_y - main_sz_y; strap_barrel_x = rack_width_inner/2 + strap_barrel_dia/2; rack_shear_ratio = rear_elevation_nominal / rear_to_front_distance; module GraspElevation(){ hull(){ translate([ grasp_large_x, adapt_main_top_y - grasp_large_r ]) circle(grasp_large_r); translate([ grasp_large_x, $rack_rail_y - rack_rail_dia/2 ]) circle(grasp_large_r); translate([ grasp_large_x, $rack_rail_y + rack_rail_dia/2 ]) circle(grasp_large_r); } } module BlockElevation(){ rectfromto([ +block_x, adapt_main_top_y ], [ -block_x, block_y_min ]); } module MainExtrude(){ linextr(0, main_sz_z) children(); } module RackShear(){ s = rack_shear_ratio; multmatrix([ [ 1, 0, 0, 0 ], [ 0, 1, s , 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ]) children(); } module GraspFixingElevation(){ intersection(){ union(){ mirror([1,0]) GraspElevation(); translate([ strap_barrel_x, $strap_barrel_y ]) circle(strap_barrel_dia/2 + strap_guide_sz); } union(){ rectfromto([0, $rack_rail_y], [rack_width_inner, 50]); intersection(){ translate([ rack_rail_x, $rack_rail_y ]) circle(r = rack_width_inner/2 - rack_rail_x); polygon([ [ 0, 0 ], [ rack_width_inner/2, 0 ], [ rack_width_inner/2, $rack_rail_y - rack_rail_dia/2 ], [ -block_x, block_y_min ], [ 0, block_y_min ]]); } } } } module StrapBarrelElevation(){ translate([ strap_barrel_x, $strap_barrel_y ]) circle(strap_barrel_dia/2); } // Bracket support block, goes up inside bracket // Z origin is bolt hole module BrkBlock(){ linextr( -brk_block_z/2, +brk_block_z/2 ) { rectfromto([ -brk_block_xw/2, adapt_main_top_y - 0.1 ], [ +brk_block_xw/2, 0 ]); } } // Z origin is bolt hole module BoltHole(){ linextr_y_xz( -100, 10 ) circle(brk_bolt_dia/2); linextr_y_xz( -brk_nearbolt_recess_depth, 10) circle(brk_nearbolt_recess_dia/2); } module Principal(){ // calculated $rack_rail_y = brk_bottom_y - $elevation_nominal - general_gap_y - rack_rail_dia/2; $strap_barrel_y = $rack_rail_y + rack_rail_dia/2 + strap_barrel_dia/2; difference(){ union(){ MainExtrude(){ GraspElevation(); BlockElevation(); } RackShear() MainExtrude(){ StrapBarrelElevation(); } translate([ 0,0, brk_block_z/2]) BrkBlock(); difference(){ RackShear() MainExtrude(){ GraspFixingElevation(); } translate([0,0, main_sz_z/2]) linextr(-strap_w/2, +strap_w/2) { translate([ rack_width_inner/2 - strap_th, 0 ]) rectfromto([ 0, -50 ], [ 50, 50 ]); } } } RackShear() linextr(-10, main_sz_z+10) { for (mx=[0,1]) { mirror([mx,0]) { translate([ rack_rail_x, $rack_rail_y ]){ hull(){ for (dx = [-rack_rail_dia, 0]) translate([dx, 0]) circle(r= rack_rail_dia/2); } } } } } translate([ 0,0, brk_block_z/2]) BoltHole(); } } module Rear(){ Principal($elevation_nominal=0); } module Demo(){ rotate([90, 0, 0]){ Rear(); color("blue") translate([ 0, -2, -4 ]) square(center=true, [ brk_overall_w, 1 ]); } } Demo();