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