3 // use shell thickness 1.50
4 // use fill density 40%
8 tube_dia = 27.5 + 1.625;
13 lockshaft_dia = 14.35;
27 mountscrew_dia = 4 + 0.5;
28 clipbolt_dia = 5 + 0.1;
36 tube_rear_extra_th = 1;
40 lockshaft_r = [1, 1] * lockshaft_dia / 2;
43 tube_or = tube_dia/2 + tube_th;
44 back_ohw = back_gap/2 + backflange_th;
45 backflange_ymin = tube_or+backflange_d;
47 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
48 lock_0x = lock_w/2 - lock_d/2;
49 lock_0 = [lock_0x,lock_0y];
51 lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
53 module oval(sz){ // sz[0] > sz[1]
58 translate([sx * (xr-yr), 0])
65 // http://mathworld.wolfram.com/Circle-CircleIntersection.html
66 R = tube_or + join_cr;
67 r = lock_or[1] + join_cr;
68 d = dist2d( [0,0], lock_0 );
69 x = (d*d - r*r + R*R) / (2*d);
70 y = sqrt( R*R - x*x );
72 echo(lock_0x, lock_0y, R,r, d, x,y);
76 rotate(atan2(lock_0y, lock_0x)) {
88 for (t=[0, tube_rear_extra_th])
92 translate([-back_ohw,0]) mirror([0,1])
93 square([back_ohw*2, backflange_ymin]);
95 translate([0, lock_0y]){
101 polygon([[0,0], lock_0, [-lock_0[0], lock_0[1]]]);
105 circle(r = tube_dia/2);
106 translate([-back_gap/2,1]) mirror([0,1])
107 square([back_gap, backflange_ymin+2]);
109 translate([0, lock_0y]){
110 oval([lock_w/2, lock_d/2]);
117 lockshaft_or = lockshaft_r + [clip_th,clip_th];
118 cliprecess_ymax = cliprecess_h - lockshaft_r[1];
119 clip_ymin = cliprecess_ymax - total_h;
120 clip_ogap = clip_gap + clip_th*2;
122 module ClipElevationPositive(){
125 translate([0, -lockshaft_or[1] * sqrt(2)])
126 square(center=true, 0.5);
128 translate([-lockshaft_or[0], 0])
129 square([lockshaft_or[0]*2, cliprecess_ymax]);
130 translate([-clip_ogap/2, 0]) mirror([0,1]) square([clip_ogap, -clip_ymin]);
133 module ClipElevationNegative(){
135 for (y=[0, cliprecess_ymax+1])
139 translate([-clip_gap/2, 1]) mirror([0,1]) square([clip_gap, 2-clip_ymin]);
142 module ClipElevation(){
144 ClipElevationPositive(1);
145 ClipElevationNegative(0);
149 module ExtrudeClipElevation(extra=0){
151 lock_0y + lock_d/2 + clip_d + extra,
154 linear_extrude(height= clip_d + extra*2, convexity=100)
158 module ThroughHole(r, y, z) {
159 translate([-50, y, z])
161 cylinder(r=r, h=100, $fn=20);
164 module ThroughHoles(){
165 for (z=[ 1/4, 3/4 ]) {
166 ThroughHole( mountscrew_dia/2,
167 -tube_or -0.5*backflange_d,
171 ThroughHole( clipbolt_dia/2,
172 lock_0y + lock_d/2 + clip_d/2 + front_th/2,
173 total_h - cliprecess_h - clip_th - clip_d/2 );
176 module MainPositive(){
179 linear_extrude(height=total_h, convexity=100) MainPlan();
180 ExtrudeClipElevation() ClipElevationPositive();
182 ExtrudeClipElevation(1) ClipElevationNegative();
186 module Bracket(){ //// toplevel
193 module TestTopEdge(){ //// toplevel
195 translate([0,0, -total_h])
198 translate([-200,-200,0])
203 module TestClipBoltHole(){ //// toplevel
206 translate([0, 0, -5])
208 translate([-4, lock_0y + lock_d/2 + 1, 0])
211 translate([-200, lock_0y + lock_d/2 + 0.1])
212 cube([400, 400, total_h-20]);
217 //ClipElevationPositive();
222 //TestClipBoltHole();