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