chiark / gitweb /
8d17cf69f2f8a7dc1203364c7975898126937bf8
[reprap-play.git] / filamenttrestle.scad
1 // -*- C -*-
2
3 spoolwidth = 80; // fixme needs to be measured
4 trestleheight = 80; // fixme needs to be checked
5 trestlebase = 80; // fixme needs to be checked
6
7 include <doveclip.scad>
8 include <axlepin.scad>
9
10 spoolwidthgap = 2;
11 barrad = 7;
12 barwasherrad = 20;
13
14 legw = 12;
15 plugl = 20;
16 plugwmin = 3;
17 plugh = 10;
18 plugslope = 0.5;
19 plugwmax = plugwmin + plugh * plugslope * 2;
20
21 trestlelegw = 10;
22 trestlebaseh = 10;
23 trestleplugd = 1;
24
25 topblockthick = 4;
26 topblockbasedepth = 5;
27
28 pinbasew = 5.0;
29 pinminh = 1.5;
30 pinmaxh = 4.5;
31 pindh = 0.50;
32 pindwidth = 0.75;
33
34 pintaperlen = plugwmax * 0.85;
35 pinstraightlen = 10;
36
37 module Plug(d=0){
38   dw = d;
39   dh = d;
40   dhb = d*2;
41   a = atan(plugslope);
42   bdy = -dhb;
43   bdx = dw / cos(a) + bdy * plugslope;
44   tdy = dh;
45   tdx = bdx + tdy * plugslope;
46   translate([-d,0,0]) rotate([90,0,90]) linear_extrude(height=plugl+0.1+d*2){
47     polygon([[-(plugwmin/2 + bdx),  bdy],
48              [-(plugwmax/2 + tdx),  plugh + tdy],
49              [+(plugwmax/2 + tdx),  plugh + tdy],
50              [+(plugwmin/2 + bdx),  bdy]]);
51   }
52 }
53
54 module Bar(){ ////toplevel
55   spoolw = spoolwidth + spoolwidthgap*2;
56   barz = barrad * 0.5;
57   biggestw = spoolw + 50;
58
59   intersection(){
60     for (mir=[0,1]) {
61       mirror([mir,0,0]) {
62         translate([spoolw/2, 0, 0])
63           Plug();
64         translate([-1, -50, -50])
65           cube([spoolw/2+1.1, 100, 100]);
66       }
67     }
68     translate([-biggestw/2, -50, 0])
69       cube([biggestw, 100, 100]);
70     translate([0,0,barz]) {
71       translate([-100,0,0])
72         rotate([0,90,0]) cylinder(r=barrad, h=200, $fn=30);
73     }
74   }
75 }
76
77 module FtAxlePin(){
78   AxlePin(barrad, (barrad + barwasherrad*2)/3 * 2);
79 }
80
81 module Trestle(){ ////toplevel
82   legang = atan2(trestlebase/2, trestleheight);
83   eplen = sqrt(trestleheight*trestleheight + trestlebase*trestlebase*0.25);
84   topblockw = plugwmax + trestleplugd*2 + topblockthick*2;
85
86   pinholebasew = pinbasew + pindwidth*2;
87   pinholeh =     pinmaxh +  pindh;
88
89   difference(){
90     union(){
91       for (mir=[0,1]) {
92         mirror([mir,0,0]) {
93           rotate([0,0, -90-legang])
94             ExtenderPillars(length=eplen+trestlelegw,
95                             width=trestlelegw,
96                             height=legw,
97                             baseweb=true);
98
99           translate([-trestlebase/2, -trestleheight, 0])
100             cylinder(r=trestlelegw/2*1.2, h=plugl);
101         }
102       }
103       translate([-topblockw/2, -topblockbasedepth, 0])
104         cube([topblockw,
105               topblockbasedepth + plugh + topblockthick
106               + (pinmaxh - pinminh)*0.6 + pindh,
107               plugl]);
108
109       translate([-trestlebase/2, -trestleheight, 0])
110         ExtenderPillars(length=trestlebase, width=trestlebaseh*2, height=legw);
111     }
112     translate([-300, -trestleheight-50, -1])
113       cube([600, 50, plugl+2]);
114
115     rotate([-90,-90,0])
116       Plug(d=trestleplugd);
117
118     for (rot=[0,180]) {
119       translate([0,0,plugl/2]) rotate([0,rot,0]) translate([0,0,-plugl/2]) {
120         translate([-(topblockw*0.25+1),
121                    plugh + pindh - (pinmaxh - pinminh)*0.75,
122                    (plugl - pinholebasew*2)/3]) {
123           translate([0,0,pinholebasew/2]) rotate([-90,0,0]) %Pin();
124           rotate([0,90,0]) {
125             linear_extrude(height = topblockw*1.0+2) {
126               polygon([[-1.0 * pinholebasew, -0.01],
127                        [-0.5 * pinholebasew, pinholeh],
128                        [ 0                 , -0.01]]);
129             }
130           }
131         }
132       }
133     }
134   }
135 }
136
137 module Pin(){ ////toplevel
138   rotate([90,0,90]) {
139     hull(){
140       for (mir=[0,1]) {
141         mirror([mir,0,0]) {
142           linear_extrude(height=0.1) {
143             polygon([[-0.01, 0],
144                      [-0.01, pinminh],
145                      [pinbasew*0.5*(pinminh/pinmaxh), 0]]);
146           }
147           translate([0,0,pintaperlen])
148             linear_extrude(height=pinstraightlen) {
149             polygon([[-0.01, 0],
150                      [-0.01, pinmaxh],
151                      [pinbasew*0.5, 0]]);
152           }
153         }
154       }
155     }
156   }
157 }
158
159 module TestKit(){ ////toplevel
160   translate([30,0,0]) Pin();
161   translate([30,30,0]) Pin();
162   translate([0,40,0]) intersection(){
163     Trestle();
164     translate([-50,-10,-1]) cube([100,100,100]);
165   }
166   intersection(){
167     translate([-60,0,0]) Bar();
168     cube(50,center=true);
169   }
170 }
171
172 //Bar();
173 FtAxlePin();
174 //Trestle();
175 //Pin();
176 //TestKit();
177 //Plug(d=1);
178 //ExtenderPillars(80,12,8, baseweb=true);