-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEspressoShotTimer_OLED_Case.scad
165 lines (124 loc) · 2.95 KB
/
EspressoShotTimer_OLED_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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
wall_thickness = 2;
base_width = 30;
base_depth = 38;
case_height = 22;
gaggia_steel_thickness = 1.5;
hook_height = 8;
slit_count = 4;
slit_width = 2;
display_width = 19;
display_depth = 15;
// this should be equal to wall_thickness
// but this leads to artifacts in openSCAD display
// so we make it a bit thicker
display_height = 4;
display_window_offset_x=3.5;
display_window_offset_y=13;
/*
* Definition of body.
*/
module base()
{
cube([base_width,base_depth, case_height]);
}
module interior()
{
cube([base_width-4,base_depth-4,case_height]);
}
module base_block() {
difference() {
base();
translate([wall_thickness,wall_thickness,wall_thickness])
interior();
}
}
module bottom_slits() {
gap = ((base_width - (4 * wall_thickness) - (slit_count*slit_width))) / (slit_count -1);
echo(gap);
for (i = [0:slit_count - 1]){
echo(i*(gap+slit_width));
translate([(2*wall_thickness)+(i*(gap+slit_width)), (4 * wall_thickness), -1])
cube([2, base_depth - (8 * wall_thickness), wall_thickness + 2]);
}
}
module cable_inlet()
{
cube([11,4,3]);
}
module slitted_lower_part()
{
difference(){
base_block();
bottom_slits();
}
}
module hook()
{
translate([-gaggia_steel_thickness, base_depth - wall_thickness, 0])
{
cube([gaggia_steel_thickness, wall_thickness, case_height]);
}
translate([-gaggia_steel_thickness - wall_thickness, base_depth - 10, 0])
{
cube([wall_thickness, hook_height+wall_thickness, case_height]);
}
}
module complete_lower_part()
{
difference(){
slitted_lower_part();
translate([6,-1,0])
{
cable_inlet();
}
}
}
/*
* Lid definition starts here
*/
module lid_body()
{
cube([base_width,base_depth, wall_thickness]);
}
module top_slits() {
gap = ((base_width - (4 * wall_thickness) - (slitcount*slitwidth))) / slitcount;
for (i = [0:2]){
translate([(2*wall_thickness)+(i*(gap+slitwidth)), (4 * wall_thickness), -1])
cube([2, base_depth - (8 * wall_thickness), wall_thickness + 2]);
}
}
module display_window()
{
cube([display_width,display_depth,display_height]);
}
module snap_frame()
{
difference(){
cube([base_width - wall_thickness*2,base_depth - wall_thickness*2, wall_thickness]);
translate([wall_thickness, wall_thickness, -1]){
cube([base_width - wall_thickness*4,base_depth - wall_thickness*4, wall_thickness +2]);
}
}
}
module lid()
{
difference()
{
lid_body();
translate([display_window_offset_x+wall_thickness, display_window_offset_y+wall_thickness, -1])
{
display_window();
}
}
translate([wall_thickness, wall_thickness, wall_thickness])
{
snap_frame();
}
}
slits();
complete_lower_part();
translate([0, -base_depth - 10, 0])
{
lid();
}
hook();