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;
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;
108 module NormalStrapCutouts(y_c, z, rot){
110 translate([ -total_side_wall_x, y_c, z ])
118 module BottomStrapCutouts(y_c){
119 NormalStrapCutouts(y_c, bottom_base_z, -45);
121 // XXXX check strap width
122 // XXXX check cable diameter
123 // XXXX need rear strap
124 module CoverStrapCutouts(){
126 translate([ -total_side_wall_x, -cover_strap_c_d_y, cover_top_z ])
127 cube([ cover_strap_sz_x*2,
129 cover_strap_cutout_z*2 ],
134 module FrontWallsPlan(slop) {
136 rectfromto([ -board_w/2 - wall_th, 0 ],
137 [ -usb_w/2 - slop, front_wall_th ]);
140 module MiddleSmallWallsPlan() {
143 rectfromto([ -usb_w/2, -0.01 ],
144 [ -usb_w/2 + usb_wall_w, usb_tongue_d ]);
148 for (w=small_walls) {
149 rectfromto(w[0], w[1]);
152 module MiddleCeilPlan() {
155 rectfromto([ -usb_w/2, -0.01 ],
156 [ 0.1, usb_tongue_d ]);
157 rectfromto([ -board_w/2 - wall_th, 0 ],
158 [ 0.1, ceil_y_min ]);
160 rectfromto(chip_cutout[0], chip_cutout[1]);
163 module MiddleMainWallsPlan() {
165 rectfromto([ -board_w/2 - wall_th, 0 ],
166 [ -board_w/2, wall_y_min ]);
168 FrontWallsPlan(usb_tongue_w_slop);
169 rectfromto([ -board_w/2 - wall_th + 0, - board_l ],
170 [ +board_w/2 + wall_th, total_y_min ]);
173 module RegistrationsMinkowski(){
175 cube([ 1, fit_gap_y*2, fit_gap_z*2 ], center=true);
179 module CoverRegistrations(){
180 linextr_y_xz(cover_registration_c_dy - strap_w/2,
181 cover_registration_c_dy + strap_w/2) {
183 rectfromto([ -total_side_wall_x,
184 cover_wall_bot_z - cover_registration_sz_z ],
185 [ +total_side_wall_x, cover_top_z ]);
187 MiddleElevationForCutout();
188 translate([0, -20]) MiddleElevationForCutout();
193 module MidBotRegistrations(){
194 linextr_y_xz(midbot_registration_y_min,
195 midbot_registration_y_max) {
197 rectfromto([ midbot_registration_bottom_x, middle_base_z + 0.1 ],
198 [ middle_side_wall_x, middle_base_z
199 - midbot_registration_sz_z ]);
204 module Middle(){ ////toplevel
207 linextr(0, usb_wall_h)
208 MiddleSmallWallsPlan();
209 linextr(usb_wall_h - usb_ceil_th, usb_wall_h)
211 linextr(-board_th, usb_wall_h)
212 MiddleMainWallsPlan();
214 linextr(cover_wall_bot_z, middle_top_z)
215 rectfromto([ -(board_w/2 + 0.1), total_y_min ],
216 [ -total_side_wall_x, main_y_min - fit_gap_y ]);
217 MidBotRegistrations();
220 for (y_c = [strain_0_y_c, strain_1_y_c]) {
221 for (x_c = [-1,+1] * strain_pitch_across/2) {
222 translate([x_c, y_c, 0])
224 square([ strain_t, strain_w ], center=true);
227 linextr_y_xz(total_y_min-1, main_y_min)
228 translate([0, middle_base_z])
229 scale([1, strain_groove_d/strain_groove_w])
230 circle(strain_groove_w/2, $fn = 8);
233 module MiddlePrint(){ ////toplevel
234 rotate([180,0,0]) Middle();
237 module MiddleElevationForCutout(){
238 rectfromto([ -(middle_side_wall_x + side_x_gap),
239 middle_base_z - fit_gap_z ],
240 [ +(middle_side_wall_x + side_x_gap), middle_top_z ]);
242 module BottomMainElevation(){
244 rectfromto([ -total_side_wall_x, bottom_base_z ],
245 [ +total_side_wall_x, bottom_wall_top_z ]);
247 MiddleElevationForCutout();
250 module Bottom(){ ////toplevel
253 linextr_y_xz(total_y_min, front_y_max)
254 BottomMainElevation();
257 linextr_y_xz(midbot_registration_y_around_max,
258 front_y_max - wall_th)
259 rectfromto([ -board_w/2, bottom_base_z + bottom_floor_th ],
262 linextr_y_xz(total_y_min + wall_th,
263 front_y_max - wall_th)
264 rectfromto([ -midbot_registration_bottom_x,
265 bottom_base_z + bottom_floor_th ],
266 [ +midbot_registration_bottom_x, 20 ]);
268 linextr_y_xz(total_y_min - 1,
269 total_y_min + wall_th + 1){
270 translate([ 0, middle_base_z ]){
272 translate([ 0, -cable_dia/2 ])
273 circle(r = cable_dia/2, $fa = 10, $fs = 1);
274 square([ cable_dia, 0.1 ], center=true);
278 RegistrationsMinkowski()
279 CoverRegistrations();
280 RegistrationsMinkowski()
281 MidBotRegistrations();
282 BottomStrapCutouts(-cover_strap_c_d_y);
286 module CoverMainElevation(){
288 rectfromto([ -total_side_wall_x, cover_wall_bot_z ],
289 [ +total_side_wall_x, cover_top_z ]);
291 MiddleElevationForCutout();
294 module Cover(){ ////toplevel
297 linextr_y_xz(main_y_min, front_y_max)
298 CoverMainElevation();
299 CoverRegistrations();
304 module CoverPrint(){ ////toplevel
305 rotate([180,0,0]) Cover();
308 module BottomDemo(){ ////toplevel
309 translate([0, 0, -0.25]) Bottom();
311 translate([0, 0, +0.25]) Cover();