eurobox.scad
2.74 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
include<vars.scad>
include<modules.scad>
include<cuts.scad>
include<screws.scad>
include<pipes.scad>
use<handles.scad>
module innerWall(x,y,z) {
difference() {
volume(x,y,z,strength);
volume(x,y,z,0);
}
}
module grateX(x,y,z) {
translate([0,innergrateXypos,0]) cube([x/2,strength,z]);
}
module grateY(x,y,z) {
translate([innergrateYxpos,0,0]) cube([strength,y/2,z]);
}
module grateXY(x,y,z) {
translate([0,0+strength/2,0]) {
rotate([0,0,-45])
cube([strength,y/2,z]);
}
}
module grateZ(x,y,z) {
translate([-(offset),-(offset),z])
cube([x,y,strength]);
}
module grates(x,y,z) {
translate([ -offset,
-offset,
base ]) {
union() {
grateX(x,y,z);
grateY(x,y,z);
grateXY(x,y,z);
}
}
}
module mirroredgrates(x,y,z) {
union() {
union() {
grates(x,y,z);
translate([-offset*2+x,0, 0]) mirror([1,0,0]) grates(x,y,z);
}
translate([0,-offset*2+y, 0]) mirror([0,1,0]) {
union() {
grates(x,y,z);
translate([-offset*2+x,0, 0]) mirror([1,0,0]) grates(x,y,z);
}
}
}
}
module eurobox(x,y,z,handle,handlecaps,pipes,drilled,screws,locked,exploded) {
if ( handlecaps ) color("#5fe") handles(x,y,z,exploded=exploded ? [0,-5,0]:[0,0,0]);
if ( screws ) screws(x,y,z, locked=locked, exploded=exploded ? 5:0);
if ( pipes ) pipes(z, exploded=exploded ? [-5,0,0]:[0,0,0]);
difference() {
color("#888") translate([offset, offset, roundborderInner+strength]) {
difference () {
union() {
intersection() {
union() {
innerWall(x,y,z);
mirroredgrates(x,y,z);
grateZ(x,y,base);
grateZ(x,y,z-(roundborderInner+strength*2));
grateZ(x,y,z-(20.6+roundborderInner+strength*3));
if (handle==true) {
handleShape(x,y,z,strength,bool=false);
translate([0,y-30,0])mirror([0,1,0]){
handleShape(x,y,z,strength,bool=false);
}
}
}
intersection() {
shapeZ(x,y,z);
translate([-offset,-offset,-(roundborderInner+strength)]) cube([x,y,z]);
}
}
}
union() {
volume(x,y,z,0);
if (handle==true) {
handleShape(x,y,z,0,bool=true);
translate([0,y-offset*2,0])mirror([0,1,0]){
handleShape(x,y,z,0,bool=true);
}
}
}
}
}
if ( drilled ) drills(x,y,z);
}
}
eurobox(300,400,220,true);
/* testprobes */
/* translate([0,18,0]) #cube([1.9,2,3]); */
/* translate([0,18,18]) #cube([1.5,2,3]); */
/* difference(){ */
/* eurobox(30,40,22,true); */
/* translate([-1,-1,-10]) cube([15,20,30]); */
/* } */