chiark / gitweb /
filamenttrestle wip now triangular pins
[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 pinbasew = 3;
29 pinminh = 1.0;
30 pinmaxh = 3;
31 pindh = 1.0;
32 pindwidth = 1.0;
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   pinholebasew = pinbasew + pindwidth;
76   pinholeh =     pinminh +  pindh;
77
78   difference(){
79     union(){
80       for (mir=[0,1]) {
81         mirror([mir,0,0]) {
82           rotate([0,0, -90-legang])
83             ExtenderPillars(length=eplen+trestlelegw,
84                             width=trestlelegw,
85                             height=plugl,
86                             baseweb=true);
87
88           translate([-trestlebase/2, -trestleheight, 0])
89             cylinder(r=trestlelegw/2*1.2, h=plugl);
90         }
91       }
92       translate([-topcylw/2, -topcylbasedepth, 0])
93         cube([topcylw, topcylbasedepth + plugh + topcylthick, plugl]);
94
95       translate([-trestlebase/2, -trestleheight, 0])
96         ExtenderPillars(length=trestlebase, width=trestlebaseh*2, height=plugl);
97     }
98     translate([-300, -trestleheight-50, -1])
99       cube([600, 50, plugl+2]);
100
101     rotate([-90,-90,0])
102       Plug(d=trestleplugd);
103
104     for (rot=[0,180]) {
105       translate([0,0,plugl/2]) rotate([0,rot,0]) translate([0,0,-plugl/2]) {
106         translate([-(topcylw*0.25+1),
107                    plugh,
108                    (plugl - pinholebasew*2)/3]) rotate([0,90,0]) {
109           linear_extrude(height = topcylw*1.0+2) {
110             polygon([[-1.0 * pinholebasew, -0.01],
111                      [-0.5 * pinholebasew, pinholeh],
112                      [ 0                 , -0.01]]);
113           }
114         }
115       }
116     }
117   }
118 }
119
120 //Bar();
121 Trestle();
122
123 //Plug(d=1);
124 //ExtenderPillars(80,12,8, baseweb=true);