chiark / gitweb /
filamenttrestle wip before wedges
[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   topcylr = max(plugwmax/2,
68                 trestlelegw/2,
69                 sqrt(plugwmin*2/4 + plugh*plugh)
70                 ) + topcylthick + trestleplugd;
71
72   difference(){
73     union(){
74       for (mir=[0,1]) {
75         mirror([mir,0,0]) {
76           rotate([0,0, -90-legang])
77             ExtenderPillars(length=eplen+trestlelegw,
78                             width=trestlelegw,
79                             height=plugl,
80                             baseweb=true);
81
82           translate([-trestlebase/2, -trestleheight, 0])
83             cylinder(r=trestlelegw/2*1.2, h=plugl);
84         }
85       }
86       intersection(){
87         translate([0, 3, 0])
88           cylinder(r=topcylr, h=plugl);
89         translate([-50, -topcylbasedepth, -1])
90           cube([100, 50, plugl+2]);
91       }
92
93       translate([-trestlebase/2, -trestleheight, 0])
94         ExtenderPillars(length=trestlebase, width=trestlebaseh*2, height=plugl);
95     }
96     translate([-300, -trestleheight-50, -1])
97       cube([600, 50, plugl+2]);
98
99     rotate([-90,-90,0])
100       Plug(d=trestleplugd);
101   }
102 }
103
104 //Bar();
105 Trestle();
106
107 //Plug(d=1);
108 //ExtenderPillars(80,12,8, baseweb=true);