// -*- C -*-
+// use shell thickness 1.50
+// use fill density 40%
+
+include <funcs.scad>
+
tube_dia = 27.5 + 1.625;
lock_w = 42.5 + 0.5;
lock_d = 28.0 + 0.5;
main_h = 45.0;
backflange_d = 12;
+backflange_hole_dy = -1;
lockshaft_dia = 14.35;
cliprecess_h = 16;
total_h = 45;
-back_gap = 10;
-main_th = 2.5;
-tube_th = 2.25;
+back_gap = 12.5;
+main_th = 3.50;
+tube_th = 4.00;
midweb_d = 3;
clip_th = 3.5;
clip_d = 22.0;
mountscrew_dia = 4 + 0.5;
-clipbolt_dia = 5 + 0.1;
+clipbolt_dia = 5 + 0.6;
+
+mountscrew_washer = 10;
-backflange_th = 3.5;
+backflange_th = 4.5;
$fn=50;
+join_cr = 9;
+
+tube_rear_extra_th = 1;
+
+divide_shaft_w = 1.75;
+divide_shaft_l = 1.5;
+divide_head_dx = 1.75;
+divide_head_th = 1.5;
+divide_gap = 0.50;
+divide_heads = 2;
+
+divide_angle = 26;
+divide_fudge_r = 4.75;
+divide_around = 3.5;
+
+backflange_angle = 20;
+
// calculated
lockshaft_r = [1, 1] * lockshaft_dia / 2;
tube_or = tube_dia/2 + tube_th;
back_ohw = back_gap/2 + backflange_th;
-backflange_ymin = tube_or+backflange_d;
+backflange_ymin = tube_dia/2 + backflange_d;
lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
+lock_0x = lock_w/2 - lock_d/2;
+lock_0 = [lock_0x,lock_0y];
lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
}
}
+module JoinCircs(jr){
+ // http://mathworld.wolfram.com/Circle-CircleIntersection.html
+ R = tube_or + join_cr;
+ r = lock_or[1] + join_cr;
+ d = dist2d( [0,0], lock_0 );
+ x = (d*d - r*r + R*R) / (2*d);
+ y = sqrt( R*R - x*x );
+
+ echo(lock_0x, lock_0y, R,r, d, x,y);
+
+ for (m=[0,1]) {
+ mirror([m,0]) {
+ rotate(atan2(lock_0y, lock_0x)) {
+ translate([x,-y])
+ circle(r= jr);
+ }
+ }
+ }
+}
+
+module DividePlan(xl=10){
+ w = divide_shaft_w;
+ g = divide_gap;
+ l = divide_shaft_l + g;
+ t = divide_head_th + g;
+ dx = divide_head_dx;
+ for (m=[0,1]) mirror([m,0]) {
+ translate([w, 0]) square([xl, g]);
+ for (i=[0:divide_heads-1]) {
+ translate([w, i*(l + t)]) {
+ translate([0, 0]) square([g, l + g]);
+ translate([0, l]) square([divide_head_dx + g, g]);
+ translate([dx, l]) square([g, t + g]);
+ translate([0, l + t])
+ square([divide_head_dx + g, g]);
+ }
+ }
+ translate([-0.1, (l + t) * divide_heads])
+ square([w + g, g]);
+ }
+}
+
+module DividePlanInPlace(xl=10){
+ rotate([0,0, -divide_angle])
+ translate([ -tube_dia/2 -tube_th/2 - divide_fudge_r, 0])
+ DividePlan(xl);
+}
+
module MainPlan(){
difference(){
union(){
- circle(r = tube_or);
- translate([-back_ohw,0]) mirror([0,1])
- square([back_ohw*2, backflange_ymin]);
+ difference(){
+ union(){
+ hull(){
+ for (t=[0, tube_rear_extra_th])
+ translate([0, -t])
+ circle(r = tube_or);
+ }
+ rotate([0,0, backflange_angle])
+ translate([-back_ohw,0]) mirror([0,1])
+ square([back_ohw*2, backflange_ymin]);
- translate([0, lock_0y]){
- oval(lock_or);
- }
- }
+ translate([0, lock_0y]){
+ oval(lock_or);
+ }
- circle(r = tube_dia/2);
- translate([-back_gap/2,1]) mirror([0,1])
- square([back_gap, backflange_ymin+2]);
+ hull(){
+ JoinCircs(0.01);
+ polygon([[0,0], lock_0, [-lock_0[0], lock_0[1]]]);
+ }
+ }
+ rotate([0,0, backflange_angle])
+ translate([-back_gap/2,1]) mirror([0,1])
+ square([back_gap, backflange_ymin+2]);
+
+ JoinCircs(join_cr);
+ }
+
+ hull(){
+ minkowski(){
+ DividePlanInPlace(0.1);
+ circle(divide_around);
+ }
+ }
+ }
translate([0, lock_0y]){
oval([lock_w/2, lock_d/2]);
}
+
+ circle(r = tube_dia/2);
+
+ DividePlanInPlace();
}
}
children(0);
}
-module ThroughHole(r, y, z) {
- translate([-50, y, z])
+module ThroughHole(r, y, z, x=-50) {
+ translate([x, y, z])
rotate([0, 90, 0])
cylinder(r=r, h=100, $fn=20);
}
-module ThroughHoles(){
+module MountingHoleCylinders(r, x=-50){
for (z=[ 1/4, 3/4 ]) {
- ThroughHole( mountscrew_dia/2,
- -tube_or -0.5*backflange_d,
- total_h * z );
+ rotate([0,0, backflange_angle])
+ ThroughHole( r,
+ -tube_dia/2 -0.5*backflange_d + backflange_hole_dy,
+ total_h * z,
+ x);
}
+}
+
+module ThroughHoles(){
+ MountingHoleCylinders(mountscrew_dia/2);
ThroughHole( clipbolt_dia/2,
lock_0y + lock_d/2 + clip_d/2 + front_th/2,
}
}
-module Bracket(){ //// toplevel
+module Bracket(){ ////toplevel
difference(){
MainPositive();
ThroughHoles();
}
}
-module TestTopEdge(){ //// toplevel
+module TestTopEdge(){ ////toplevel
intersection(){
translate([0,0, -total_h])
translate([0,0, 4])
}
}
-module TestClipBoltHole(){ //// toplevel
+module TestClipBoltHole(){ ////toplevel
intersection(){
union(){
translate([0, 0, -5])
}
}
+module Demo(){ ////toplevel
+ Bracket();
+ color("blue") MountingHoleCylinders(mountscrew_dia/2 - 0.1);
+ color("black") MountingHoleCylinders(mountscrew_washer/2,
+ back_ohw + 0.25);
+}
+
//MainPlan();
//ClipElevationPositive();
//ClipElevation();
//%ThroughHoles();
//TestTopEdge();
//TestClipBoltHole();
+//DividePlan();
//Bracket();
+