-
Notifications
You must be signed in to change notification settings - Fork 0
/
box.scad
50 lines (44 loc) · 832 Bytes
/
box.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
x = 112;
y = 112;
z = 25;
t = 1;
d = 5;
e = d*sqrt(3)/2;
box();
triangleWallSquare();
translate([0,(e+t)/2,0])
gap();
module box() {
difference(){
cube([x,y,z], true);
translate([0,0,t/2])
cube([x-t,y-t,z], true);
}
}
module gap(){
translate([0,0,t/4])
cube([x-t*2-(d/2+d/4)*2,e,z-t/2],true);
for (i = [1,-1]) {
translate([((x-d)/2-t)*-i,0,0])
rotate(90+90*i)
triangle();
}
}
module triangle() {
translate([0,0,t/4])
cylinder(d=d,h=z-t/2,$fn=3,center=true);
}
module triangleWall(){
for (i = [0:y/2/(e+t)-1]) {
for (j = [1,-1]) {
translate([x/-2+t/2+d/4,(e+t)*i*j,0])
triangle();
}
}
}
module triangleWallSquare(){
for (i = [0:4]) {
rotate(90*i)
triangleWall();
}
}