-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbathroom_holder.scad
More file actions
97 lines (83 loc) · 1.81 KB
/
Copy pathbathroom_holder.scad
File metadata and controls
97 lines (83 loc) · 1.81 KB
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
z = 90;
//bathroom holder
boxes = [
[21], // marker
[32.5], // flonaise
[10, 36], // comb
[55, 30], // toothpaste
[25], // toothbrush
[25], // toothbrush
];
boxes = [
[194, 26]
];
z = 140;
edge = 10;
//mice
boxes = [
[93, 17], // keyboard thing
[62, 40], // mouse
[40, 20], // fire TV
];
z = 60;
//remotes
boxes = [
[61, 25], // denon
[57, 30], // projector
];
z = 80;
// whal peanut electric razor
boxes = [
[7], // brush
[21], // oil
[38, 24], // s4
[38, 20], // s3
[38, 16], // s2
[38, 12], // s1
];
z = 32;
function my_sum(i, total=0) =
i==0 ?
total + boxes[0][0] :
my_sum(i - 1, total + boxes[i][0]);
module all_shapes(move=0, grow=0) {
for (n = [0:len(boxes)-1]) {
if (boxes[n][1] == undef) {
translate([my_sum(n)-boxes[n][0]/2+n*move+move,boxes[n][0]/2,0])
cylinder(d=boxes[n][0]+grow*2, h=z);
} else {
translate([my_sum(n)-boxes[n][0]-grow+n*move+move,-grow,0])
cube([boxes[n][0]+grow*2, boxes[n][1]+grow*2, boxes[n][2] != undef ? boxes[n][2] : z]);
}
}
}
// rostock
wall=1.2;
// i3
wall=0.35;
screw=3;
head=10;
screw_offset=z/5;
module assembled() {
difference() {
hull()
all_shapes(wall*2, wall*2);
translate([0,0,wall])
all_shapes(wall*2, 0);
for (n = [screw_offset, z-screw_offset]) {
translate([(my_sum(len(boxes)-1)+wall*2*len(boxes)+wall)/2,0,n])
rotate([-90,0,0]) {
cylinder(d=head,h=100);
translate([0,0,-wall*2])
cylinder(d=screw,h=100);
}
}
}
}
module fine() {
$fn=200;
assembled();
}
display="";
if (display == "") assembled();
if (display == "bathroom_holder.stl") fine();