chiark / gitweb /
lock-inframe-bracket: wip ClipElevations
[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
18 // calculated
19
20 front_th = main_th;
21
22 tube_or = tube_dia/2 + main_th;
23 back_ohw = back_gap/2 + main_th;
24 backflange_ymin = tube_or+backflange_d;
25
26 lock_0y = tube_dia/2 + lock_d/2 + midweb_d;
27
28 lock_or = [lock_w, lock_d]/2 + [front_th,front_th];
29
30 module oval(sz){ // sz[0] > sz[1]
31   xr = sz[0];
32   yr = sz[1];
33   hull(){
34     for (sx=[-1,+1]) {
35       translate([sx * (xr-yr), 0])
36         circle(r=yr);
37     }
38   }
39 }
40
41 module MainPlan(){
42   difference(){
43     union(){
44       circle(r = tube_or);
45       translate([-back_ohw,0]) mirror([0,1])
46         square([back_ohw*2, backflange_ymin]);
47     }
48     circle(r = tube_dia/2);
49     translate([-back_gap/2,1]) mirror([0,1])
50       square([back_gap, backflange_ymin+2]);
51   }
52   translate([0, lock_0y]){
53     difference(){
54       union(){
55         oval(lock_or);
56       }
57       oval([lock_w/2, lock_d/2]);
58     }
59   }
60 }
61
62 lockshaft_or = lockshaft_r + [clip_th,clip_th];
63 cliprecess_ymax = cliprecess_h - lockshaft_r[1];
64 clip_ymin = cliprecess_ymax - total_h;
65
66 module ClipElevationPositive(){
67   oval(lockshaft_or);
68   translate([-lockshaft_or[0], 0])
69     square([lockshaft_or[0]*2, cliprecess_ymax]);
70 }
71
72 module ClipElevationNegative(){
73   hull(){
74     for (y=[0, cliprecess_ymax+1])
75       translate([0, y])
76         oval(lockshaft_r);
77   }
78 }
79
80 module ClipElevation(){
81   difference(){
82     ClipElevationPositive(1);
83     ClipElevationNegative(0);
84   }
85 }
86
87 //MainPlan();
88 ClipElevation();