-
Notifications
You must be signed in to change notification settings - Fork 0
/
case.scad
47 lines (40 loc) · 1.71 KB
/
case.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
// Case without floor.
$fn=100;
form_thickness=1.8;
lenght=207-2*form_thickness;
width=140-2*form_thickness;
height=78;
fillet=width/10;
top_increment=height/50;
//case(lenght-fillet,width-fillet,height, fillet,top_increment,form_thickness);
case(lenght,width,height, fillet,top_increment,form_thickness);
module corner_area(height, fillet, top_increment, thickness) { // Outside area
union() {
cylinder(height-fillet, r1=fillet+thickness, r2=fillet+thickness+top_increment);
sphere(fillet+thickness);
}
}
module case(lenght, width, height, fillet, top_increment, thickness) {
difference() {
hull(){
translate([(lenght-2*fillet)/2,(width-2*fillet)/2,fillet])
corner_area(height, fillet, top_increment, 0);
translate([(lenght-2*fillet)/2,-(width-2*fillet)/2,fillet])
corner_area(height, fillet, top_increment, 0);
translate([-(lenght-2*fillet)/2,-(width-2*fillet)/2,fillet])
corner_area(height, fillet, top_increment, 0);
translate([-(lenght-2*fillet)/2,(width-2*fillet)/2,fillet])
corner_area(height, fillet, top_increment, 0);
}
translate([0,0,0.01]) hull(){
translate([(lenght-2*fillet)/2,(width-2*fillet)/2,fillet])
corner_area(height, fillet, top_increment, -thickness);
translate([(lenght-2*fillet)/2,-(width-2*fillet)/2,fillet])
corner_area(height, fillet, top_increment, -thickness);
translate([-((lenght-2*fillet)/2),-(width-2*fillet)/2,fillet])
corner_area(height, fillet, top_increment, -thickness);
translate([-(lenght-2*fillet)/2,(width-2*fillet)/2,fillet])
corner_area(height, fillet, top_increment, -thickness);
}
}
}