chiark / gitweb /
01c7a2fae95de67117239dea16bd8bae6b97e04f
[reprap-play.git] / filamentspool.scad
1
2 slop=0.5;
3 bigslop=slop*2;
4
5 prongthick=5;
6 prongwidth=5;
7 ratchetstep=15;
8 ratchettooth=3;
9 ratchettoothheight=5;
10 ratchettoothsmoothr=1;
11 ratchettoothslope=0.75;
12 overlap=0.5;
13 cupbigrad=35;
14
15 stalklength=50;
16 overclipcupgap=5;
17 overclipheight=15;
18
19 armendwallthick=2.5;
20 armendbasethick=1.2;
21
22 ratchetpawl=ratchetstep-ratchettooth-bigslop*2;
23
24 include <doveclip.scad>
25 include <cliphook.scad>
26
27 channelwidth = prongthick + slop;
28 channeldepth = prongwidth + ratchettoothheight;
29 totalwidth = armendwallthick*2 + channelwidth;
30 totalheight = channeldepth + armendbasethick;
31
32 doveclipheight = totalheight;
33
34 module ArmEnd(length=120){
35   translate([ratchettoothsmoothr, channelwidth/2, -armendbasethick]) {
36     rotate([0,0,-90])
37       DoveClipPairBase(h=doveclipheight);
38   }
39
40   for (dx = [0 : ratchetstep : length]) translate([dx,0,0]) {
41     difference(){
42       translate([0, -armendwallthick, -armendbasethick])
43         cube([ratchetstep+overlap, totalwidth, totalheight]);
44       translate([-1, 0, 0])
45         cube([ratchetstep+overlap+2, channelwidth, channeldepth+1]);
46     }
47     translate([ratchettoothsmoothr+0.5, armendwallthick/2, 0]) minkowski(){
48       rotate([90,0,0])
49         cylinder($fn=20, r=ratchettoothsmoothr, h=armendwallthick);
50       multmatrix([      [       1, 0, ratchettoothslope, 0      ],
51                         [       0,      1,      0,      0       ],
52                         [       0,      0,      1,      0       ],
53                         [       0,      0,      0,      1       ]])
54         cube([ratchettooth - ratchettoothsmoothr*2,
55               channelwidth, ratchettoothheight]);
56     }
57   }
58 }
59
60 module FilamentHandle(){
61   pawlusewidth = ratchetpawl-ratchettoothsmoothr*2;
62   mirror([0,1,0]) {
63     cube([stalklength, prongwidth, prongthick]);
64     translate([stalklength, prongwidth/2, 0])
65       cylinder(r=prongwidth/2, h=prongthick, $fn=20);
66     translate([ratchettoothsmoothr, prongwidth, 0]) {
67       minkowski(){
68         cylinder($fn=20,r=ratchettoothsmoothr, h=1);
69         multmatrix([    [       1, -ratchettoothslope, 0, 0     ],
70                         [       0,      1,      0,      0       ],
71                         [       0,      0,      1,      0       ],
72                         [       0,      0,      0,      1       ]])
73           cube([pawlusewidth,
74                 ratchettoothheight - ratchettoothsmoothr,
75                 prongthick]);
76       }
77     }
78   }
79 }
80
81 module FilamentCupCup(){
82   xstraight = cupbigrad;
83   linear_extrude(height=prongthick) {
84     FlatArc(0,0, cupbigrad,cupbigrad+prongwidth, 89,271, $fn=80);
85   }
86   for (my=[0,1]) mirror([0,my,0]) {
87     translate([0,cupbigrad,0])
88       cube([xstraight, prongwidth, prongthick]);
89   }
90 }
91
92 module FilamentCup() {
93   FilamentHandle();
94
95   dx = cupbigrad + prongwidth;
96   dy = cupbigrad + prongwidth + overclipcupgap;
97
98   translate([dx, dy, 0])
99     FilamentCupCup();
100   translate([0, -1, 0]);
101   cube([prongwidth, dy+1, prongthick]);
102
103   propshift = stalklength - overclipheight - prongthick;
104   proptaken = propshift + prongthick;
105   echo(cupbigrad, dx, propshift, proptaken);
106
107   translate([propshift, -1, 0])
108     cube([prongwidth,
109           sqrt(cupbigrad*cupbigrad - proptaken*proptaken)
110           + overclipcupgap + prongthick + 1,
111           prongthick]);
112 }
113
114 //ArmEnd();
115 FilamentCup();