chiark / gitweb /
c88e30c44844bf32a32b7e716cc896831dd6fb0e
[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
14 armendwallthick=2.5;
15 armendbasethick=1.2;
16
17 ratchetpawl=ratchetstep-ratchettooth-bigslop*2;
18
19 include <doveclip.scad>
20
21 channelwidth = prongthick + slop;
22 channeldepth = prongwidth + ratchettoothheight;
23 totalwidth = armendwallthick*2 + channelwidth;
24 totalheight = channeldepth + armendbasethick;
25
26 doveclipheight = totalheight;
27
28 module ArmEnd(length=120){
29   translate([ratchettoothsmoothr, channelwidth/2, -armendbasethick]) {
30     rotate([0,0,-90])
31       DoveClipPairBase(h=doveclipheight);
32   }
33
34   for (dx = [0 : ratchetstep : length]) translate([dx,0,0]) {
35     difference(){
36       translate([0, -armendwallthick, -armendbasethick])
37         cube([ratchetstep+overlap, totalwidth, totalheight]);
38       translate([-1, 0, 0])
39         cube([ratchetstep+overlap+2, channelwidth, channeldepth+1]);
40     }
41     translate([ratchettoothsmoothr+0.5, armendwallthick/2, 0]) minkowski(){
42       rotate([90,0,0])
43         cylinder($fn=20, r=ratchettoothsmoothr, h=armendwallthick);
44       multmatrix([      [       1, 0, ratchettoothslope, 0      ],
45                         [       0,      1,      0,      0       ],
46                         [       0,      0,      1,      0       ],
47                         [       0,      0,      0,      1       ]])
48         cube([ratchettooth - ratchettoothsmoothr*2,
49               channelwidth, ratchettoothheight]);
50     }
51   }
52 }
53
54 module FilamentHandle(stalklength=50){
55   pawlusewidth = ratchetpawl-ratchettoothsmoothr*2;
56   mirror([0,1,0]) {
57     cube([stalklength, prongwidth, prongthick]);
58     translate([ratchettoothsmoothr, prongwidth, 0]) {
59       minkowski(){
60         cylinder($fn=20,r=ratchettoothsmoothr, h=1);
61         multmatrix([    [       1, -ratchettoothslope, 0, 0     ],
62                         [       0,      1,      0,      0       ],
63                         [       0,      0,      1,      0       ],
64                         [       0,      0,      0,      1       ]])
65           cube([pawlusewidth,
66                 ratchettoothheight - ratchettoothsmoothr,
67                 prongthick]);
68       }
69     }
70   }
71 }
72
73 //ArmEnd();
74 FilamentHandle();