-
Notifications
You must be signed in to change notification settings - Fork 0
/
vivacalc.scad
215 lines (199 loc) · 6.9 KB
/
vivacalc.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
// USER VARIABLES //
// Terrarium statistics //
// Total lenght of terrarium?
terralength=2000;
// Total height of terrarium?
terraheight=600;
// Total depth of terrarium?
terradepth=500;
// Width of the OSB boards?
boardwidth=12;
// Width of the trusses?
trusswidth=34;
// WINDOWS //
// Height of the window pane on the top?
windowpanetop=100;
// Height of the window pane on the bottom?
windowpanebottom=100;
// How much overlap should the windows have? (3cm - 5cm is common)
windowOverdraft=50;
// SUPPORTS //
// Number of additional supports, excluding trusses on the left and right?
numberofsupports=2;
// Show/hide certain parts (will not calculate them either!)
// Show the windows?
showWindows=true;
// Show the panels on the outside?
showOuterPanels=true;
// Show the window frames?
showWindowFrames=true;
// Show the truss framework?
showFramework=true;
// Show or hide the supports?
showSupports=true;
// END OF USER VARIABLES //
// These will be derived from the above user variables and exist solely for readability.
// Outer panes
topbottompanelenght = terralength - (boardwidth*2);
backplaneheight = terraheight - (boardwidth *2);
// trusses
// vertical (blue)
verticaltrusslength = (terraheight-(trusswidth*2 + boardwidth*2));
// horizontal (red)
horizontaltrusslength = (terralength-boardwidth*2);
// deep (green)
deeptrusslength = (terradepth-(trusswidth*2+boardwidth*2));
// supports
distancebetweensupports = ((terralength - (trusswidth+boardwidth*2)) / (numberofsupports +1));
// Windows
windowlength = (terralength-(boardwidth*2)) / 2 + windowOverdraft;
windowheight = (terraheight-(boardwidth*2)-(windowpanetop + windowpanebottom));
windowwidth = (boardwidth/2);
windowplanelenght = terralength-(boardwidth*2);
echo("--8<------ BEGIN STATISTICS ------8<--");
if (showOuterPanels){
echo(str("2x OUTER boards (orange): ", terradepth, "x", terraheight));
echo(str("2x OUTER boards (pink): ", terradepth, "x", topbottompanelenght));
echo(str("1x BACKPLANE board (teal): ", backplaneheight, "x", topbottompanelenght));
// Left and right boards (orange)
color("orange") {
// left
cube([boardwidth,terradepth,terraheight]);
// right
translate([(terralength-boardwidth),0,0]) {
cube([boardwidth,terradepth,terraheight]);
}
}
color("pink") {
// bottom
translate([boardwidth,0,0]) {
cube([topbottompanelenght,terradepth,boardwidth]);
}
// top
translate([boardwidth,0,(terraheight-boardwidth)]) {
cube([topbottompanelenght,(terradepth),boardwidth]);
}
}
color("teal") {
// backplane board
translate([boardwidth,(terradepth-boardwidth),boardwidth]) {
cube([topbottompanelenght,boardwidth,backplaneheight]);
}
}
}
if(showFramework){
color("red") {
echo(str("4x TRUSS - horizontal (red): ", horizontaltrusslength, "(l)"));
// Front top
translate([boardwidth,boardwidth,(terraheight-(trusswidth+boardwidth))]) {
cube([horizontaltrusslength,trusswidth,trusswidth]);
}
// Back top
translate([boardwidth,(terradepth-(trusswidth+boardwidth)),(terraheight-(trusswidth+boardwidth))]){
cube([horizontaltrusslength,trusswidth,trusswidth]);
}
// Back bottom
translate([boardwidth,(terradepth-(trusswidth+boardwidth)),boardwidth]){
cube([horizontaltrusslength,trusswidth,trusswidth]);
}
// Front bottom
translate([boardwidth,boardwidth,boardwidth]){
cube([horizontaltrusslength,trusswidth,trusswidth]);
}
}
color("blue") {
echo(str("4x TRUSS - vertical (blue): ", verticaltrusslength, "(l)"));
// left front
translate([boardwidth,boardwidth,trusswidth+boardwidth]) {
cube([trusswidth,trusswidth,verticaltrusslength]);
}
// left back
translate([boardwidth,(terradepth-(trusswidth+boardwidth)),trusswidth+boardwidth]) {
cube([trusswidth,trusswidth,verticaltrusslength]);
}
// right back
translate([(terralength-(trusswidth+boardwidth)),(terradepth-(trusswidth+boardwidth)),trusswidth+boardwidth]) {
cube([trusswidth,trusswidth,verticaltrusslength]);
}
// right front
translate([(terralength-(trusswidth+boardwidth)),boardwidth,trusswidth+boardwidth]) {
cube([trusswidth,trusswidth,verticaltrusslength]);
}
}
color("green"){
echo(str("4x TRUSS - deep (green): ", deeptrusslength, "(l)"));
// left bottom
translate([boardwidth,(trusswidth+boardwidth),boardwidth]) {
cube([trusswidth,deeptrusslength,trusswidth]);
}
// left top
translate([boardwidth,trusswidth+boardwidth,(terraheight-(trusswidth+boardwidth))]) {
cube([trusswidth,deeptrusslength,trusswidth]);
}
// right bottom
translate([(terralength-(trusswidth+boardwidth)),trusswidth+boardwidth,boardwidth]) {
cube([trusswidth,deeptrusslength,trusswidth]);
}
// right top
translate([(terralength-(trusswidth+boardwidth)),trusswidth+boardwidth,(terraheight-(trusswidth+boardwidth))]) {
cube([trusswidth,deeptrusslength,trusswidth]);
}
}
}
if (showSupports) {
if(numberofsupports > 0) {
// green
echo(str(numberofsupports * 2, "x TRUSS - for supports, deep (green): ", deeptrusslength, "(l)"));
echo(str(numberofsupports, "x TRUSS - for supports, vertical (blue): ", horizontaltrusslength, "(l)"));
for (i = [1 : numberofsupports]){
offsetleft = (distancebetweensupports*(i)+boardwidth);
color("green") {
// bottom
translate([offsetleft, (trusswidth+boardwidth), boardwidth]) {
cube([trusswidth, deeptrusslength, trusswidth]);
}
// top
translate([offsetleft, (trusswidth+boardwidth), (terraheight-(boardwidth+trusswidth))]) {
cube([trusswidth, deeptrusslength, trusswidth]);
}
}
// back
translate([offsetleft, (terradepth-(trusswidth+boardwidth)), (boardwidth+trusswidth)]) {
color("blue") {
cube([trusswidth, trusswidth, verticaltrusslength]);
}
}
}
}
}
if (showWindowFrames){
//Window frame bottom
echo(str("1x WINDOW PANE BOTTOM (magenta): ", windowplanelenght, "(l) x ", windowpanebottom, "(h)"));
color("magenta") {
translate([((boardwidth)),0, boardwidth]) {
cube([windowplanelenght, boardwidth, windowpanebottom]);
}
}
echo(str("1x WINDOW PANE TOP (brown): ", windowplanelenght, "(l) x ", windowpanetop, "(h)"));
//Window frame top
color("brown") {
translate([((boardwidth)),boardwidth, (terraheight-(boardwidth))]){
rotate(a=180, v=[1,0,0]){
cube([windowplanelenght, boardwidth, windowpanetop]);
}
}
}
}
// Windows
if (showWindows) {
echo(str("2x WINDOW (Black): ", windowlength, "(l) x ", windowheight, "(h) x ", windowwidth, "(maximum width)"));
color("black", 0.4) {
translate([((boardwidth)),0,(boardwidth+windowpanebottom)]) {
cube([windowlength, windowwidth, windowheight]);
}
translate([((terralength - (boardwidth+windowlength))),(boardwidth/2),(boardwidth+windowpanebottom)]){
cube([windowlength, windowwidth, windowheight]);
}
}
}
echo("----8<---- END STATISTICS ----8<----");