chiark / gitweb /
salter-scale-hook: wip Cut
[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
14 // calculated
15
16 d = rod_dia/2 + thick/2;
17 yminc = -d;
18 ymin = yminc-thick/2;
19 ymaxc = mainheight;
20 ymax = mainheight+thick/2;
21
22 cutdepth = rod_offset - rod_dia/2 - rearthick;
23
24 cut_z0 = screw_head_dia/2;
25 cut_z1 = width/2 - rearthick;
26
27 cutslopez = cutdepth * 0.5;
28
29 module C() {
30   circle(r = thick/2, $fn=30);
31 }
32
33 module Profile() {
34   e = rod_offset;
35   hull(){
36     translate([-d, 0]) C();
37     translate([-d,-d]) C();
38   }
39   difference(){
40     rectfromto([-d,ymin], [e,0]);
41     circle(r= rod_dia/2, $fn=50);
42   }
43   hull(){
44     for (y= [-d, +mainheight]) {
45       translate([d, y]) C();
46       rectfromto([d, y-thick/2], [e, y+thick/2]);
47     }
48   }
49 }
50
51 module CutProfile(){
52   hull(){
53     for (x = [rod_dia/2 + thick/2, 30]) {
54       for (y= [yminc,ymaxc] ) {
55         translate([x,y]) circle(r = (thick-rearthick)/2, $fn=20);
56       }
57     }
58   }
59 }
60
61 module ProfileDemo(){
62   Profile();
63   color("red") translate([0,0,1]) CutProfile();
64 }
65
66 module Cut(less){
67   translate([0,0, cut_z0 + less])
68     linear_extrude(height = cut_z1 - cut_z0 - less*2)
69     CutProfile();
70 }
71
72 module Hook(){
73   difference(){
74     translate([0,0, -width/2])
75       linear_extrude(height=width) Profile();
76     for (m=[0,1]) {
77       mirror([0,0,m]) {
78         hull(){
79           Cut(cutslopez);
80           translate([cutdepth,0,0]) Cut(0);
81         }
82       }
83     }
84   }
85 }
86
87 //ProfileDemo();
88 Hook();