3 // Print (fine detail settings):
13 usb_tongue_d = 8.97 - 0.2;
14 usb_tongue_w_slop = +0.5;
15 usb_wall_h = 4.54 - 2.04;
18 wall_th = 1.5; // XXXX rename wall_th
20 board_l = 17.56 + 0.2;
21 board_w = 19.14 + 0.2;
22 board_th = 1.92 + 0.1;
24 sw_to_edge = board_w/2 + 0.1;
29 wall_y_min = -board_l - wall_th;
30 ceil_y_min = wall_y_min - 5;;
33 [ [0, 0], [-sw_to_edge, -1.0] ],
34 [ [sw_to_edge-4.5, -4.5], [sw_to_edge, -5.7] ],
35 // [ [3.0, -11.72], [sw_to_edge, -13.38] ],
36 [ [-sw_to_edge+3.85, -14.90], [sw_to_edge, -13.38] ],
38 chip_cutout = [[ -sw_to_edge + 4.20, -3.75 ],
39 [ -sw_to_edge + 11.95, -11.90 ]];
43 strain_pitch_across = 5;
44 strain_pitch_along = 10;
46 strain_groove_w = 4.5;
48 cover_strap_c_d_y = 5.5; // from front of board
49 cover_registration_sz_y = 2;
50 cover_registration_sz_z = 3;
51 midbot_registraton_sz_x = 3;
55 bottom_floor_th = 1.5;
63 cover_strap_sz_x = wall_th * 3.5;
68 cover_strap_cutout_z = wall_th;
70 middle_top_z = usb_wall_h;
71 middle_base_z = -board_th;
72 bottom_base_z = middle_base_z - cable_space_z - bottom_floor_th;;
74 front_y_max = front_wall_th;
75 main_y_min = -board_l - wall_th;
77 strain_0_y_c = main_y_min - strain_w/2;
78 strain_1_y_c = strain_0_y_c - strain_pitch_along;
79 total_y_min = strain_1_y_c - strain_w/2 - wall_th;
81 bottom_wall_top_z = (middle_top_z + middle_base_z) * 0.5 - fit_gap_z/2;
82 cover_wall_bot_z = (middle_top_z + middle_base_z) * 0.5 + fit_gap_z/2;
83 cover_top_z = middle_top_z + cover_ceil_th;
85 middle_side_wall_x = +board_w/2 + wall_th;
86 total_side_wall_x = middle_side_wall_x + wall_th + side_x_gap;
88 cover_registration_c_dy = -cover_strap_c_d_y - strap_w/2
89 - wall_th - cover_registration_sz_y/2;
91 midbot_registration_sz_y = cover_registration_sz_y;
92 midbot_registration_sz_z = cover_registration_sz_z;
93 midbot_registration_y_min = total_y_min + wall_th*2;
94 midbot_registration_y_max = midbot_registration_y_min
95 + midbot_registration_sz_y;
96 midbot_registration_y_around_max = midbot_registration_y_max
98 midbot_registration_bottom_x = board_w/2 - midbot_registraton_sz_x;
100 midbot_strap_c_y = 0.5 * (strain_0_y_c + strain_1_y_c);
110 module NormalStrapCutouts(y_c, z, rot){
112 translate([ -total_side_wall_x, y_c, z ])
120 module BottomStrapCutouts(y_c){
121 NormalStrapCutouts(y_c, bottom_base_z, -45);
123 module CoverStrapCutouts(){
125 translate([ -total_side_wall_x, -cover_strap_c_d_y, cover_top_z ])
126 cube([ cover_strap_sz_x*2,
128 cover_strap_cutout_z*2 ],
133 module FrontWallsPlan(slop) {
135 rectfromto([ -board_w/2 - wall_th, 0 ],
136 [ -usb_w/2 - slop, front_wall_th ]);
139 module MiddleSmallWallsPlan() {
142 rectfromto([ -usb_w/2, -0.01 ],
143 [ -usb_w/2 + usb_wall_w, usb_tongue_d ]);
147 for (w=small_walls) {
148 rectfromto(w[0], w[1]);
151 module MiddleCeilPlan() {
154 rectfromto([ -usb_w/2, -0.01 ],
155 [ 0.1, usb_tongue_d ]);
156 rectfromto([ -board_w/2 - wall_th, 0 ],
157 [ 0.1, ceil_y_min ]);
159 rectfromto(chip_cutout[0], chip_cutout[1]);
162 module MiddleMainWallsPlan() {
164 rectfromto([ -board_w/2 - wall_th, 0 ],
165 [ -board_w/2, wall_y_min ]);
167 FrontWallsPlan(usb_tongue_w_slop);
168 rectfromto([ -board_w/2 - wall_th + 0, - board_l ],
169 [ +board_w/2 + wall_th, total_y_min ]);
172 module RegistrationsMinkowski(){
174 cube([ 1, fit_gap_y*2, fit_gap_z*2 ], center=true);
178 module CoverRegistrations(){
179 linextr_y_xz(cover_registration_c_dy - strap_w/2,
180 cover_registration_c_dy + strap_w/2) {
182 rectfromto([ -total_side_wall_x,
183 cover_wall_bot_z - cover_registration_sz_z ],
184 [ +total_side_wall_x, cover_top_z ]);
186 MiddleElevationForCutout();
187 translate([0, -20]) MiddleElevationForCutout();
192 module MidBotRegistrations(){
193 linextr_y_xz(midbot_registration_y_min,
194 midbot_registration_y_max) {
196 rectfromto([ midbot_registration_bottom_x, middle_base_z + 0.1 ],
197 [ middle_side_wall_x, middle_base_z
198 - midbot_registration_sz_z ]);
203 module MiddleStrainHoles(){
205 for (y_c = [strain_0_y_c, strain_1_y_c]) {
206 translate([strain_pitch_across/2, y_c, 0])
207 square([ strain_t, strain_w ], center=true);
211 module Middle(){ ////toplevel
214 linextr(0, usb_wall_h)
215 MiddleSmallWallsPlan();
216 linextr(usb_wall_h - usb_ceil_th, usb_wall_h)
218 linextr(-board_th, usb_wall_h)
219 MiddleMainWallsPlan();
221 linextr(cover_wall_bot_z, middle_top_z)
222 rectfromto([ -(board_w/2 + 0.1), total_y_min ],
223 [ -total_side_wall_x, main_y_min - fit_gap_y ]);
224 MidBotRegistrations();
229 linextr_y_xz(total_y_min-1, main_y_min)
230 translate([0, middle_base_z])
231 scale([1, strain_groove_d/strain_groove_w])
232 circle(strain_groove_w/2, $fn = 8);
233 NormalStrapCutouts(midbot_strap_c_y,
237 module MiddlePrint(){ ////toplevel
238 rotate([180,0,0]) Middle();
241 module MiddleElevationForCutout(){
242 rectfromto([ -(middle_side_wall_x + side_x_gap),
243 middle_base_z - fit_gap_z ],
244 [ +(middle_side_wall_x + side_x_gap), middle_top_z ]);
246 module BottomMainElevation(){
248 rectfromto([ -total_side_wall_x, bottom_base_z ],
249 [ +total_side_wall_x, bottom_wall_top_z ]);
251 MiddleElevationForCutout();
254 module Bottom(){ ////toplevel
257 linextr_y_xz(total_y_min, front_y_max)
258 BottomMainElevation();
261 linextr_y_xz(midbot_registration_y_around_max,
262 front_y_max - wall_th)
263 rectfromto([ -board_w/2, bottom_base_z + bottom_floor_th ],
266 linextr_y_xz(total_y_min + wall_th,
267 front_y_max - wall_th)
268 rectfromto([ -midbot_registration_bottom_x,
269 bottom_base_z + bottom_floor_th ],
270 [ +midbot_registration_bottom_x, 20 ]);
272 linextr_y_xz(total_y_min - 1,
273 total_y_min + wall_th + 1){
274 translate([ 0, middle_base_z ]){
276 translate([ 0, -cable_dia/2 ])
277 circle(r = cable_dia/2, $fa = 10, $fs = 1);
278 square([ cable_dia, 0.1 ], center=true);
282 RegistrationsMinkowski()
283 CoverRegistrations();
284 RegistrationsMinkowski()
285 MidBotRegistrations();
286 BottomStrapCutouts(-cover_strap_c_d_y);
287 BottomStrapCutouts(midbot_strap_c_y);
291 module CoverMainElevation(){
293 rectfromto([ -total_side_wall_x, cover_wall_bot_z ],
294 [ +total_side_wall_x, cover_top_z ]);
296 MiddleElevationForCutout();
299 module Cover(){ ////toplevel
302 linextr_y_xz(main_y_min, front_y_max)
303 CoverMainElevation();
304 CoverRegistrations();
309 module CoverPrint(){ ////toplevel
310 rotate([180,0,0]) Cover();
313 module BottomDemo(){ ////toplevel
314 translate([0, 0, -0.25]) Bottom();
316 translate([0, 0, +0.25]) Cover();
318 module ImpressionDemo(){ ////toplevel
319 color("black") translate([0, 0, -0.25]) Bottom();
321 %translate([0, 0, +0.25]) Cover();