-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sala.scad
334 lines (309 loc) · 14.3 KB
/
Sala.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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
units = 10;
scale = 30;
$fn = 60; // facets
s = units/scale; // scaling factor
soft = 2*s; // radius for soft bevels depends on scale
sharp = 1*.2; // radius for sharper edges
/* [Furniture Type] */
//Escolher o Sofa.
escolha = 9; // [1:Sofá Pequeno,2:Sofá Grande,3:Estante Sala,4:Móvel TV, 5:Móvel CDs, 6:Puff Sala, 7: Coluna Sala, 8: Mesa Sala, 9:Mesinha Sala]
main(); // build it!
module main(){
// custom designs with user dimensions
if (escolha==1) sofa(depth=79,length=74,height=79,numCushions=1,depthBack=7,heightBack=72,depthBackCushion=18,heightBottom=26.5,heightBottomCushion=10,lengthArm=13.5,heightArm=53.5,depthFeet=8,lengthFeet=8,heightFeet=3.5);
if (escolha==2) sofa(depth=79,length=180,height=79,numCushions=3,depthBack=7,heightBack=72,depthBackCushion=18,heightBottom=24.5,heightBottomCushion=10.5,lengthArm=13.5,heightArm=53.5,depthFeet=8,lengthFeet=8,heightFeet=3.5);
if (escolha==3) estanteSala();
if (escolha==4) movelTV();
if (escolha==5) movelCD();
if (escolha==6) puff();
if (escolha==7) colunaSala();
if (escolha==8) mesaSala();
if (escolha==9) mesinhaSala();
}
module estanteSala() {
scale(s)
union(){
cuboid(35,210,10,soft);
for (a =[0:2]) {
translate([0,0,10 + 5*a + 35*(a+1)]) cuboid(35,210,5,soft);
}
translate([0,20,0]) cuboid(35,5,130,soft);
translate([0,210-20,0]) cuboid(35,5,130,soft);
}
}
module puff() {
scale(s)
union(){
depth = 71;
length = 71;
height = 27;
heightCushion = 10;
espFeet = 2.5;
heightFeet = 4;
depthFeet = 8;
lengthFeet = 8;
translate([espFeet,espFeet,-heightFeet + 1]) cuboid(depthFeet,lengthFeet,heightFeet + 1,soft);
translate([depth - depthFeet - espFeet,espFeet,-heightFeet]) cuboid(depthFeet,lengthFeet,heightFeet + 1,soft);
translate([espFeet,length - depthFeet - espFeet,-heightFeet]) cuboid(depthFeet,lengthFeet,heightFeet + 1,soft);
translate([depth - depthFeet - espFeet,length - lengthFeet - espFeet,-heightFeet]) cuboid(depthFeet,lengthFeet,heightFeet + 1,soft);
cuboid(depth,length,height,soft*5);
translate([0,0,height]) cuboid(depth,length,heightCushion,soft*9);
}
}
module colunaSala() {
scale(s)
union(){
depth = 26;
length = 24.5;
height = 37.5;
depth2 = 1;
length2 = 21;
length3 = 16;
height2 = 36;
difference() {
translate([-0.5,length/2,height-10]) rotate([0,90,0]) cylinder(depth/2,3.5,3.5);
translate([-1.1,length/2,height-10]) rotate([0,90,0]) cylinder(depth/2,3,3);
}
difference() {
translate([-1,length/2-9.5/2,5.5]) cuboid(5,9.5,8,soft);
translate([-1.1,length/2-6.5/2,7]) cuboid(5,6.5,5,soft);
}
difference() {
cuboid(depth,length,height,soft*2); //body
translate([0,length/2,height-10]) rotate([0,90,0]) cylinder(depth/2,3,3);
translate([-1.1,length/2-6.5/2,7]) cuboid(5,6.5,5,soft);
}
hull() {
translate([depth,(length-length2)/2,(height-height2)/2]) cuboid(depth2/2,length2,height2,soft);
translate([depth+depth2/2,(length-length3)/2,(height-height2)/2]) cuboid(depth2/2,length3,height2,soft);
} //front
}
}
module TV() {
scale(s)
union(){
}
}
module mesaSala() {
scale(s)
union(){
color("blue") translate([110/2,55,0]) oval(55,55,3);
color("blue") translate([0,55,0]) cube([110,40,3]);
color("blue") translate([110/2,55+40,0]) oval(55,55,3);
color("blue") translate([0,55,1.5]) rotate([270,0,0]) cylinder(40,1.5,1.5);
color("blue") translate([110,55,1.5]) rotate([270,0,0]) cylinder(40,1.5,1.5);
color("blue") translate([110/2,55,1.5])#rotate_extrude()translate([55,0,0])circle(r=1.5);
color("blue") translate([110/2,55+40,1.5])#rotate_extrude()translate([55,0,0])circle(r=1.5);
difference() {
translate([110/2,75,-6]) cylinder(8,50.5,50.5);
translate([110/2,75,-7]) cylinder(8,49,49);
}
// translate([110/2,75,-6]) cylinder(9,5.5,5.5); //temp
translate([110/2,75,-6-66]) {
// rotate([0, 0, 45]) translate([-2.75,-2.75,0]) cuboid(5.5,5.5,66+7,soft*2);
rotate([0, 0, 45]) translate([-2.75 + 101/2 -1,-2.75,0]) cuboid(5.5,5.5,66+7,sharp);
rotate([0, 0, 45]) translate([-2.75,-2.75 +101/2-1,0]) cuboid(5.5,5.5,66+7,sharp);
rotate([0, 0, 45]) translate([-2.75 ,-2.75 - 101/2 +1,0]) cuboid(5.5,5.5,66+7,sharp);
rotate([0 ,0, 45]) translate([-2.75 -101/2+1,-2.75,0]) cuboid(5.5,5.5,66+7,sharp);
}
translate([110/2,75,-6-66+13.5]) {
rotate([0, 0, 45]) translate([-51,-4/2,0]) cuboid(102,4,5.2,sharp);
rotate([0, 0, 135]) translate([-51,-4/2,0]) cuboid(102,4,5.2,sharp);
}
}
}
module mesinhaSala() {
scale(s)
union(){
topo();
baixo();
pernas();
}
module topo() {
depth = 55;
depth2 = 43;
depth3 = 38;
length = 90;
length2 = 78.5;
length3 = 73;
height = 2.2;
points = [[-length/2,depth2/2],[-length2/2,depth/2],[length2/2,depth/2],[length/2,depth2/2],[length/2,-depth2/2],[length2/2,-depth/2],[-length2/2,-depth/2],[-length/2,-depth2/2],[-length2/2 +2 ,depth3/2 - 2],[-length3/2 +2,depth2/2 - 2],[length3/2 -2,depth2/2 -2],[length2/2 -2,depth3/2 -2],[length2/2 -2,-depth3/2 +2],[length3/2 - 2,-depth2/2 +2],[-length3/2 +2,-depth2/2 +2],[-length2/2 +2,-depth3/2 +2]];
points2 = [[-length/2,depth2/2],[-length2/2,depth/2],[length2/2,depth/2],[length/2,depth2/2],[length/2,-depth2/2],[length2/2,-depth/2],[-length2/2,-depth/2],[-length/2,-depth2/2],[-length2/2,depth3/2],[-length3/2,depth2/2],[length3/2,depth2/2],[length2/2,depth3/2],[length2/2,-depth3/2],[length3/2,-depth2/2],[-length3/2,-depth2/2],[-length2/2,-depth3/2]];
color("orange") translate([0,0,43.3]) linear_extrude(1.2) polygon(points,[[0,1,2,3,4,5,6,7],[8,9,10,11,12,13,14,15]],1);
color("red") translate([0,0,44.5]) linear_extrude(1) polygon(points2,[[0,1,2,3,4,5,6,7],[8,9,10,11,12,13,14,15]],1);
}
module baixo() {
depth = 46.8;
depth2 = 37.2;
length = 81.8;
length2 = 72;
length3 = 61;
height = 2.2;
points = [[-length/2,depth2/2 + 3],[-length2/2 - 3,depth/2],[length2/2 + 3,depth/2],[length/2,depth2/2 + 3],[length/2,-depth2/2 -3],[length2/2 + 3,-depth/2],[-length2/2 - 3,-depth/2],[-length/2,-depth2/2 - 3],[-length2/2,depth2/2],[length2/2,depth2/2],[length2/2,-depth2/2],[-length2/2,-depth2/2]];
translate([0,0,11]) linear_extrude(height) polygon(points,[[0,1,2,3,4,5,6,7],[8,9,10,11]],1);
for (i=[0:6]) {
translate([-length3/2 +(length3/6 -2/3)*i,-depth/2,11]) cuboid(4,depth,height,sharp);
}
}
module pernas() {
depth = 51;
depth2 = 36.2;
length = 86;
length2 = 71;
height = 45;
points1 = [[-length/2,-depth2/2],[-length/2,-2.5-depth2/2],[-2.5-length2/2,-depth/2],[-length2/2,-depth/2]];
points2 = [[length2/2,depth/2],[length2/2 + 2.5,depth/2],[length/2,depth2/2 + 2.5],[length/2,depth2/2]];
points3 = [[-length2/2,depth/2],[-length2/2 - 2.5,depth/2],[-length/2,depth2/2 + 2.5],[-length/2,depth2/2]];
points4 = [[length2/2,-depth/2],[length2/2 + 2.5,-depth/2],[length/2,-depth2/2 - 2.5],[length/2,-depth2/2]];
color("blue") linear_extrude(height) polygon(points1,[[0,1,2,3]],1);
color("blue") linear_extrude(height) polygon(points2,[[0,1,2,3]],1);
color("blue") linear_extrude(height) polygon(points3,[[0,1,2,3]],1);
color("blue") linear_extrude(height) polygon(points4,[[0,1,2,3]],1);
}
}
module oval(w,h, height, center = false) {
scale([1, h/w, 1]) cylinder(h=height, r=w, center=center);
}
module movelTV() {
scale(s)
union(){
// difference () {
cil = 4;
offset = 2.5;
cuboid(60,181,3.5,soft); //base
translate([offset,offset,0]) peMovelTV();
translate([60 - cil - offset,offset,0]) peMovelTV();
translate([offset,181 - cil - offset,0]) peMovelTV();
translate([60 - cil - offset,181 - cil - offset,0]) peMovelTV();
translate([offset,90.5-cil,0]) peMovelTV();
translate([60 - cil - offset,90.5 - cil,0]) peMovelTV();
// // }
translate([0,0,31-3.5]) cuboid(60,135,3.5,soft); //topo
cuboid(60,2.5,31,soft); //esquerda
translate([0,135-2.5,0]) cuboid(60,2.5,31,soft); //direita
translate([0,94-2.5,0]) cuboid(60,2.5,31,soft); //meio vert
translate([10,94,3.5]){
esp =3;
translate([-10,0,0]){
translate([0,-3.5+esp,-1]) cube([55,135-94,3]);
translate([0,-3.5+esp,31-3.5-3.5-2]) railMovelTV();
translate([0,135-94-2.5-esp-1.5,31-3.5-3.5-2]) railMovelTV();
}
// translate([0,esp-1,esp]) cuboid(50,2,31-7-esp-esp-1,sharp);
// translate([0,135-94-2.5-esp-1,esp]) cuboid(50,2,31-7-esp-esp-1,sharp);
// translate([0,esp,esp]) cuboid(50,135-94-2.5-esp-esp,1.5,sharp);
//// translate([0,esp,31-3.5-3.5-esp-1.5]) cuboid(50,135-94-2.5-esp-esp,1.5,sharp);
// translate([0,esp,esp]) cuboid(3,135-94-2.5-esp-esp,31-7-esp-esp-1,sharp);
// translate([50-1,0,0]) cuboid(2.5,135-94-2.5,31-7,sharp);
// hull() {
// translate([50-1,0,0]) cuboid(1.5,135-94-2.5,31-7,sharp);
// translate([50,4,4]) rotate([0,90,0]) cylinder(1.5,2,1.5);
// translate([50,135-94-2.5-4,4]) rotate([0,90,0]) cylinder(1.5,2,1.5);
// translate([50,4,31-3.5-3.5-4]) rotate([0,90,0]) cylinder(1.5,2,1.5);
// translate([50,135-94-2.5-4,31-3.5-3.5-4]) rotate([0,90,0]) cylinder(1.5,2,1.5);
// }
}
translate([0,0,17-2]) cuboid(60,94,2,soft); //meio horiz
translate([0,0,0]) cuboid(2,135,31,soft); //tras
}
}
module peMovelTV() {
radius = 2;
height = 7.5;
translate([radius,radius,- height]) cylinder(height+2,radius,radius); //tras gaveta
}
module railMovelTV() {
cube([55,5,3]);
}
module movelCD() {
scale(s)
union(){
cuboid(34.5,34,1,soft); //base
translate([0,0,34-1]) cuboid(34.5,34,1,soft); //topo
cuboid(34.5,1,34,soft); //esq
translate([0,34-1,0]) cuboid(34.5,1,34,soft); //direita
cuboid(1,34,34,soft); //tras
alturaGaveta = 7;
paredeCaixa = 1;
espLado = (34 - paredeCaixa*2 - 29)/2;
espBaixo = 1;
espFundo = 1;
translate([paredeCaixa,0,paredeCaixa-1]) {
railMovelCD();
translate([0,34 - paredeCaixa - 2,0]) railMovelCD();
translate([0,0,alturaGaveta + 7.5]) railMovelCD();
translate([0,34 - paredeCaixa - 2,alturaGaveta + 7.5]) railMovelCD();
}
translate([paredeCaixa + espFundo,paredeCaixa + espLado,paredeCaixa + espBaixo]) {
gavetaMovelCD();
translate([0,0,alturaGaveta + 7.5]) gavetaMovelCD();
}
}
}
module railMovelCD() {
cube([25,3,2]);
}
module gavetaMovelCD() {
espParede = 1;
translate([0,0,0]) cuboid(1.5,29,7,sharp); //tras gaveta
translate([0,0,0]) cuboid(30,1.5,7,sharp); //esq gaveta
translate([0,29 - espParede-0.5,0]) cuboid(30,1.5,7,sharp); //dir gaveta
translate([30 - espParede-0.5,0,0]) cuboid(1.5,29,7,sharp); //frente gaveta
translate([0,0,0]) cuboid(30,29,2,sharp); //chão gaveta
}
module sofa(depth,length,height,numCushions,depthBack,heightBack,depthBackCushion,heightBottom,heightBottomCushion,lengthArm,heightArm,depthFeet,lengthFeet,heightFeet){
scale(s)
union(){
armRadius = 9;
//feet
translate([6,5,-heightFeet + 0.1]) cuboid(depthFeet,lengthFeet,heightFeet + 1,soft);
translate([depth - depthFeet - 6,5,-heightFeet]) cuboid(depthFeet,lengthFeet,heightFeet + 1,soft);
translate([6,length - depthFeet - 5,-heightFeet]) cuboid(depthFeet,lengthFeet,heightFeet + 1,soft);
translate([depth - depthFeet - 6,length - lengthFeet - 5,-heightFeet]) cuboid(depthFeet,lengthFeet,heightFeet + 1,soft);
// back of sofa
translate([0,0,0]) cuboid(depthBack,length,heightBack,soft*5);
// left arm of sofa
cuboid(depth,lengthArm,heightArm - armRadius/1.5,soft*5);
translate([0,armRadius/2 - 0.5,heightArm - armRadius]) rotate([0,90,0]) cylinder(depth, armRadius, armRadius);
// right arm of sofa
translate([0,length - lengthArm,0]) cuboid(depth,lengthArm,heightArm - armRadius/1.5,soft*5);
translate([0,length - armRadius/2 + 0.5,heightArm - armRadius]) rotate([0,90,0]) cylinder(depth, armRadius, armRadius);
// botttom of sofa
cuboid(depth,length,heightBottom,soft*10);
// cushions bottom
for (a =[0:numCushions-1]) {
translate([depthBack + 1,lengthArm + ((length - lengthArm*2 - 0.5*(numCushions - 1))/numCushions)*a + 0.5*a,heightBottom + 1]) cuboid(depth-depthBack,((length - lengthArm *2 - 0.5*(numCushions - 1))/numCushions),heightBottomCushion,soft*10);
}
echo((length - (lengthArm + 1)*2 - 0.5*(numCushions - 1))/numCushions);
// cushions back
for (a =[0:numCushions-1]) {
if (numCushions==1) {
translate([depthBack + 1,0,heightBottom+heightBottomCushion]) cuboid(depthBackCushion,((length - (lengthArm + 1)*2 - 0.5*(numCushions - 1))/numCushions) + (lengthArm + 1)*2,height - (heightBottom + heightBottomCushion),soft*10);
}
else if(a==0) {
translate([depthBack + 1,0,heightBottom+heightBottomCushion]) cuboid(depthBackCushion,((length - (lengthArm + 1)*2 - 0.5*(numCushions - 1))/numCushions) + (lengthArm + 1),height - (heightBottom + heightBottomCushion),soft*10);
}
else if(a==(numCushions-1)){
translate([depthBack + 1,(lengthArm+1) + ((length - (lengthArm + 1)*2 - 0.5*(numCushions - 1))/numCushions)*a + 0.5*a,heightBottom+heightBottomCushion]) cuboid(depthBackCushion,((length - (lengthArm + 1)*2 - 0.5*(numCushions - 1))/numCushions) + (lengthArm + 1),height - (heightBottom + heightBottomCushion),soft*10);
}
else {
translate([depthBack + 1,(lengthArm+1) + ((length - (lengthArm + 1)*2 - 0.5*(numCushions - 1))/numCushions)*a + 0.5*a,heightBottom+heightBottomCushion]) cuboid(depthBackCushion,((length - (lengthArm + 1)*2 - 0.5*(numCushions - 1))/numCushions),height - (heightBottom + heightBottomCushion),soft*10);
}
}
}
// translate([depthBack + 1,0,35]) cuboid(18,64.5,44,soft*10);
// translate([depthBack + 1,lengthArm + lenghtCushion + 0.5,heightBottom + heightBottomCushion]) cuboid(depthBackCushion,lenghtCushion,height - (heightBottom + heightBottomCushion),soft*10);
// translate([depthBack + 1,lengthArm + lenghtCushion*2 + 0.5*2,heightBottom + heightBottomCushion]) cuboid(depthBackCushion,lenghtCushion + lengthArm + 1,height - (heightBottom + heightBottomCushion),soft*10);
}
module cuboid(depth,length,height,r) {
hull(){
translate([r,r,r]) sphere(r);
translate([depth-r,r,r]) sphere(r);
translate([depth-r,length-r,r]) sphere(r);
translate([r,length-r,r]) sphere(r);
translate([r,length-r,height-r]) sphere(r);
translate([depth-r,length-r,height-r]) sphere(r);
translate([depth-r,r,height-r]) sphere(r);
translate([r,r,height-r]) sphere(r);
}
}