chiark / gitweb /
tower-base import from dl-things.git e3826f939095f6aa9898e8c286c26a2cc638183b
[reprap-play.git] / tower-base.scad
1
2 motorwidth=35.2;
3 motorheight=36.5;
4 totalheight=65;
5
6 pillarthick=8;
7 sidethick=2.5;
8 archthick=6.5;
9 frameextra=3.5;
10 framesplay=1;
11 botleftgap=4.5;
12 botleftstand=0.75;
13 archoutwards=(pillarthick-archthick)/sqrt(8);
14
15 dovebasecutcylz=4;
16 dovebasecutcylr=10;
17
18 d=0.01;
19
20 mw2=motorwidth/2;
21
22 include <Libs.scad> //  Libs.scad is @ http://www.thingiverse.com/thing:6021
23
24 module corner() {
25         $fn=30;
26         frameheight= motorheight + frameextra;
27         slopeheight= totalheight - frameheight;
28         slope = (mw2 + archoutwards - framesplay)/slopeheight;
29         echo(sqrt(2)*slope);
30
31         translate([-mw2,-mw2,0]) union(){
32                 difference(){
33                         union(){
34                                 cylinder(r=pillarthick/2, h=frameheight);
35                                 translate([0,0,frameheight])
36                                         sphere(r=pillarthick/2);
37                         }
38                         translate([d,d,-1])
39                                 cube([mw2-1,mw2-1,frameheight+pillarthick+2]);
40                 }
41                 intersection(){
42                         multmatrix
43                            ([   [       1,      0,      slope,  -archoutwards ],
44                                 [       0,      1,      slope,  -archoutwards ],
45                                 [       0,      0,      1, frameheight  ],
46                                 [       0,      0,      0,      1       ]])
47                                 translate([0,0,-frameextra])
48                                 cylinder(r=archthick/2,
49                                          h=slopeheight+frameextra);
50                         union() {
51                                 cylinder(r=pillarthick/2, h=frameheight);
52                                 translate([-100,-100,frameheight])
53                                         cube([200,200,100]);
54                         }
55                 }
56         }
57 }
58
59 module halfside() {
60         spacesz = (motorwidth - pillarthick/2*2) / 4;
61         panelheight = spacesz + sidethick;
62         panelbasez = motorheight+pillarthick/4-panelheight;
63         translate([0,-mw2,0]) {
64                 translate([-mw2,-sidethick,0])
65                         cube([motorwidth,sidethick,sidethick]);
66                 difference(){
67                         translate([-mw2,-sidethick, panelbasez])
68                                 cube([mw2,sidethick,panelheight]);
69                         translate([-mw2+pillarthick/3, -sidethick, panelbasez])
70                                 rotate([0,45,0])
71                                 translate([0,-1,0])
72                                 cube([spacesz * sqrt(2),
73                                       sidethick+2,
74                                       spacesz * sqrt(2)]);
75                 }
76                 intersection(){
77                         for (xz=[[-mw2+pillarthick/3-sidethick, 0,
78                                         panelbasez+sidethick],
79                                  [0, 0, panelbasez + sidethick/sqrt(2)]]) {
80                                 translate(xz)
81                                 translate([0,-sidethick,0])
82                                         rotate([0,45,0])
83                                         translate([0,0,-sidethick])
84                                         cube([100, sidethick, sidethick]);
85                         }
86                         translate([-mw2,-sidethick,0])
87                                 cube([motorwidth,sidethick,
88                                         motorheight+pillarthick]);
89                 }
90         }
91 }
92
93 module towerbase() {
94         difference(){
95                 union(){
96                         for (angle=[0,90,180,270])
97                                 rotate([0,0,angle]) corner();
98                         for (angle=[0,90,180]) {
99                                 rotate([0,0,angle]) halfside();
100                                 rotate([0,0,angle]) mirror([1,0,0]) halfside();
101                         }
102                 }
103                 multmatrix([[   -1,     0,      0, -mw2 - botleftstand ],
104                         [       0,      1,      0,      -100    ],
105                         [       1,      0,      1, -100 + botleftgap ],
106                         [       0,      0,      0,      1       ] ])
107                         cube([100,200,100]);
108         }
109         translate([0,0,totalheight])
110                 rotate([0,-90,0])
111                 intersection(){
112                         dovetail(height=10.1, male=true);
113                         translate([dovebasecutcylz,0,-100])
114                                 cylinder(r=dovebasecutcylr,h=200);
115                 };
116 }
117
118 //intersection(){
119         towerbase();
120 //      translate([-100,-100,0]) cube([200,200,32]);
121 //}