-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhalf-open-box.scad
46 lines (39 loc) · 1.12 KB
/
half-open-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
/*
Step 1
- basic parameters
- $fn - 200 fragments results in a smooth shape
- minkowski is creating a rounded shape, don't forget to exclude the double radius
*/
$fn=200;
// Length
length = 50;
width= 50;
height = 50;
thickness = 1;
cutout_width = 40;
cutout_height = 40;
cornerRadius = 2;
translate([-width/2, -length/2, 0]){
difference() {
roundedBox(length, width, height, cornerRadius);
translate([thickness,thickness,thickness]) {
roundedBox(length - (thickness * 2), width - (thickness * 2), height - thickness, cornerRadius);
}
translate([width/2, length/2, 0]) {
rotate(a=[90,0,0]) {
translate([(-cutout_width / 2), (height - cutout_height) + cornerRadius , length / 2]) {
roundedBox(cutout_height + cornerRadius, cutout_width, thickness * 2, cornerRadius);
}
}
}
}
}
module roundedBox(length, width, height, radius)
{
dRadius = 2*radius;
//base rounded shape
minkowski() {
cube(size=[width-dRadius,length-dRadius, height]);
cylinder(r=radius, h=0.01);
}
}