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