From: Jan "Yenya" Kasprzak Date: Wed, 17 Jun 2015 14:22:03 +0000 (+0200) Subject: hc-sr04.scad: alternative cable outlet X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=openparking.git;a=commitdiff_plain;h=2fd5c5b5e2dcf1f53e142d9e6809db8cec1f737f hc-sr04.scad: alternative cable outlet --- diff --git a/things/hc-sr04.scad b/things/hc-sr04.scad index a9d1a1c..e01ca75 100644 --- a/things/hc-sr04.scad +++ b/things/hc-sr04.scad @@ -16,11 +16,11 @@ pcb_thick = 2.5; cyl_base = pcb_x/2 + wall - cyl_x; -conn_x = 10 + 0.5; -conn_y = 15; - -cable_w = 7; -cable_h = 4; +conn_x = 18 + 2*wall; +conn_z0 = 8; +conn_y = 5; +conn_x0 = conn_x - 1.5*conn_z0; +conn_len = 35; screw_head = 7.5; screw_d = 4; @@ -38,9 +38,13 @@ module sensor() { translate([-conn_x/2, pcb_y/2-eps, -eps]) cube([conn_x, conn_y+eps, pcb_h-pcb_thick+eps]); } - // cable protrusion - translate([-cable_w/2, pcb_y/2+conn_y-eps, -eps]) - cube([cable_w, 2*wall + eps, cable_h]); + // cable cover hole + hull() { + translate([-conn_x0/2+wall, conn_y+pcb_y/2-eps, conn_z0-wall-eps]) + cube([conn_x0-2*wall, conn_len+2*eps, pcb_h+cyl_h+wall+eps-conn_z0]); + translate([-conn_x/2+wall, conn_y+pcb_y/2-eps, -wall]) + cube([conn_x-2*wall, conn_len+2*eps, pcb_h+cyl_h+wall-conn_z0]); + } // cylinders for (x = [-1, 1]) translate([cyl_x*x, 0, pcb_h - eps]) @@ -62,17 +66,25 @@ module case_body() { for (x = [-1, 1]) translate([cyl_x*x, 0, pcb_h + cyl_h]) cylinder(r = cyl_base, h = wall); - translate([0, 8, pcb_h + cyl_h]) - cylinder(r = cyl_base, h = wall); + // front (see cable cover) + translate([-conn_x0/2, conn_y+pcb_y/2, conn_z0-eps]) + cube([conn_x0, wall, pcb_h+cyl_h+wall+eps-conn_z0]); + translate([-conn_x/2, conn_y+pcb_y/2, 0]) + cube([conn_x, wall, pcb_h+cyl_h+wall-conn_z0]); - // connector - translate([-conn_x/2-wall, pcb_y/2-wall, 0]) - cube([conn_x+2*wall, conn_y+2*wall, pcb_h-pcb_thick+wall]); // screw mounts for (x = [1, -1]) scale([x, 1, 1]) translate([pcb_x/2+wall, -screw_head/2-wall, 0]) cube([screw_head, screw_head+2*wall, screw_base]); } + + // cable cover + hull() { + translate([-conn_x0/2, conn_y+pcb_y/2, conn_z0-eps]) + cube([conn_x0, conn_len, pcb_h+cyl_h+wall+eps-conn_z0]); + translate([-conn_x/2, conn_y+pcb_y/2, 0]) + cube([conn_x, conn_len, pcb_h+cyl_h+wall-conn_z0]); + } } module case() {