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.6;
36 tube_rear_extra_th = 1;
38 divide_shaft_w = 1.75;
40 divide_head_dx = 1.75;
46 divide_fudge_r = 4.75;
51 lockshaft_r = [1, 1] * lockshaft_dia / 2;
54 tube_or = tube_dia/2 + tube_th;
55 back_ohw = back_gap/2 + backflange_th;
56 backflange_ymin = tube_or+backflange_d;
58 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
59 lock_0x = lock_w/2 - lock_d/2;
60 lock_0 = [lock_0x,lock_0y];
62 lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
64 module oval(sz){ // sz[0] > sz[1]
69 translate([sx * (xr-yr), 0])
76 // http://mathworld.wolfram.com/Circle-CircleIntersection.html
77 R = tube_or + join_cr;
78 r = lock_or[1] + join_cr;
79 d = dist2d( [0,0], lock_0 );
80 x = (d*d - r*r + R*R) / (2*d);
81 y = sqrt( R*R - x*x );
83 echo(lock_0x, lock_0y, R,r, d, x,y);
87 rotate(atan2(lock_0y, lock_0x)) {
95 module DividePlan(xl=10){
98 l = divide_shaft_l + g;
99 t = divide_head_th + g;
101 for (m=[0,1]) mirror([m,0]) {
102 translate([w, 0]) square([xl, g]);
103 for (i=[0:divide_heads-1]) {
104 translate([w, i*(l + t)]) {
105 translate([0, 0]) square([g, l + g]);
106 translate([0, l]) square([divide_head_dx + g, g]);
107 translate([dx, l]) square([g, t + g]);
108 translate([0, l + t])
109 square([divide_head_dx + g, g]);
112 translate([-0.1, (l + t) * divide_heads])
117 module DividePlanInPlace(xl=10){
118 rotate([0,0, -divide_angle])
119 translate([ -tube_dia/2 -tube_th/2 - divide_fudge_r, 0])
129 for (t=[0, tube_rear_extra_th])
133 translate([-back_ohw,0]) mirror([0,1])
134 square([back_ohw*2, backflange_ymin]);
136 translate([0, lock_0y]){
142 polygon([[0,0], lock_0, [-lock_0[0], lock_0[1]]]);
146 translate([-back_gap/2,1]) mirror([0,1])
147 square([back_gap, backflange_ymin+2]);
154 DividePlanInPlace(0.1);
155 circle(divide_around);
159 translate([0, lock_0y]){
160 oval([lock_w/2, lock_d/2]);
163 circle(r = tube_dia/2);
169 lockshaft_or = lockshaft_r + [clip_th,clip_th];
170 cliprecess_ymax = cliprecess_h - lockshaft_r[1];
171 clip_ymin = cliprecess_ymax - total_h;
172 clip_ogap = clip_gap + clip_th*2;
174 module ClipElevationPositive(){
177 translate([0, -lockshaft_or[1] * sqrt(2)])
178 square(center=true, 0.5);
180 translate([-lockshaft_or[0], 0])
181 square([lockshaft_or[0]*2, cliprecess_ymax]);
182 translate([-clip_ogap/2, 0]) mirror([0,1]) square([clip_ogap, -clip_ymin]);
185 module ClipElevationNegative(){
187 for (y=[0, cliprecess_ymax+1])
191 translate([-clip_gap/2, 1]) mirror([0,1]) square([clip_gap, 2-clip_ymin]);
194 module ClipElevation(){
196 ClipElevationPositive(1);
197 ClipElevationNegative(0);
201 module ExtrudeClipElevation(extra=0){
203 lock_0y + lock_d/2 + clip_d + extra,
206 linear_extrude(height= clip_d + extra*2, convexity=100)
210 module ThroughHole(r, y, z) {
211 translate([-50, y, z])
213 cylinder(r=r, h=100, $fn=20);
216 module ThroughHoles(){
217 for (z=[ 1/4, 3/4 ]) {
218 ThroughHole( mountscrew_dia/2,
219 -tube_or -0.5*backflange_d,
223 ThroughHole( clipbolt_dia/2,
224 lock_0y + lock_d/2 + clip_d/2 + front_th/2,
225 total_h - cliprecess_h - clip_th - clip_d/2 );
228 module MainPositive(){
231 linear_extrude(height=total_h, convexity=100) MainPlan();
232 ExtrudeClipElevation() ClipElevationPositive();
234 ExtrudeClipElevation(1) ClipElevationNegative();
238 module Bracket(){ //// toplevel
245 module TestTopEdge(){ //// toplevel
247 translate([0,0, -total_h])
250 translate([-200,-200,0])
255 module TestClipBoltHole(){ //// toplevel
258 translate([0, 0, -5])
260 translate([-4, lock_0y + lock_d/2 + 1, 0])
263 translate([-200, lock_0y + lock_d/2 + 0.1])
264 cube([400, 400, total_h-20]);
269 //ClipElevationPositive();
274 //TestClipBoltHole();