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