5 tube_dia = 27.5 + 1.625;
10 lockshaft_dia = 14.35;
24 mountscrew_dia = 4 + 0.5;
25 clipbolt_dia = 5 + 0.1;
33 tube_rear_extra_th = 1;
37 lockshaft_r = [1, 1] * lockshaft_dia / 2;
40 tube_or = tube_dia/2 + tube_th;
41 back_ohw = back_gap/2 + backflange_th;
42 backflange_ymin = tube_or+backflange_d;
44 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
45 lock_0x = lock_w/2 - lock_d/2;
46 lock_0 = [lock_0x,lock_0y];
48 lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
50 module oval(sz){ // sz[0] > sz[1]
55 translate([sx * (xr-yr), 0])
62 R = tube_or + join_cr;
63 r = lock_or[1] + join_cr;
64 d = dist2d( [0,0], lock_0 );
65 x = (d*d - r*r + R*R) / (2*d);
66 y = sqrt( R*R - x*x );
68 echo(lock_0x, lock_0y, R,r, d, x,y);
72 rotate(atan2(lock_0y, lock_0x)) {
84 for (t=[0, tube_rear_extra_th])
88 translate([-back_ohw,0]) mirror([0,1])
89 square([back_ohw*2, backflange_ymin]);
91 translate([0, lock_0y]){
97 polygon([[0,0], lock_0, [-lock_0[0], lock_0[1]]]);
101 circle(r = tube_dia/2);
102 translate([-back_gap/2,1]) mirror([0,1])
103 square([back_gap, backflange_ymin+2]);
105 translate([0, lock_0y]){
106 oval([lock_w/2, lock_d/2]);
113 lockshaft_or = lockshaft_r + [clip_th,clip_th];
114 cliprecess_ymax = cliprecess_h - lockshaft_r[1];
115 clip_ymin = cliprecess_ymax - total_h;
116 clip_ogap = clip_gap + clip_th*2;
118 module ClipElevationPositive(){
121 translate([0, -lockshaft_or[1] * sqrt(2)])
122 square(center=true, 0.5);
124 translate([-lockshaft_or[0], 0])
125 square([lockshaft_or[0]*2, cliprecess_ymax]);
126 translate([-clip_ogap/2, 0]) mirror([0,1]) square([clip_ogap, -clip_ymin]);
129 module ClipElevationNegative(){
131 for (y=[0, cliprecess_ymax+1])
135 translate([-clip_gap/2, 1]) mirror([0,1]) square([clip_gap, 2-clip_ymin]);
138 module ClipElevation(){
140 ClipElevationPositive(1);
141 ClipElevationNegative(0);
145 module ExtrudeClipElevation(extra=0){
147 lock_0y + lock_d/2 + clip_d + extra,
150 linear_extrude(height= clip_d + extra*2, convexity=100)
154 module ThroughHole(r, y, z) {
155 translate([-50, y, z])
157 cylinder(r=r, h=100, $fn=20);
160 module ThroughHoles(){
161 for (z=[ 1/4, 3/4 ]) {
162 ThroughHole( mountscrew_dia/2,
163 -tube_or -0.5*backflange_d,
167 ThroughHole( clipbolt_dia/2,
168 lock_0y + lock_d/2 + clip_d/2 + front_th/2,
169 total_h - cliprecess_h - clip_th - clip_d/2 );
172 module MainPositive(){
175 linear_extrude(height=total_h, convexity=100) MainPlan();
176 ExtrudeClipElevation() ClipElevationPositive();
178 ExtrudeClipElevation(1) ClipElevationNegative();
182 module Bracket(){ //// toplevel
189 module TestTopEdge(){ //// toplevel
191 translate([0,0, -total_h])
194 translate([-200,-200,0])
199 module TestClipBoltHole(){ //// toplevel
202 translate([0, 0, -5])
204 translate([-4, lock_0y + lock_d/2 + 1, 0])
207 translate([-200, lock_0y + lock_d/2 + 0.1])
208 cube([400, 400, total_h-20]);
213 //ClipElevationPositive();
218 //TestClipBoltHole();