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