chiark / gitweb /
mic-table-clamp: Adjustments from blank, binary chop
[reprap-play.git] / salter-scale-hook.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 rod_dia = 8+2;
6 thick = 8;
7 screw_dia = 3.5 + 0.75;
8 screw_head_dia = 8.2 + 1.0;
9 rod_offset = 14 + 2;
10 mainheight = 25;
11 width = 40;
12 rearthick = 4;
13 screw_head_depth = 2;
14
15 // calculated
16
17 d = rod_dia/2 + thick/2;
18 yminc = -d;
19 ymin = yminc-thick/2;
20 ymaxc = mainheight;
21 ymax = mainheight+thick/2;
22
23 cutdepth = rod_offset - rod_dia/2 - rearthick;
24
25 cut_z0 = screw_head_dia/2;
26 cut_z1 = width/2 - rearthick;
27
28 cutslopez = cutdepth * 0.5;
29
30 module C() {
31   circle(r = thick/2, $fn=30);
32 }
33
34 module Profile() {
35   e = rod_offset;
36   hull(){
37     translate([-d, 0]) C();
38     translate([-d,-d]) C();
39   }
40   difference(){
41     rectfromto([-d,ymin], [e,0]);
42     circle(r= rod_dia/2, $fn=50);
43   }
44   hull(){
45     for (y= [-d, +mainheight]) {
46       translate([d, y]) C();
47       rectfromto([d, y-thick/2], [e, y+thick/2]);
48     }
49   }
50 }
51
52 module CutProfile(){
53   hull(){
54     for (x = [rod_dia/2 + thick/2, 30]) {
55       for (y= [yminc,ymaxc] ) {
56         translate([x,y]) circle(r = (thick-rearthick)/2, $fn=20);
57       }
58     }
59   }
60 }
61
62 module ProfileDemo(){
63   Profile();
64   color("red") translate([0,0,1]) CutProfile();
65 }
66
67 module Cut(less){
68   translate([0,0, cut_z0 + less])
69     linear_extrude(height = cut_z1 - cut_z0 - less*2)
70     CutProfile();
71 }
72
73 module ScrewHole(){
74   xd =  (screw_head_dia-screw_dia)/2;
75   translate([0,0,-50])
76     cylinder(h=100, r= screw_dia/2, $fn=20);
77   hull(){
78     translate([0,0,-xd])
79       cylinder(h=1, r= screw_dia/2, $fn=50);
80     cylinder(h=20, r= screw_head_dia/2, $fn=50);
81   }
82 }
83
84 module Hook(){
85   difference(){
86     translate([0,0, -width/2])
87       linear_extrude(height=width) Profile();
88
89     for (m=[0,1]) {
90       mirror([0,0,m]) {
91         hull(){
92           Cut(cutslopez);
93           translate([cutdepth,0,0]) Cut(0);
94         }
95       }
96     }
97
98     translate([rod_dia/2 + screw_head_depth,
99                ymaxc - screw_head_dia,
100                0]) {
101       rotate([0,-90,0])
102         ScrewHole();
103     }
104   }
105 }
106
107 //ProfileDemo();
108 Hook();