chiark / gitweb /
doveclip ExtenderPillars optional baseweb
[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 = min(8, DoveClipPairSane_width(2));
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 = 7;
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([[-(plugwmax/2 + bdx),  0],
35              [-(plugwmin/2 + tdx),  plugh + tdy],
36              [+(plugwmin/2 + tdx),  plugh + tdy],
37              [+(plugwmax/2 + bdx),  0]]);
38   }
39   translate([plugl + DoveClip_depth()*0.7 + d, 0, 0])
40     DoveClipPairSane(count=1, h=plugh-0.1);
41 }
42
43 module Bar(){
44   spoolw = spoolwidth + spoolwidthgap*2;
45   barz = barradz * 0.5;
46   biggestw = spoolw + 50;
47
48   intersection(){
49     for (mir=[0,1]) {
50       mirror([mir,0,0]) {
51         translate([0,0,barz]) {
52           scale([1,barrady,barradz]) translate([-1,0,0])
53             rotate([0,90,0]) cylinder(r=1, h=spoolw/2+2, $fn=30);
54           translate([spoolw/2,0,0])
55             rotate([0,90,0]) cylinder(r=guiderad, h=guidewidth, $fn=60);
56         }
57         translate([spoolw/2 + guidewidth, 0, 0])
58           Plug();
59       }
60     }
61     translate([-biggestw/2, -50, 0])
62       cube([biggestw, 100, 100]);
63   }
64 }
65
66 module Trestle(){
67   legang = atan2(trestlebase/2, trestleheight);
68   eplen = sqrt(trestleheight*trestleheight + trestlebase*trestlebase*0.25);
69   topcylr = max(plugwmax/2,
70                 trestlelegw/2,
71                 sqrt(plugwmin*2/4 + plugh*plugh)
72                 ) + topcylthick + trestleplugd;
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
83           translate([-trestlebase/2, -trestleheight, 0])
84             cylinder(r=trestlelegw/2*1.2, h=plugl);
85         }
86       }
87       intersection(){
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 //Plug(d=1);
106 Trestle();