chiark / gitweb /
filamenttrestle wip with spool core circular bar
[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
9 spoolwidthgap = 2;
10 barrad = 7;
11 guidewidth = 3;
12 guiderad = 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([0,0,barz]) {
63           translate([-1,0,0])
64             rotate([0,90,0]) cylinder(r=barrad, h=spoolw/2+2, $fn=30);
65           translate([spoolw/2,0,0])
66             rotate([0,90,0]) cylinder(r=guiderad, h=guidewidth, $fn=60);
67         }
68         translate([spoolw/2 + guidewidth, 0, 0])
69           Plug();
70       }
71     }
72     translate([-biggestw/2, -50, 0])
73       cube([biggestw, 100, 100]);
74   }
75 }
76
77 module Trestle(){ ////toplevel
78   legang = atan2(trestlebase/2, trestleheight);
79   eplen = sqrt(trestleheight*trestleheight + trestlebase*trestlebase*0.25);
80   topblockw = plugwmax + trestleplugd*2 + topblockthick*2;
81
82   pinholebasew = pinbasew + pindwidth*2;
83   pinholeh =     pinmaxh +  pindh;
84
85   difference(){
86     union(){
87       for (mir=[0,1]) {
88         mirror([mir,0,0]) {
89           rotate([0,0, -90-legang])
90             ExtenderPillars(length=eplen+trestlelegw,
91                             width=trestlelegw,
92                             height=legw,
93                             baseweb=true);
94
95           translate([-trestlebase/2, -trestleheight, 0])
96             cylinder(r=trestlelegw/2*1.2, h=plugl);
97         }
98       }
99       translate([-topblockw/2, -topblockbasedepth, 0])
100         cube([topblockw,
101               topblockbasedepth + plugh + topblockthick
102               + (pinmaxh - pinminh)*0.6 + pindh,
103               plugl]);
104
105       translate([-trestlebase/2, -trestleheight, 0])
106         ExtenderPillars(length=trestlebase, width=trestlebaseh*2, height=legw);
107     }
108     translate([-300, -trestleheight-50, -1])
109       cube([600, 50, plugl+2]);
110
111     rotate([-90,-90,0])
112       Plug(d=trestleplugd);
113
114     for (rot=[0,180]) {
115       translate([0,0,plugl/2]) rotate([0,rot,0]) translate([0,0,-plugl/2]) {
116         translate([-(topblockw*0.25+1),
117                    plugh + pindh - (pinmaxh - pinminh)*0.75,
118                    (plugl - pinholebasew*2)/3]) {
119           translate([0,0,pinholebasew/2]) rotate([-90,0,0]) %Pin();
120           rotate([0,90,0]) {
121             linear_extrude(height = topblockw*1.0+2) {
122               polygon([[-1.0 * pinholebasew, -0.01],
123                        [-0.5 * pinholebasew, pinholeh],
124                        [ 0                 , -0.01]]);
125             }
126           }
127         }
128       }
129     }
130   }
131 }
132
133 module Pin(){ ////toplevel
134   rotate([90,0,90]) {
135     hull(){
136       for (mir=[0,1]) {
137         mirror([mir,0,0]) {
138           linear_extrude(height=0.1) {
139             polygon([[-0.01, 0],
140                      [-0.01, pinminh],
141                      [pinbasew*0.5*(pinminh/pinmaxh), 0]]);
142           }
143           translate([0,0,pintaperlen])
144             linear_extrude(height=pinstraightlen) {
145             polygon([[-0.01, 0],
146                      [-0.01, pinmaxh],
147                      [pinbasew*0.5, 0]]);
148           }
149         }
150       }
151     }
152   }
153 }
154
155 module TestKit(){ ////toplevel
156   translate([30,0,0]) Pin();
157   translate([30,30,0]) Pin();
158   translate([0,40,0]) intersection(){
159     Trestle();
160     translate([-50,-10,-1]) cube([100,100,100]);
161   }
162   intersection(){
163     translate([-60,0,0]) Bar();
164     cube(50,center=true);
165   }
166 }
167
168 Bar();
169 //Trestle();
170 //Pin();
171 //TestKit();
172 //Plug(d=1);
173 //ExtenderPillars(80,12,8, baseweb=true);