chiark / gitweb /
Makefile, funcs.scad: helpful file
[reprap-play.git] / trailerhubcap.scad
1 // Copyright (C)2012 Ian Jackson
2 // Licenced under the GNU General Public Licence, version 3, or
3 // (at your option) any later version.  There is NO WARRANTY.
4
5 maindia = 29.7;
6 poleholeh = 5.0;
7 polecovth = 0.4;
8 poleholerad = 6;
9
10 mainoverlap = 1.5;
11
12 hookbasew = 5.0;
13 hookfullw = 7;
14 hookheight = 4.5;
15 hookwidth = 8;
16 hookbevelw = 0.75;
17 hookbevelh = 1.5;
18
19 fingernaildepth = 5;
20 fingernailheight = 2.5;
21 fingernailwidth = 6;
22
23 bigrad = maindia/2 + mainoverlap;
24 mainth = poleholeh + polecovth;
25 hooklessdepth = hookfullw - hookbasew;
26
27 module base() {
28   rotate_extrude(convexity=10)
29     mirror([1,0,0])
30     polygon(points=[[-bigrad, 0],
31                     [-bigrad + mainth, -mainth],
32                     [0, -mainth],
33                     [0, -poleholeh],
34                     [-poleholerad, -poleholeh],
35                     [-poleholerad, 0]]);
36 }
37
38 module fingernails() {
39   for (ang=[60,180,300])
40     rotate([0,0,ang])
41       translate([bigrad - fingernaildepth,
42                  -fingernailwidth/2,
43                  -fingernailheight])
44       cube([fingernaildepth + 1, fingernailwidth, fingernailheight + 1]);
45 }
46
47 module hookrim() {
48   rotate_extrude(convexity=10)
49     mirror([1,0,0])
50     translate([-maindia/2, 0, 0])
51     polygon(points=[[hooklessdepth, 0],
52                     [hookfullw, 0],
53                     [hookfullw*0.33, hookheight],
54                     [hookbevelw, hookheight],
55                     [0, hookheight-hookbevelh],
56                     [0, hooklessdepth]]);
57 }
58
59 module hooktriangles() {
60   for (ang=[0,120,240]) {
61     rotate([0,0,ang]) {
62       translate([0,0,-1]) {
63         linear_extrude(height=hookheight+2) {
64           polygon(points=[[0, 0],
65                           [maindia/2 + 1, -hookwidth],
66                           [maindia/2 + 1, +hookwidth]]);
67         }
68       }
69     }
70   }
71 }
72
73 difference(){
74   base();
75   fingernails();
76 }
77 intersection(){
78   hookrim();
79   hooktriangles();
80 }