chiark / gitweb /
5fdd147e41fbe8fe74e3e84178f6cdc33b59616e
[reprap-play.git] / filamentspool.scad
1
2 fdia=1.75;
3
4 slop=0.5;
5 bigslop=slop*2;
6
7 prongthick=5;
8 prongwidth=5;
9 ratchetstep=15;
10 ratchettooth=3;
11 ratchettoothheight=5;
12 ratchettoothsmoothr=1;
13 ratchettoothslope=0.75;
14 overlap=0.5;
15 cupbigrad=35;
16
17 teethh=3;
18 teethgapx=4+fdia;
19
20 prongstalkxwidth=3;
21
22 stalklength=40;
23 overclipcupgap=5;
24 overclipdepth=15;
25 overcliproundr=2.0;
26 overclipthick=0.5;
27
28 wingspoke=3;
29 wingsize=6;
30 wingthick=3;
31
32 overclipsmaller=-1.0;
33 overclipbigger=2.0;
34
35 armendwallthick=2.5;
36 armendbasethick=1.2;
37
38 ratchetpawl=ratchetstep-ratchettooth-bigslop*2;
39
40 include <doveclip.scad>
41 include <cliphook.scad>
42 include <filamentteeth.scad>
43
44 channelwidth = prongthick + slop;
45 channeldepth = prongwidth + ratchettoothheight;
46 totalwidth = armendwallthick*2 + channelwidth;
47 totalheight = channeldepth + armendbasethick;
48 stalkwidth = prongwidth + prongstalkxwidth;
49
50 doveclipheight = totalheight;
51
52 module ArmEnd(length=120){
53   translate([ratchettoothsmoothr, channelwidth/2, -armendbasethick]) {
54     rotate([0,0,-90])
55       DoveClipPairBase(h=doveclipheight);
56   }
57
58   difference(){
59     translate([0, -armendwallthick, -armendbasethick])
60       cube([length, totalwidth, totalheight]);
61     translate([-1, 0, 0])
62       cube([length+2, channelwidth, channeldepth+1]);
63   }
64   for (dx = [0 : ratchetstep : length - stalklength]) translate([dx,0,0]) {
65     translate([ratchettoothsmoothr+0.5, armendwallthick/2, 0]) minkowski(){
66       rotate([90,0,0])
67         cylinder($fn=20, r=ratchettoothsmoothr, h=armendwallthick);
68       multmatrix([      [       1, 0, ratchettoothslope, 0      ],
69                         [       0,      1,      0,      0       ],
70                         [       0,      0,      1,      0       ],
71                         [       0,      0,      0,      1       ]])
72         cube([ratchettooth - ratchettoothsmoothr*2,
73               channelwidth, ratchettoothheight]);
74     }
75   }
76 }
77
78 module FilamentCupHandle(){
79   pawlusewidth = ratchetpawl-ratchettoothsmoothr*2;
80   mirror([0,1,0]) {
81     cube([stalklength, stalkwidth, prongthick]);
82     translate([stalklength, stalkwidth/2, 0])
83       cylinder(r=stalkwidth/2, h=prongthick, $fn=20);
84     translate([ratchettoothsmoothr, stalkwidth, 0]) {
85       minkowski(){
86         cylinder($fn=20,r=ratchettoothsmoothr, h=1);
87         multmatrix([    [       1, -ratchettoothslope, 0, 0     ],
88                         [       0,      1,      0,      0       ],
89                         [       0,      0,      1,      0       ],
90                         [       0,      0,      0,      1       ]])
91           cube([pawlusewidth,
92                 ratchettoothheight - ratchettoothsmoothr,
93                 prongthick]);
94       }
95     }
96   }
97 }
98
99 module FilamentCupCup(){
100   xstraight = cupbigrad;
101   linear_extrude(height=prongthick) {
102     FlatArc(0,0, cupbigrad,cupbigrad+prongwidth, 89,271, $fn=80);
103   }
104   for (my=[0,1]) mirror([0,my,0]) {
105     translate([0,cupbigrad,0])
106       cube([xstraight, prongwidth, prongthick]);
107   }
108 }
109
110 module FilamentCup() {
111   FilamentCupHandle();
112
113   dx = cupbigrad + prongwidth;
114   gapy = prongwidth;
115   dy = cupbigrad + gapy + overclipcupgap;
116
117   translate([dx, dy, 0])
118     FilamentCupCup();
119   translate([0, -1, 0]);
120   cube([prongwidth, dy+1, prongthick]);
121
122   midrad = cupbigrad + prongwidth/2;
123
124   propshift = stalklength - overclipdepth - prongthick;
125   proptaken = propshift;
126   echo(cupbigrad, dx, midrad, propshift, proptaken);
127
128   translate([propshift, -1, 0]) {
129     cube([prongwidth,
130           dy - sqrt(midrad*midrad - proptaken*proptaken),
131           prongthick]);
132   }
133   translate([stalklength + overclipdepth, gapy, 0])
134     rotate([0,0,-(10 + fdia)])
135     FilamentTeeth(fdia=fdia, h=teethh);
136 }
137
138 module CupSecuringClipSolid(w,d,h1,h2){
139   rotate([0,-90,0]) translate([0,-h1/2,-w/2]) linear_extrude(height=w) {
140     polygon(points=[[0,0], [d,0], [d,h2], [0,h1]]);
141   }
142 }
143
144 module CupSecuringClipSolidSmooth(xrad=0, xdepth=0){
145   hbase = totalheight + prongstalkxwidth - overcliproundr*2;
146   minkowski(){
147     CupSecuringClipSolid(w=totalwidth,
148                          d=overclipdepth + xdepth,
149                          h1=hbase - overclipsmaller,
150                          h2=hbase + overclipbigger);
151     cylinder($fn=20, h=0.01, r=overcliproundr+xrad);
152   }
153 }
154
155 module CupSecuringClip(){
156   wingswidth = wingspoke*2 + overclipthick*2 + overcliproundr*2 + totalwidth;
157   difference(){
158     union(){
159       CupSecuringClipSolidSmooth(xrad=overclipthick, xdepth=0);
160       translate([-wingswidth/2, -wingsize/2, 0])
161         cube([wingswidth, wingsize, wingthick]);
162     }
163     translate([0,0,-0.1])
164       CupSecuringClipSolidSmooth(xrad=0, xdepth=5);
165   }
166 }
167
168 //ArmEnd();
169 //FilamentCup();
170 //CupSecuringClip();