]> www.fi.muni.cz Git - openparking.git/commitdiff
hc-sr04.scad: alternative cable outlet
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 17 Jun 2015 14:22:03 +0000 (16:22 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 17 Jun 2015 14:22:29 +0000 (16:22 +0200)
things/hc-sr04.scad

index a9d1a1cb39af146314f9771dda76fb0c728b9bc2..e01ca75259e7aad0a2a3cd30359cadfd665bb601 100644 (file)
@@ -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() {