3 // Print (fine detail settings):
11 //tongue_w = 11.92 + 0.4;
15 usb_tongue_d = 8.97 - 0.2;
16 usb_tongue_w_slop = +0.5;
17 usb_wall_h = 4.54 - 2.04;
20 side_wall_th = 1.5; // XXXX rename wall_th
22 board_l = 17.56 + 0.2;
23 board_w = 19.14 + 0.2;
24 board_th = 1.92 + 0.1;
26 sw_to_edge = board_w/2 + 0.1;
31 wall_y_min = -board_l - side_wall_th; // XXXX remove
32 ceil_y_min = wall_y_min - 5;;
35 [ [0, 0], [-sw_to_edge, -1.0] ],
36 [ [sw_to_edge-4.5, -4.5], [sw_to_edge, -5.7] ],
37 // [ [3.0, -11.72], [sw_to_edge, -13.38] ],
38 [ [-sw_to_edge+3.85, -14.90], [sw_to_edge, -13.38] ],
40 chip_cutout = [[ -sw_to_edge + 4.20, -3.75 ],
41 [ -sw_to_edge + 11.95, -11.90 ]];
45 strain_pitch_across = 5;
46 strain_pitch_along = 10;
50 cover_strap_c_d_y = 5.5; // from front of board
51 cover_registration_sz_y = 2;
52 cover_registration_sz_z = 3;
56 bottom_floor_th = 1.5;
64 cover_strap_sz_x = side_wall_th * 3.5;
69 cover_strap_cutout_z = side_wall_th;
71 middle_top_z = usb_wall_h;
72 middle_base_z = -board_th;
73 bottom_base_z = middle_base_z - cable_space_z - bottom_floor_th;;
75 front_y_max = front_wall_th;
76 main_y_min = -board_l - side_wall_th;
78 strain_0_y_c = main_y_min - strain_w/2;
79 strain_1_y_c = strain_0_y_c - strain_pitch_along;
80 total_y_min = strain_1_y_c - strain_w/2 - side_wall_th;
82 bottom_wall_top_z = (middle_top_z + middle_base_z) * 0.5 - fit_gap_z/2;
83 cover_wall_bot_z = (middle_top_z + middle_base_z) * 0.5 + fit_gap_z/2;
84 cover_top_z = middle_top_z + cover_ceil_th;
86 middle_side_wall_x = +board_w/2 + side_wall_th;
87 total_side_wall_x = middle_side_wall_x + side_wall_th + side_x_gap;
89 cover_registration_c_dy = -cover_strap_c_d_y - strap_w/2
90 - side_wall_th - cover_registration_sz_y/2;
100 module NormalStrapCutouts(y_c, z, rot){
102 translate([ -total_side_wall_x, y_c, z ])
110 module BottomStrapCutouts(y_c){
111 NormalStrapCutouts(y_c, bottom_base_z, -45);
113 // XXXX check strap width
114 // XXXX check cable diameter
115 // XXXX need rear strap
116 // XXXX need bottom-to-middle registration
117 module CoverStrapCutouts(){
119 translate([ -total_side_wall_x, -cover_strap_c_d_y, cover_top_z ])
120 cube([ cover_strap_sz_x*2,
122 cover_strap_cutout_z*2 ],
127 module FrontWallsPlan(slop) {
129 rectfromto([ -board_w/2 - side_wall_th, 0 ],
130 [ -usb_w/2 - slop, front_wall_th ]);
133 module MiddleSmallWallsPlan() {
136 rectfromto([ -usb_w/2, -0.01 ],
137 [ -usb_w/2 + usb_wall_w, usb_tongue_d ]);
141 for (w=small_walls) {
142 rectfromto(w[0], w[1]);
145 module MiddleCeilPlan() {
148 rectfromto([ -usb_w/2, -0.01 ],
149 [ 0.1, usb_tongue_d ]);
150 rectfromto([ -board_w/2 - side_wall_th, 0 ],
151 [ 0.1, ceil_y_min ]);
153 rectfromto(chip_cutout[0], chip_cutout[1]);
156 module MiddleMainWallsPlan() {
158 rectfromto([ -board_w/2 - side_wall_th, 0 ],
159 [ -board_w/2, wall_y_min ]);
161 FrontWallsPlan(usb_tongue_w_slop);
162 rectfromto([ -board_w/2 - side_wall_th + 0, - board_l ],
163 [ +board_w/2 + side_wall_th, total_y_min ]);
166 module CoverRegistrations(){
167 linextr_y_xz(cover_registration_c_dy - strap_w/2,
168 cover_registration_c_dy + strap_w/2) {
170 rectfromto([ -total_side_wall_x,
171 cover_wall_bot_z - cover_registration_sz_z ],
172 [ +total_side_wall_x, cover_top_z ]);
174 MiddleElevationForCutout();
175 translate([0, -20]) MiddleElevationForCutout();
181 module Middle(){ ////toplevel
184 linextr(0, usb_wall_h)
185 MiddleSmallWallsPlan();
186 linextr(usb_wall_h - usb_ceil_th, usb_wall_h)
188 linextr(-board_th, usb_wall_h)
189 MiddleMainWallsPlan();
191 linextr(cover_wall_bot_z, middle_top_z)
192 rectfromto([ -(board_w/2 + 0.1), total_y_min ],
193 [ -total_side_wall_x, main_y_min - fit_gap_y ]);
196 for (y_c = [strain_0_y_c, strain_1_y_c]) {
197 for (x_c = [-1,+1] * strain_pitch_across/2) {
198 translate([x_c, y_c, 0])
200 square([ strain_t, strain_w ], center=true);
203 linextr_y_xz(total_y_min-1, main_y_min)
204 translate([0, middle_base_z])
205 scale([1, strain_groove_d/strain_groove_w])
206 circle(strain_groove_w/2, $fn = 8);
209 module MiddlePrint(){ ////toplevel
210 rotate([180,0,0]) Middle();
213 module MiddleElevationForCutout(){
214 rectfromto([ -(middle_side_wall_x + side_x_gap), middle_base_z ],
215 [ +(middle_side_wall_x + side_x_gap), middle_top_z ]);
217 module BottomMainElevation(){
219 rectfromto([ -total_side_wall_x, bottom_base_z ],
220 [ +total_side_wall_x, bottom_wall_top_z ]);
222 MiddleElevationForCutout();
225 module Bottom(){ ////toplevel
228 linextr_y_xz(total_y_min, front_y_max)
229 BottomMainElevation();
232 linextr_y_xz(total_y_min + side_wall_th,
233 front_y_max - side_wall_th)
234 rectfromto([ -board_w/2, bottom_base_z + bottom_floor_th ],
237 linextr_y_xz(total_y_min - 1,
238 total_y_min + side_wall_th + 1){
239 translate([ 0, middle_base_z ]){
241 translate([ 0, -cable_dia/2 ])
242 circle(r = cable_dia/2, $fa = 10, $fs = 1);
243 square([ cable_dia, 0.1 ], center=true);
248 CoverRegistrations();
249 cube([ 1, fit_gap_y*2, fit_gap_z*2 ], center=true);
251 BottomStrapCutouts(-cover_strap_c_d_y);
255 module CoverMainElevation(){
257 rectfromto([ -total_side_wall_x, cover_wall_bot_z ],
258 [ +total_side_wall_x, cover_top_z ]);
260 MiddleElevationForCutout();
263 module Cover(){ ////toplevel
266 linextr_y_xz(main_y_min, front_y_max)
267 CoverMainElevation();
268 CoverRegistrations();
273 module CoverPrint(){ ////toplevel
274 rotate([180,0,0]) Cover();
277 module BottomDemo(){ ////toplevel
278 translate([0, 0, -0.25]) Bottom();
280 translate([0, 0, +0.25]) Cover();