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