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 Middle(){ ////toplevel
206 linextr(0, usb_wall_h)
207 MiddleSmallWallsPlan();
208 linextr(usb_wall_h - usb_ceil_th, usb_wall_h)
210 linextr(-board_th, usb_wall_h)
211 MiddleMainWallsPlan();
213 linextr(cover_wall_bot_z, middle_top_z)
214 rectfromto([ -(board_w/2 + 0.1), total_y_min ],
215 [ -total_side_wall_x, main_y_min - fit_gap_y ]);
216 MidBotRegistrations();
219 for (y_c = [strain_0_y_c, strain_1_y_c]) {
220 for (x_c = [-1,+1] * strain_pitch_across/2) {
221 translate([x_c, y_c, 0])
223 square([ strain_t, strain_w ], center=true);
226 linextr_y_xz(total_y_min-1, main_y_min)
227 translate([0, middle_base_z])
228 scale([1, strain_groove_d/strain_groove_w])
229 circle(strain_groove_w/2, $fn = 8);
230 NormalStrapCutouts(midbot_strap_c_y,
234 module MiddlePrint(){ ////toplevel
235 rotate([180,0,0]) Middle();
238 module MiddleElevationForCutout(){
239 rectfromto([ -(middle_side_wall_x + side_x_gap),
240 middle_base_z - fit_gap_z ],
241 [ +(middle_side_wall_x + side_x_gap), middle_top_z ]);
243 module BottomMainElevation(){
245 rectfromto([ -total_side_wall_x, bottom_base_z ],
246 [ +total_side_wall_x, bottom_wall_top_z ]);
248 MiddleElevationForCutout();
251 module Bottom(){ ////toplevel
254 linextr_y_xz(total_y_min, front_y_max)
255 BottomMainElevation();
258 linextr_y_xz(midbot_registration_y_around_max,
259 front_y_max - wall_th)
260 rectfromto([ -board_w/2, bottom_base_z + bottom_floor_th ],
263 linextr_y_xz(total_y_min + wall_th,
264 front_y_max - wall_th)
265 rectfromto([ -midbot_registration_bottom_x,
266 bottom_base_z + bottom_floor_th ],
267 [ +midbot_registration_bottom_x, 20 ]);
269 linextr_y_xz(total_y_min - 1,
270 total_y_min + wall_th + 1){
271 translate([ 0, middle_base_z ]){
273 translate([ 0, -cable_dia/2 ])
274 circle(r = cable_dia/2, $fa = 10, $fs = 1);
275 square([ cable_dia, 0.1 ], center=true);
279 RegistrationsMinkowski()
280 CoverRegistrations();
281 RegistrationsMinkowski()
282 MidBotRegistrations();
283 BottomStrapCutouts(-cover_strap_c_d_y);
284 BottomStrapCutouts(midbot_strap_c_y);
288 module CoverMainElevation(){
290 rectfromto([ -total_side_wall_x, cover_wall_bot_z ],
291 [ +total_side_wall_x, cover_top_z ]);
293 MiddleElevationForCutout();
296 module Cover(){ ////toplevel
299 linextr_y_xz(main_y_min, front_y_max)
300 CoverMainElevation();
301 CoverRegistrations();
306 module CoverPrint(){ ////toplevel
307 rotate([180,0,0]) Cover();
310 module BottomDemo(){ ////toplevel
311 translate([0, 0, -0.25]) Bottom();
313 translate([0, 0, +0.25]) Cover();