chiark / gitweb /
b546360b4f6ba68d296ad07537a6df5cb292b46d
[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 barrady = 5;
11 barradz = 7;
12 guidewidth = 3;
13 guiderad = 20;
14
15 plugl = 12;
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 = 3;
26 topblockbasedepth = 4;
27
28 pinbasew = 3;
29 pinminh = 1.0;
30 pinmaxh = 3;
31 pindh = 1.0;
32 pindwidth = 1.0;
33
34 module Plug(d=0){
35   dw = d;
36   dh = d;
37   a = atan(plugslope);
38   bdx = dw / cos(a);
39   tdy = dh;
40   tdx = bdx + dh * plugslope;
41   translate([-d,0,0]) rotate([90,0,90]) linear_extrude(height=plugl+0.1+d*2){
42     polygon([[-(plugwmin/2 + bdx),  0],
43              [-(plugwmax/2 + tdx),  plugh + tdy],
44              [+(plugwmax/2 + tdx),  plugh + tdy],
45              [+(plugwmin/2 + bdx),  0]]);
46   }
47 }
48
49 module Bar(){
50   spoolw = spoolwidth + spoolwidthgap*2;
51   barz = barradz * 0.5;
52   biggestw = spoolw + 50;
53
54   intersection(){
55     for (mir=[0,1]) {
56       mirror([mir,0,0]) {
57         translate([0,0,barz]) {
58           scale([1,barrady,barradz]) translate([-1,0,0])
59             rotate([0,90,0]) cylinder(r=1, h=spoolw/2+2, $fn=30);
60           translate([spoolw/2,0,0])
61             rotate([0,90,0]) cylinder(r=guiderad, h=guidewidth, $fn=60);
62         }
63         translate([spoolw/2 + guidewidth, 0, 0])
64           Plug();
65       }
66     }
67     translate([-biggestw/2, -50, 0])
68       cube([biggestw, 100, 100]);
69   }
70 }
71
72 module Trestle(){
73   legang = atan2(trestlebase/2, trestleheight);
74   eplen = sqrt(trestleheight*trestleheight + trestlebase*trestlebase*0.25);
75   topblockw = plugwmax + topblockthick*2;
76
77   pinholebasew = pinbasew + pindwidth;
78   pinholeh =     pinminh +  pindh;
79
80   difference(){
81     union(){
82       for (mir=[0,1]) {
83         mirror([mir,0,0]) {
84           rotate([0,0, -90-legang])
85             ExtenderPillars(length=eplen+trestlelegw,
86                             width=trestlelegw,
87                             height=plugl,
88                             baseweb=true);
89
90           translate([-trestlebase/2, -trestleheight, 0])
91             cylinder(r=trestlelegw/2*1.2, h=plugl);
92         }
93       }
94       translate([-topblockw/2, -topblockbasedepth, 0])
95         cube([topblockw, topblockbasedepth + plugh + topblockthick, plugl]);
96
97       translate([-trestlebase/2, -trestleheight, 0])
98         ExtenderPillars(length=trestlebase, width=trestlebaseh*2, height=plugl);
99     }
100     translate([-300, -trestleheight-50, -1])
101       cube([600, 50, plugl+2]);
102
103     rotate([-90,-90,0])
104       Plug(d=trestleplugd);
105
106     for (rot=[0,180]) {
107       translate([0,0,plugl/2]) rotate([0,rot,0]) translate([0,0,-plugl/2]) {
108         translate([-(topblockw*0.25+1),
109                    plugh,
110                    (plugl - pinholebasew*2)/3]) rotate([0,90,0]) {
111           linear_extrude(height = topblockw*1.0+2) {
112             polygon([[-1.0 * pinholebasew, -0.01],
113                      [-0.5 * pinholebasew, pinholeh],
114                      [ 0                 , -0.01]]);
115           }
116         }
117       }
118     }
119   }
120 }
121
122 //Bar();
123 Trestle();
124
125 //Plug(d=1);
126 //ExtenderPillars(80,12,8, baseweb=true);