chiark / gitweb /
filamentspool only module now
[reprap-play.git] / tower-base.scad
1 /* -*- C -*- */
2
3 motorwidth=35.7;
4 motorheight=34.5;
5 totalheight=58;
6
7 pillarthick=8;
8 sidethick=2.5;
9 archthick=6.5;
10 frameextra=3.5;
11 framesplayx=5;
12 framesplayy=1;
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(slopex*slopex + slopey*slopey));
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,55,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   topgluecubex=17;
98   topgluecubez=5;
99   clippairy=10;
100   clippairdz=-2.5;
101   topgluecubedy=1;
102
103   difference(){
104     union(){
105       for (mirx=[0,1]) for (miry=[0,1])
106                          mirror([mirx,0,0]) mirror([0,miry,0]) corner();
107       for (angle=[0,90,180]) {
108         rotate([0,0,angle]) halfside();
109         rotate([0,0,angle]) mirror([1,0,0]) halfside();
110       }
111     }
112 //    multmatrix([[     -1,     0,      0, -mw2 - botleftstand ],
113 //              [       0,      1,      0,      -100    ],
114 //              [       1,      0,      1, -100 + botleftgap ],
115 //              [       0,      0,      0,      1       ] ])
116 //      cube([100,200,100]);
117   }
118   translate([clippairy/2,0,totalheight]) {
119     difference(){
120       translate([-clippairy+topgluecubedy/2,-topgluecubex/2,0])
121         cube([clippairy-topgluecubedy,topgluecubex,topgluecubez]);
122     }
123     translate([0,0,topgluecubez+clippairdz]) rotate([-90,0,90])
124       DoveClipPair(h=clippairy);
125   }
126 }
127
128 //intersection(){
129 towerbase();
130 //      translate([-100,-100,0]) cube([200,200,32]);
131 //}