chiark / gitweb /
10254 our tower-base ready for test print?
[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-sidethick, 0,
71                                         panelbasez+sidethick],
72                                  [0, 0, panelbasez + sidethick/sqrt(2)]]) {
73                                 translate(xz)
74                                 translate([0,-sidethick,0])
75                                         rotate([0,45,0])
76                                         translate([0,0,-sidethick])
77                                         cube([100, sidethick, sidethick]);
78                         }
79                         translate([-mw2,-sidethick,0])
80                                 cube([motorwidth,sidethick,
81                                         motorheight+pillarthick]);
82                 }
83         }
84 }
85
86 module towerbase() {
87         difference(){
88                 union(){
89                         for (angle=[0,90,180,270])
90                                 rotate([0,0,angle]) corner();
91                         for (angle=[0,90,180]) {
92                                 rotate([0,0,angle]) halfside();
93                                 rotate([0,0,angle]) mirror([1,0,0]) halfside();
94                         }
95                 }
96                 multmatrix([[   -1,     0,      0, -mw2 - botleftstand ],
97                         [       0,      1,      0,      -100    ],
98                         [       1,      0,      1, -100 + botleftgap ],
99                         [       0,      0,      0,      1       ] ])
100                         cube([100,200,100]);
101         }
102         translate([0,0,totalheight])
103                 rotate([0,-90,0])
104                 dovetail(height=10.1, male=true);
105 }
106
107 //intersection(){
108         towerbase();
109 //      translate([-100,-100,0]) cube([200,200,32]);
110 //}