chiark / gitweb /
e3eb46bc3d2edb1d61042578129a7b60a8585eed
[reprap-play.git] / trailerhubcap.scad
1 maindia = 28.4;
2 poleholeh = 5.0;
3 polecovth = 0.4;
4 poleholerad = 6;
5
6 mainoverlap = 1.5;
7
8 hookbasew = 4;
9 hookfullw = 6;
10 hookheight = 4;
11 hookwidth = 5;
12
13 fingernaildepth = 5;
14 fingernailheight = 2.5;
15 fingernailwidth = 6;
16
17 bigrad = maindia/2 + mainoverlap;
18 mainth = poleholeh + polecovth;
19 hooklessdepth = hookfullw - hookbasew;
20
21 module base() {
22   rotate_extrude(convexity=10)
23     mirror([1,0,0])
24     polygon(points=[[-bigrad, 0],
25                     [-bigrad + mainth, -mainth],
26                     [0, -mainth],
27                     [0, -poleholeh],
28                     [-poleholerad, -poleholeh],
29                     [-poleholerad, 0]]);
30 }
31
32 module fingernails() {
33   for (ang=[60,180,300])
34     rotate([0,0,ang])
35       translate([bigrad - fingernaildepth,
36                  -fingernailwidth/2,
37                  -fingernailheight])
38       cube([fingernaildepth + 1, fingernailwidth, fingernailheight + 1]);
39 }
40
41 module hookrim() {
42   rotate_extrude(convexity=10)
43     mirror([1,0,0])
44     translate([-maindia/2, 0, 0])
45     polygon(points=[[hooklessdepth, 0],
46                     [hookfullw, 0],
47                     [hookfullw, hookheight],
48                     [0, hookheight],
49                     [0, hooklessdepth]]);
50 }
51
52 module hooktriangles() {
53   for (ang=[0,120,240]) {
54     rotate([0,0,ang]) {
55       translate([0,0,-1]) {
56         linear_extrude(height=hookheight+2) {
57           polygon(points=[[0, 0],
58                           [maindia/2 + 1, -hookwidth],
59                           [maindia/2 + 1, +hookwidth]]);
60         }
61       }
62     }
63   }
64 }
65
66 difference(){
67   base();
68   fingernails();
69 }
70 intersection(){
71   hookrim();
72   hooktriangles();
73 }