From: Scott Worley Date: Sat, 7 Oct 2023 09:08:54 +0000 (-0700) Subject: housing: Basic shape X-Git-Tag: v0.1.0~68 X-Git-Url: http://git.scottworley.com/tattlekey/commitdiff_plain/859fd2d98f0e858d7f769d1edf2441349526e34c?ds=sidebyside housing: Basic shape Not solved yet: Cord grip/anchor --- diff --git a/housing/tattlekey.scad b/housing/tattlekey.scad index f117e27..c6b0e73 100644 --- a/housing/tattlekey.scad +++ b/housing/tattlekey.scad @@ -1,21 +1,23 @@ use -key_interface_size = 19; +key_interface_size = 18; key_interface_corner_r = 5; +key_interface_thickness = 1.484; -housing_inner_h = 10; // Chosen to let board fit inside +housing_inner_h = 8; // Chosen to let board fit inside housing_inner_w = 21; thickness = 1.7; wiring_l = 12; +extra_flare = wiring_l; pico_board_l = 51.0; pico_board_w = 21.0; pico_total_h = 3.7; $fs = .1; -$fa = 6; +$fa = 3; slop = 128; epsilon = 1/64; @@ -25,7 +27,9 @@ module pico_hole(d, x, y) { cylinder(h=slop, d = d); } -module pico_w(hole_d = 2.1) { +module pico_w(hole_d = 2.1) { + // Dimensions from measuring and/or + // https://datasheets.raspberrypi.com/picow/pico-w-datasheet.pdf board_l = pico_board_l; board_w = pico_board_w; board_h = 1.0; @@ -80,12 +84,12 @@ module at_key() { children(); } -module key_interface_shape(thick = thickness) { +module key_interface_shape(thick = key_interface_thickness, outline = thickness) { inner = key_interface_size - 2*key_interface_corner_r; linear_extrude(thick) minkowski() { square([inner, inner], center=true); - circle(r=key_interface_corner_r); + circle(r=key_interface_corner_r + outline); } } @@ -94,37 +98,63 @@ module key_interface() { difference() { key_interface_shape(); - #translate([0, 0, 6 - epsilon]) - cherry_switch_void(); + translate([0, 0, 6 - epsilon]) + cherry_switch_void(tolerance=0.05); } } -module housing(length = pico_board_l) { +module housing_shape(outline = thickness) { inner_squish = housing_inner_h / housing_inner_w; - housing_outer_w = housing_inner_w + 2 * thickness; - housing_outer_h = housing_inner_h + 2 * thickness; - outer_squish = housing_outer_h / housing_outer_w; + housing_w = housing_inner_w + 2 * outline; + housing_h = housing_inner_h + 2 * outline; + squish = housing_h / housing_w; + + scale([1, squish]) + circle(d = housing_w); +} + +module housing(length = pico_board_l - extra_flare) { rotate([90, 0, 0]) rotate([0, 90, 0]) linear_extrude(length) difference() { - scale([1, outer_squish]) - circle(d = housing_outer_w); - scale([1, inner_squish]) - circle(d = housing_inner_w); + housing_shape(); + housing_shape(0); } } -/* -!union() {housing(); hull() { - at_key() key_interface_shape(epsilon); - translate([pico_board_l-wiring_l, 0, 0]) - housing(wiring_l); -}} -*/ +module flare_shape(outline, extra_len) { + hull() { + at_key() + key_interface_shape(epsilon + extra_len, outline); + translate([pico_board_l-extra_flare, 0, 0]) + + translate([-extra_len, 0, 0]) + rotate([90, 0, 0]) + rotate([0, 90, 0]) + linear_extrude(epsilon+extra_len) + housing_shape(outline); + } +} -translate([0, -pico_board_w/2, -1]) -pico_w(hole_d = 2); +module flare() { + difference() { + flare_shape(thickness, 0); + flare_shape(0, epsilon); + } +} + +module tattlekey_case() { + key_interface(); + + difference() { + union() { + housing(); + flare(); + } + translate([0, -pico_board_w/2, -1]) + pico_w(); + } +} -key_interface(); -housing(); +tattlekey_case();