-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBox.scad
57 lines (43 loc) · 1.12 KB
/
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
51
52
53
54
55
56
57
$fn=200;
length = 86;
width= 46;
height = 19;
cornerRadius = 0;
translate([10, 10, 0]){
difference() {
roundedBox(length, width, height, cornerRadius);
translate([1,1,1]) {
roundedBox(length-2, width-2, height-1, cornerRadius);
}
}
}
translate([((width*2) + 20), 10, 0]){
mirror([1,0,0]) {
roundedBox(length, width, 1, cornerRadius);
difference() {
translate([1,1,0]) {
roundedBox(length-2,width-2,4,cornerRadius);
}
translate([2,2,0]) {
roundedBox(length-4,width-4,4,cornerRadius);
}
}
}
}
module roundedBox(length, width, height, radius)
{
dRadius = 2*radius;
//cube bottom right
translate([width-dRadius,-radius,0]) {
cube(size=[radius,radius,height+0.01]);
}
//cube top left
translate([-radius,length-dRadius,0]) {
cube(size=[radius,radius,height+0.01]);
}
//base rounded shape
minkowski() {
cube(size=[width-dRadius,length-dRadius, height]);
cylinder(r=radius, h=0.01);
}
}