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