chiark / gitweb /
5b14c9d321d47ebc1103cb09e727689f0afa8759
[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 back_gap = 7;
10 main_th = 2.5;
11 midweb_d = 3;
12
13 // calculated
14
15 front_th = main_th;
16
17 tube_or = tube_dia/2 + main_th;
18 back_ohw = back_gap/2 + main_th;
19 backflange_ymin = tube_or+backflange_d;
20
21 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
22
23 lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
24
25 module oval(sz){ // sz[0] > sz[1]
26   xr = sz[0];
27   yr = sz[1];
28   hull(){
29     for (sx=[-1,+1]) {
30       translate([sx * (xr-yr), 0])
31         circle(r=yr);
32     }
33   }
34 }
35
36 module MainPlan(){
37   difference(){
38     union(){
39       circle(r = tube_or);
40       translate([-back_ohw,0]) mirror([0,1])
41         square([back_ohw*2, backflange_ymin]);
42     }
43     circle(r = tube_dia/2);
44     translate([-back_gap/2,1]) mirror([0,1])
45       square([back_gap, backflange_ymin+2]);
46   }
47   translate([0, lock_0y]){
48     difference(){
49       union(){
50         oval(lock_or);
51       }
52       oval([lock_w/2, lock_d/2]);
53     }
54   }
55 }
56
57 MainPlan();