3 // use shell thickness 1.50
4 // use fill density 40%
8 tube_dia = 27.5 + 1.625 + 1.32;
13 backflange_hole_dy = -1;
14 lockshaft_dia = 14.35;
28 mountscrew_dia = 4 + 0.5;
29 clipbolt_dia = 5 + 0.6;
31 mountscrew_washer = 10;
39 tube_rear_extra_th = 1;
41 divide_shaft_w = 1.75;
43 divide_head_dx = 1.75;
48 divide_fudge_r = 4.75;
50 backflange_angle = 20;
54 lockshaft_r = [1, 1] * lockshaft_dia / 2;
57 tube_or = tube_dia/2 + tube_th;
58 back_ohw = back_gap/2 + backflange_th;
59 backflange_ymin = tube_dia/2 + backflange_d;
61 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
62 lock_0x = lock_w/2 - lock_d/2;
63 lock_0 = [lock_0x,lock_0y];
65 lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
67 module oval(sz){ // sz[0] > sz[1]
72 translate([sx * (xr-yr), 0])
79 // http://mathworld.wolfram.com/Circle-CircleIntersection.html
80 R = tube_or + join_cr;
81 r = lock_or[1] + join_cr;
82 d = dist2d( [0,0], lock_0 );
83 x = (d*d - r*r + R*R) / (2*d);
84 y = sqrt( R*R - x*x );
86 echo(lock_0x, lock_0y, R,r, d, x,y);
90 rotate(atan2(lock_0y, lock_0x)) {
98 module DivideHook(){ ////toplevel
102 translate([-1,0] * (w + d + w)){
104 translate([-(w + w+d) * sx, 0]) circle(r= w);
108 translate([-10*w, -10*w]) square([20*w, 10*w]);
116 br = tube_dia/2 + tube_th;
119 offset(r=divide_gap) DivideHook();
121 translate([-2*w,0]) mirror([0,1]) square([4*w, 4*w]);
128 br = tube_dia/2 + tube_th;
131 translate([br - tube_th/2,0]) {
137 translate([-2*w, 0]) mirror([0,1]) square(4*w);
141 module DivideSurround(){
148 translate([-(4*w + 2*d), 8*w]) circle(r=w);
153 module DivideInPlace(){
154 rotate([0,0, -divide_angle])
155 translate([ -tube_dia/2 -tube_th/2, 0])
159 module MainPlan(){ ////toplevel
165 for (t=[0, tube_rear_extra_th])
169 rotate([0,0, backflange_angle])
170 translate([-back_ohw,0]) mirror([0,1])
171 square([back_ohw*2, backflange_ymin]);
173 translate([0, lock_0y]){
179 polygon([[0,0], lock_0, [-lock_0[0], lock_0[1]]]);
183 rotate([0,0, backflange_angle])
184 translate([-back_gap/2,1]) mirror([0,1])
185 square([back_gap, backflange_ymin+2]);
190 DivideInPlace() DivideSurround();
192 translate([0, lock_0y]){
193 oval([lock_w/2, lock_d/2]);
196 circle(r = tube_dia/2);
198 DivideInPlace() DivideCut();
199 DivideInPlace() DivideCutB();
203 lockshaft_or = lockshaft_r + [clip_th,clip_th];
204 cliprecess_ymax = cliprecess_h - lockshaft_r[1];
205 clip_ymin = cliprecess_ymax - main_h;
206 clip_ogap = clip_gap + clip_th*2;
208 module ClipElevationPositive(){
211 translate([0, -lockshaft_or[1] * sqrt(2)])
212 square(center=true, 0.5);
214 translate([-lockshaft_or[0], 0])
215 square([lockshaft_or[0]*2, cliprecess_ymax]);
216 translate([-clip_ogap/2, 0]) mirror([0,1]) square([clip_ogap, -clip_ymin]);
219 module ClipElevationNegative(){
221 for (y=[0, cliprecess_ymax+1])
225 translate([-clip_gap/2, 1]) mirror([0,1]) square([clip_gap, 2-clip_ymin]);
228 module ClipElevation(){
230 ClipElevationPositive(1);
231 ClipElevationNegative(0);
235 module ExtrudeClipElevation(extra=0){
237 lock_0y + lock_d/2 + clip_d + extra,
240 linear_extrude(height= clip_d + extra*2, convexity=100)
244 module ThroughHole(r, y, z, x=-50) {
247 cylinder(r=r, h=100, $fn=20);
250 module MountingHoleCylinders(r, x=-50){
251 for (z=[ 1/4, 3/4 ]) {
252 rotate([0,0, backflange_angle])
254 -tube_dia/2 -0.5*backflange_d + backflange_hole_dy,
260 module ThroughHoles(){
261 MountingHoleCylinders(mountscrew_dia/2);
263 ThroughHole( clipbolt_dia/2,
264 lock_0y + lock_d/2 + clip_d/2 + front_th/2,
265 main_h - cliprecess_h - clip_th - clip_d/2 );
268 module SlopeTrimElevation(){
269 far_corner_nom = [ lock_0y + lock_d/2, main_h ];
270 round_centre = far_corner_nom + lock_d/2 * [0,1];
272 translate(round_centre) circle(r= lock_d/2);
273 translate([ lock_0y - lock_d/2, total_h ]) square([ lock_d + clip_d, 1 ]);
274 translate(far_corner_nom) square([clip_d*2, 1]);
281 translate([0,0, -lock_w])
282 linear_extrude(convexity=100, height=lock_w*2)
283 SlopeTrimElevation();
286 module MainPositive(){
289 linear_extrude(height=total_h, convexity=100) MainPlan();
290 ExtrudeClipElevation() ClipElevationPositive();
292 ExtrudeClipElevation(1) ClipElevationNegative();
296 module Bracket(){ ////toplevel
304 module TestTopEdge(){ ////toplevel
306 translate([0,0, -total_h])
309 translate([-200,-200,0])
314 module TestClipBoltHole(){ ////toplevel
317 translate([0, 0, -5])
319 translate([-4, lock_0y + lock_d/2 + 1, 0])
322 translate([-200, lock_0y + lock_d/2 + 0.1])
323 cube([400, 400, total_h-20]);
327 module Demo(){ ////toplevel
329 color("blue") MountingHoleCylinders(mountscrew_dia/2 - 0.1);
330 color("black") MountingHoleCylinders(mountscrew_washer/2,
334 module DivideDemo(){ ////toplevel
335 color("black") translate([0,0,-2]) MainPlan();
336 color("grey") DivideInPlace() DivideHook();
337 color("blue") translate([0,0,-4]) DivideInPlace() DivideCut();
341 //ClipElevationPositive();
346 //TestClipBoltHole();