chiark / gitweb /
lock-inframe-bracket: ClipElevations seem ok
[reprap-play.git] / lock-inframe-bracket.scad
1 // -*- C -*-
2
3 tube_dia = 27.5 + 0.5;
4 lock_w = 42.5 + 0.5;
5 lock_d = 28.0 + 0.5;
6 main_h = 45.0;
7 backflange_d = 12;
8
9 lockshaft_r = [5, 5];
10 cliprecess_h = 16;
11 total_h = 45;
12
13 back_gap = 7;
14 main_th = 2.5;
15 midweb_d = 3;
16 clip_th = 2.5;
17 clip_gap = 2.5;
18
19 // calculated
20
21 front_th = main_th;
22
23 tube_or = tube_dia/2 + main_th;
24 back_ohw = back_gap/2 + main_th;
25 backflange_ymin = tube_or+backflange_d;
26
27 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
28
29 lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
30
31 module oval(sz){ // sz[0] > sz[1]
32   xr = sz[0];
33   yr = sz[1];
34   hull(){
35     for (sx=[-1,+1]) {
36       translate([sx * (xr-yr), 0])
37         circle(r=yr);
38     }
39   }
40 }
41
42 module MainPlan(){
43   difference(){
44     union(){
45       circle(r = tube_or);
46       translate([-back_ohw,0]) mirror([0,1])
47         square([back_ohw*2, backflange_ymin]);
48     }
49     circle(r = tube_dia/2);
50     translate([-back_gap/2,1]) mirror([0,1])
51       square([back_gap, backflange_ymin+2]);
52   }
53   translate([0, lock_0y]){
54     difference(){
55       union(){
56         oval(lock_or);
57       }
58       oval([lock_w/2, lock_d/2]);
59     }
60   }
61 }
62
63 lockshaft_or = lockshaft_r + [clip_th,clip_th];
64 cliprecess_ymax = cliprecess_h - lockshaft_r[1];
65 clip_ymin = cliprecess_ymax - total_h;
66 clip_ogap = clip_gap + clip_th*2;
67
68 module ClipElevationPositive(){
69   oval(lockshaft_or);
70   translate([-lockshaft_or[0], 0])
71     square([lockshaft_or[0]*2, cliprecess_ymax]);
72   translate([-clip_ogap/2, 0]) mirror([0,1]) square([clip_ogap, -clip_ymin]);
73 }
74
75 module ClipElevationNegative(){
76   hull(){
77     for (y=[0, cliprecess_ymax+1])
78       translate([0, y])
79         oval(lockshaft_r);
80   }
81   translate([-clip_gap/2, 1]) mirror([0,1]) square([clip_gap, 2-clip_ymin]);
82 }
83
84 module ClipElevation(){
85   difference(){
86     ClipElevationPositive(1);
87     ClipElevationNegative(0);
88   }
89 }
90
91 //MainPlan();
92 ClipElevation();