lid.scad
1.97 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
include<vars.scad>
include<modules.scad>
module lidbordertop(x,y,offset) {
translate([ roundborderInner+strength*2 + offset
, roundborderInner+strength*2 + offset
, 0.1
]) difference() {
minkowski() {
cube([ x-(roundborderInner+strength*2)*2 - offset*2
, y-(roundborderInner+strength*2)*2 - offset*2
, 0.1
]);
cylinder( r=roundborderInner+strength
, h=0.95 - 0.2
);
}
minkowski() {
translate([strength,strength,-0.5])
cube([ x-(roundborderInner+strength*3)*2 - offset*2
, y-(roundborderInner+strength*3)*2 - offset*2
, 0.1
]);
cylinder( r=roundborderInner
, h=2
);
}
}
}
module tubpositive(x,y,offset) {
difference(){
minkowski() {
translate([ offset
, offset
, roundborderInner-lidrecess
]) cube([ x-offset*2
, y-offset*2
, 1
]);
sphere(r=roundborderInner);
}
translate([0,0,0.1]) cube([ x
, y
, 2
]);
}
}
module tubnegative(x,y,offset) {
minkowski() {
translate([ offset+strength
, offset+strength
, -lidrecess+strength+roundborderInner/2
]) cube([ x-offset*2-strength*2
, y-offset*2-strength*2
, 1
]);
sphere(r=roundborderInner/2);
}
}
module euroboxlid(x,y) {
translate([0,0,lidrecess]){
difference() {
union() {
lidbordertop(x,y,1.4);
tubpositive(x,y,2.8);
intersection() {
cube([x,y,strength]);
translate([offset, offset, roundborderInner+strength])
shapeZ(x,y);
}
}
tubnegative(x,y,2.8);
}
}
}