Browse Source

case mod. now only a single bottom part. lcd and buttons are unprotected.

Thomas Buck 11 months ago
parent
commit
0a079562d6
1 changed files with 100 additions and 47 deletions
  1. 100
    47
      case/case.scad

+ 100
- 47
case/case.scad View File

@@ -19,11 +19,14 @@
19 19
  * See <http://www.gnu.org/licenses/>.
20 20
  */
21 21
 
22
+// prev [bottom,top,button,print,OPT_assembly]
23
+part = "OPT_assembly"; //[bottom,OPT_assembly]
24
+wall = 1.5;
25
+
22 26
 // https://www.waveshare.com/wiki/Pico-LCD-1.3
23 27
 lcd_w = 52.0;
24 28
 lcd_h = 26.5;
25
-
26
-lcd_d = 1.0; // todo
29
+lcd_d = 1.55;
27 30
 
28 31
 // https://www.printables.com/model/210898-raspberry-pi-pico-case
29 32
 use <pico_case.scad>
@@ -32,30 +35,43 @@ p_h = 51;
32 35
 p_t = 1.0;
33 36
 p_usb_h = 2.8;
34 37
 
35
-pico_header_h = 2.5; // todo
36
-lcd_header_h = 10.0; // todo
38
+usb_cut_w = 8.5;
39
+usb_cut_h = p_usb_h + 0.4;
37 40
 
38
-header_h = pico_header_h + lcd_header_h;
41
+pico_header_h = 2.6;
42
+lcd_header_h = 9.0;
43
+
44
+pico_slot_w = p_w + 1.2;
45
+pico_slot_h = p_h + 1.6;
39 46
 
40
-part="OPT_assembly"; //[bottom,top,button,print,OPT_assembly]
41
-wall=1.5;
42 47
 extra=4; //lip on the lid that presses top pcb down
43 48
 thread=3;
44 49
 air=0.5;
45 50
 bissl=1/100;
51
+joystick=6;
52
+$fa=1/1;
53
+$fs=1/2;
54
+
55
+add_len = 0.7 + 1; // + 2 * wall + thread;
46 56
 button = 4;
47 57
 button_hole = button + 1.0;
48 58
 button_stem = button - 0.4;
49 59
 button_cut_side = 0.6;
50
-joystick=6;
51
-height=16.8+air+extra;
52
-width=52.4+1.5+2*air;
53
-length=26.7+2*air;
54
-$fa=1/1;
55
-$fs=1/2;
56 60
 
57
-total_width = width+2*wall;
58
-total_len = length+4*wall+2*thread;
61
+header_h = pico_header_h + lcd_header_h;
62
+
63
+length = pico_slot_w; //26.7+2*air;
64
+width = pico_slot_h; //52.4+1.5+2*air;
65
+height = p_t + p_usb_h + header_h; //16.8+air+extra;
66
+
67
+total_width = width + 2 * wall;
68
+total_len = length + 2 * wall;
69
+
70
+pwr_w = 5.0;
71
+pwr_h = 10.0;
72
+pwr_gap = 0.3;
73
+pwr_wg = pwr_w + 2 * pwr_gap;
74
+pwr_hg = pwr_h + 3 * pwr_gap;
59 75
 
60 76
 module lcd() {
61 77
     color("blue")
@@ -73,39 +89,78 @@ module hw() {
73 89
 }
74 90
 
75 91
 module bottom() {
76
-  difference() {
77
-    cube([total_width, total_len, height + wall]);
78
-    translate([wall,2*wall+thread,wall])cube([width,length,height+bissl]);
79
-    for (tr=[[wall+thread/2,wall+thread/2,height/2+wall],
92
+    difference() {
93
+        translate([0, -add_len, 0])
94
+        cube([total_width, total_len + 2 * add_len, height + wall]);
95
+
96
+        translate([wall, wall, wall])
97
+        cube([width, length, height + 0.1]);
98
+
99
+        // screws
100
+        if (0)
101
+        #for (tr=[[wall+thread/2,wall+thread/2,height/2+wall],
80 102
              [wall+thread/2,length+3*wall+1.5*thread,height/2+wall],
81 103
              [width+wall-thread/2,wall+thread/2,height/2+wall],
82 104
              [width+wall-thread/2,length+3*wall+1.5*thread,height/2+wall]])
83
-      translate(tr) cylinder(h=height/2+bissl,d=thread);
84
-    translate([wall/2,2*wall+thread+length/2,3-bissl])cube([wall+bissl,8,6],center=true);
85
-    translate([0,2*wall+thread+length/2,wall+7])rotate([0,90,0])cylinder(d=button,h=2*wall+bissl,center=true);
86
-  }
105
+        translate(tr) cylinder(h=height/2+bissl,d=thread);
106
+
107
+        // usb cutout
108
+        translate([wall / 2, wall + length / 2, usb_cut_h / 2 + wall])
109
+        cube([wall + bissl, usb_cut_w, usb_cut_h], center = true);
110
+
111
+        // power button cutout
112
+        translate([-0.1, wall + length / 2 - pwr_wg / 2, wall + usb_cut_h - 0.1])
113
+        cube([wall + 0.2, pwr_wg, pwr_h + 0.1]);
114
+
115
+        // bootsel button
116
+        translate([14.475, 16.05, -0.1])
117
+        cylinder(d = 4.5, h = wall + 0.2);
118
+    }
119
+
120
+    // power button
121
+    translate([0, wall + length / 2 - pwr_w / 2, wall + usb_cut_h + (pwr_hg - pwr_h)])
122
+    cube([wall, pwr_w, pwr_h + 0.1]);
123
+
124
+    // pico screw posts
125
+    translate([total_width / 2, total_len / 2, wall])
126
+    for (x = [-p_h / 2 + 2, p_h / 2 - 2])
127
+    for (y = [-p_w / 2 + 4.8, p_w / 2 - 4.8])
128
+    translate([x, y, 0])
129
+    difference() {
130
+        cylinder(d = 4, h = p_usb_h);
131
+
132
+        translate([0, 0, -0.1])
133
+        cylinder(d = 2.2, h = p_usb_h + 0.2);
134
+    }
87 135
 }
88 136
 
89 137
 module top() {
90
-  difference() {
91
-    cube([total_width, total_len, wall]);
92
-    for (tr=[[wall+thread/2,wall+thread/2,-bissl],
138
+    difference() {
139
+        cube([total_width, total_len, wall]);
140
+        for (tr=[[wall+thread/2,wall+thread/2,-bissl],
93 141
              [wall+thread/2,length+3*wall+1.5*thread,-bissl],
94 142
              [width+wall-thread/2,wall+thread/2,-bissl],
95 143
              [width+wall-thread/2,length+3*wall+1.5*thread,-bissl]])
96
-      translate(tr) cylinder(h=wall+2*bissl,d=thread);
97
-    translate([wall+1.5,2*wall+thread,-bissl])
98
-      for (tr=[[47.7+air,5.5+0],
99
-               [47.7+air,5.5+5.7],
100
-               [47.7+air,5.5+2*5.7],
101
-               [47.7+air,5.5+3*5.7],
102
-               [6.7+0.5,13.8+air]])
103
-        translate(tr) cylinder(h=wall+2*bissl,d=button);
104
-    translate([wall+1.5+6.7+air,2*wall+thread+13.8+air,-bissl]) cylinder(h=wall+2*bissl,d=joystick);
105
-    translate([wall+13.5+1.5,2*wall+thread,-bissl])cube([31,27,wall+2*bissl]);
106
-  }
107
-  translate([wall+13.5+1.5-1.5,2*wall+thread,-extra])cube([1.5,27,extra]);
108
-  translate([wall+13.5+1.5+31,2*wall+thread,-extra])cube([1.5,27,extra]);
144
+        translate(tr)
145
+        cylinder(h=wall+2*bissl,d=thread);
146
+
147
+        translate([wall+1.5,2*wall+thread,-bissl])
148
+        for (i = [0 : 3])
149
+        translate([47.7 + air, 5.5 + i * 5.7])
150
+        cylinder(h=wall+2*bissl,d=button);
151
+
152
+        translate([wall+1.5+6.7+air,2*wall+thread+13.8+air,-bissl])
153
+        cylinder(h=wall+2*bissl,d=joystick);
154
+
155
+        translate([wall+13.5+1.5,2*wall+thread,-bissl])
156
+        cube([31,27,wall+2*bissl]);
157
+    }
158
+
159
+    translate([wall+13.5+1.5-1.5,2*wall+thread,-extra])
160
+    cube([1.5,27,extra]);
161
+
162
+    translate([wall+13.5+1.5+31,2*wall+thread,-extra])
163
+    cube([1.5,27,extra]);
109 164
 }
110 165
 
111 166
 module button() {
@@ -151,22 +206,20 @@ if (part == "bottom") {
151 206
         union() {
152 207
             bottom_assm();
153 208
 
209
+            if (0)
154 210
             translate([-total_width / 2, -total_len / 2, height + wall])
155 211
             top();
156 212
 
157
-            for (tr = [
158
-                [47.7+air,5.5+0],
159
-                [47.7+air,5.5+5.7],
160
-                [47.7+air,5.5+2*5.7],
161
-                [47.7+air,5.5+3*5.7]
162
-            ])
163
-            translate(tr)
213
+            if (0)
214
+            for (i = [0 : 3])
215
+            translate([47.7 + air, 5.5 + i * 5.7])
164 216
             translate([wall + 1.5, 2 * wall + thread, -1])
165 217
             translate([-total_width / 2, -total_len / 2, height + wall])
166 218
             button();
167 219
         }
168 220
 
221
+        if (1)
169 222
         translate([-total_width / 2 - 1, 0, -2])
170
-        cube([total_width + 2, total_len / 2 + 2, height + wall + 10]);
223
+        cube([total_width + 2, (total_len + 2 * add_len) / 2 + 2, height + wall + 10]);
171 224
     }
172 225
 }

Loading…
Cancel
Save