chiark / gitweb /
Merge branch 'master' of chiark:/u/ianmdlvl/reprap/play
[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 module Plug(d=0){
29   a = -atan(plugslope);
30   tdx = d * cos(a);
31   tdy = d * sin(a);
32   bdx = d / cos(a);
33   translate([-d,0,0]) rotate([90,0,90]) linear_extrude(height=plugl+0.1+d*2){
34     polygon([[-(plugwmin/2 + bdx),  0],
35              [-(plugwmax/2 + tdx),  plugh + tdy],
36              [+(plugwmax/2 + tdx),  plugh + tdy],
37              [+(plugwmin/2 + bdx),  0]]);
38   }
39 }
40
41 module Bar(){
42   spoolw = spoolwidth + spoolwidthgap*2;
43   barz = barradz * 0.5;
44   biggestw = spoolw + 50;
45
46   intersection(){
47     for (mir=[0,1]) {
48       mirror([mir,0,0]) {
49         translate([0,0,barz]) {
50           scale([1,barrady,barradz]) translate([-1,0,0])
51             rotate([0,90,0]) cylinder(r=1, h=spoolw/2+2, $fn=30);
52           translate([spoolw/2,0,0])
53             rotate([0,90,0]) cylinder(r=guiderad, h=guidewidth, $fn=60);
54         }
55         translate([spoolw/2 + guidewidth, 0, 0])
56           Plug();
57       }
58     }
59     translate([-biggestw/2, -50, 0])
60       cube([biggestw, 100, 100]);
61   }
62 }
63
64 module Trestle(){
65   legang = atan2(trestlebase/2, trestleheight);
66   eplen = sqrt(trestleheight*trestleheight + trestlebase*trestlebase*0.25);
67   topcylw = plugwmax + topcylthick*2;
68
69   difference(){
70     union(){
71       for (mir=[0,1]) {
72         mirror([mir,0,0]) {
73           rotate([0,0, -90-legang])
74             ExtenderPillars(length=eplen+trestlelegw,
75                             width=trestlelegw,
76                             height=plugl,
77                             baseweb=true);
78
79           translate([-trestlebase/2, -trestleheight, 0])
80             cylinder(r=trestlelegw/2*1.2, h=plugl);
81         }
82       }
83       translate([-topcylw/2, -topcylbasedepth, 0])
84         cube([topcylw, topcylbasedepth + plugh + topcylthick, plugl]);
85
86       translate([-trestlebase/2, -trestleheight, 0])
87         ExtenderPillars(length=trestlebase, width=trestlebaseh*2, height=plugl);
88     }
89     translate([-300, -trestleheight-50, -1])
90       cube([600, 50, plugl+2]);
91
92     rotate([-90,-90,0])
93       Plug(d=trestleplugd);
94   }
95 }
96
97 //Bar();
98 Trestle();
99
100 //Plug(d=1);
101 //ExtenderPillars(80,12,8, baseweb=true);