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