3 // use shell thickness 1.50
4 // use fill density 40%
8 tube_dia = 27.5 + 1.625;
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;
49 divide_fudge_r = 4.75;
52 backflange_angle = 20;
56 lockshaft_r = [1, 1] * lockshaft_dia / 2;
59 tube_or = tube_dia/2 + tube_th;
60 back_ohw = back_gap/2 + backflange_th;
61 backflange_ymin = tube_dia/2 + backflange_d;
63 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
64 lock_0x = lock_w/2 - lock_d/2;
65 lock_0 = [lock_0x,lock_0y];
67 lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
69 module oval(sz){ // sz[0] > sz[1]
74 translate([sx * (xr-yr), 0])
81 // http://mathworld.wolfram.com/Circle-CircleIntersection.html
82 R = tube_or + join_cr;
83 r = lock_or[1] + join_cr;
84 d = dist2d( [0,0], lock_0 );
85 x = (d*d - r*r + R*R) / (2*d);
86 y = sqrt( R*R - x*x );
88 echo(lock_0x, lock_0y, R,r, d, x,y);
92 rotate(atan2(lock_0y, lock_0x)) {
100 module DividePlan(xl=10){
103 l = divide_shaft_l + g;
104 t = divide_head_th + g;
106 for (m=[0,1]) mirror([m,0]) {
107 translate([w, 0]) square([xl, g]);
108 for (i=[0:divide_heads-1]) {
109 translate([w, i*(l + t)]) {
110 translate([0, 0]) square([g, l + g]);
111 translate([0, l]) square([divide_head_dx + g, g]);
112 translate([dx, l]) square([g, t + g]);
113 translate([0, l + t])
114 square([divide_head_dx + g, g]);
117 translate([-0.1, (l + t) * divide_heads])
122 module DividePlanInPlace(xl=10){
123 rotate([0,0, -divide_angle])
124 translate([ -tube_dia/2 -tube_th/2 - divide_fudge_r, 0])
128 module DivideHook(){ ////toplevel
132 translate([-1,0] * (w + d + w)){
134 translate([-(w + w+d) * sx, 0]) circle(r= w);
138 translate([-10*w, -10*w]) square([20*w, 10*w]);
146 br = tube_dia/2 + tube_th;
149 offset(r=divide_gap) DivideHook();
151 translate([-2*w,0]) mirror([0,1]) square([4*w, 4*w]);
158 br = tube_dia/2 + tube_th;
161 translate([br - tube_th/2,0]) {
167 translate([-2*w, 0]) mirror([0,1]) square(4*w);
171 module DivideSurround(){
178 translate([-(4*w + 2*d), 8*w]) circle(r=w);
183 module DivideInPlace(){
184 rotate([0,0, -divide_angle])
185 translate([ -tube_dia/2 -tube_th/2, 0])
189 module MainPlan(){ ////toplevel
195 for (t=[0, tube_rear_extra_th])
199 rotate([0,0, backflange_angle])
200 translate([-back_ohw,0]) mirror([0,1])
201 square([back_ohw*2, backflange_ymin]);
203 translate([0, lock_0y]){
209 polygon([[0,0], lock_0, [-lock_0[0], lock_0[1]]]);
213 rotate([0,0, backflange_angle])
214 translate([-back_gap/2,1]) mirror([0,1])
215 square([back_gap, backflange_ymin+2]);
220 DivideInPlace() DivideSurround();
222 translate([0, lock_0y]){
223 oval([lock_w/2, lock_d/2]);
226 circle(r = tube_dia/2);
228 DivideInPlace() DivideCut();
229 DivideInPlace() DivideCutB();
233 lockshaft_or = lockshaft_r + [clip_th,clip_th];
234 cliprecess_ymax = cliprecess_h - lockshaft_r[1];
235 clip_ymin = cliprecess_ymax - total_h;
236 clip_ogap = clip_gap + clip_th*2;
238 module ClipElevationPositive(){
241 translate([0, -lockshaft_or[1] * sqrt(2)])
242 square(center=true, 0.5);
244 translate([-lockshaft_or[0], 0])
245 square([lockshaft_or[0]*2, cliprecess_ymax]);
246 translate([-clip_ogap/2, 0]) mirror([0,1]) square([clip_ogap, -clip_ymin]);
249 module ClipElevationNegative(){
251 for (y=[0, cliprecess_ymax+1])
255 translate([-clip_gap/2, 1]) mirror([0,1]) square([clip_gap, 2-clip_ymin]);
258 module ClipElevation(){
260 ClipElevationPositive(1);
261 ClipElevationNegative(0);
265 module ExtrudeClipElevation(extra=0){
267 lock_0y + lock_d/2 + clip_d + extra,
270 linear_extrude(height= clip_d + extra*2, convexity=100)
274 module ThroughHole(r, y, z, x=-50) {
277 cylinder(r=r, h=100, $fn=20);
280 module MountingHoleCylinders(r, x=-50){
281 for (z=[ 1/4, 3/4 ]) {
282 rotate([0,0, backflange_angle])
284 -tube_dia/2 -0.5*backflange_d + backflange_hole_dy,
290 module ThroughHoles(){
291 MountingHoleCylinders(mountscrew_dia/2);
293 ThroughHole( clipbolt_dia/2,
294 lock_0y + lock_d/2 + clip_d/2 + front_th/2,
295 total_h - cliprecess_h - clip_th - clip_d/2 );
298 module MainPositive(){
301 linear_extrude(height=total_h, convexity=100) MainPlan();
302 ExtrudeClipElevation() ClipElevationPositive();
304 ExtrudeClipElevation(1) ClipElevationNegative();
308 module Bracket(){ ////toplevel
315 module TestTopEdge(){ ////toplevel
317 translate([0,0, -total_h])
320 translate([-200,-200,0])
325 module TestClipBoltHole(){ ////toplevel
328 translate([0, 0, -5])
330 translate([-4, lock_0y + lock_d/2 + 1, 0])
333 translate([-200, lock_0y + lock_d/2 + 0.1])
334 cube([400, 400, total_h-20]);
338 module Demo(){ ////toplevel
340 color("blue") MountingHoleCylinders(mountscrew_dia/2 - 0.1);
341 color("black") MountingHoleCylinders(mountscrew_washer/2,
345 module DividePlanDemo(){ ////toplevel
349 module DivideDemo(){ ////toplevel
350 color("black") translate([0,0,-2]) MainPlan();
351 color("grey") DivideInPlace() DivideHook();
352 color("blue") translate([0,0,-4]) DivideInPlace() DivideCut();
356 //ClipElevationPositive();
361 //TestClipBoltHole();