chiark / gitweb /
8c3536785e9999ef97371cfeff44e90545fdd33b
[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 framesplayx=1;
11 framesplayy=5;
12 botleftgap=4.5;
13 botleftstand=0.75;
14 archoutwards=(pillarthick-archthick)/sqrt(8);
15
16 dovebasecutcylz=4;
17 dovebasecutcylr=10;
18
19 d=0.01;
20
21 mw2=motorwidth/2;
22
23 include <doveclip.scad>
24
25 module corner() {
26         $fn=30;
27         frameheight= motorheight + frameextra;
28         slopeheight= totalheight - frameheight;
29         slopex = (mw2 + archoutwards - framesplayx)/slopeheight;
30         slopey = (mw2 + archoutwards - framesplayy)/slopeheight;
31         //echo(sqrt(2)*slope);
32
33         translate([-mw2,-mw2,0]) union(){
34                 difference(){
35                         union(){
36                                 cylinder(r=pillarthick/2, h=frameheight);
37                                 translate([0,0,frameheight])
38                                         sphere(r=pillarthick/2);
39                         }
40                         translate([d,d,-1])
41                                 cube([mw2-1,mw2-1,frameheight+pillarthick+2]);
42                 }
43                 intersection(){
44                         multmatrix
45                            ([   [       1,      0,      slopey, -archoutwards ],
46                                 [       0,      1,      slopex, -archoutwards ],
47                                 [       0,      0,      1, frameheight  ],
48                                 [       0,      0,      0,      1       ]])
49                                 translate([0,0,-frameextra])
50                                 cylinder(r=archthick/2,
51                                          h=slopeheight+frameextra);
52                         union() {
53                                 cylinder(r=pillarthick/2, h=frameheight);
54                                 translate([-100,-100,frameheight])
55                                         cube([200,200,100]);
56                         }
57                 }
58         }
59 }
60
61 module halfside() {
62         spacesz = (motorwidth - pillarthick/2*2) / 4;
63         panelheight = spacesz + sidethick;
64         panelbasez = motorheight+pillarthick/4-panelheight;
65         translate([0,-mw2,0]) {
66                 translate([-mw2,-sidethick,0])
67                         cube([motorwidth,sidethick,sidethick]);
68                 difference(){
69                         translate([-mw2,-sidethick, panelbasez])
70                                 cube([mw2,sidethick,panelheight]);
71                         translate([-mw2+pillarthick/3, -sidethick, panelbasez])
72                                 rotate([0,45,0])
73                                 translate([0,-1,0])
74                                 cube([spacesz * sqrt(2),
75                                       sidethick+2,
76                                       spacesz * sqrt(2)]);
77                 }
78                 intersection(){
79                         for (xz=[[-mw2+pillarthick/3-sidethick, 0,
80                                         panelbasez+sidethick],
81                                  [0, 0, panelbasez + sidethick/sqrt(2)]]) {
82                                 translate(xz)
83                                 translate([0,-sidethick,0])
84                                         rotate([0,45,0])
85                                         translate([0,0,-sidethick])
86                                         cube([100, sidethick, sidethick]);
87                         }
88                         translate([-mw2,-sidethick,0])
89                                 cube([motorwidth,sidethick,
90                                         motorheight+pillarthick]);
91                 }
92         }
93 }
94
95 module towerbase() {
96         difference(){
97                 union(){
98                         for (mirx=[0,1]) for (miry=[0,1])
99                                 mirror([mirx,0,0]) mirror([0,miry,0]) corner();
100                         for (angle=[0,90,180]) {
101                                 rotate([0,0,angle]) halfside();
102                                 rotate([0,0,angle]) mirror([1,0,0]) halfside();
103                         }
104                 }
105                 multmatrix([[   -1,     0,      0, -mw2 - botleftstand ],
106                         [       0,      1,      0,      -100    ],
107                         [       1,      0,      1, -100 + botleftgap ],
108                         [       0,      0,      0,      1       ] ])
109                         cube([100,200,100]);
110         }
111         translate([0,-5.0,totalheight]) {
112                 rotate([-90,0,0])
113                                 DoveClipPair(h=10.1);
114         }
115 }
116
117 //intersection(){
118         towerbase();
119 //      translate([-100,-100,0]) cube([200,200,32]);
120 //}