Bläddra i källkod

updates

* Some documentation and setting up some images for future documentation
* creating adapter box to interface with legacy power connector and cabling
* updating left side of housing to move buck up to not hit the bracket
* moving common scad file to central location so others can use it
clementinecomputing 6 år sedan
förälder
incheckning
04ebb9da70
25 ändrade filer med 517 tillägg och 171 borttagningar
  1. 7 0
      Documentation/DIU-Assembly.md
  2. 14 0
      Documentation/img/README.md
  3. 1 0
      Documentation/img/noun_Admin panel_995816.svg
  4. 1 0
      Documentation/img/noun_Bus_573359.svg
  5. 1 0
      Documentation/img/noun_Server_1195685.svg
  6. 1 0
      Documentation/img/noun_Server_1474809.svg
  7. 1 0
      Documentation/img/noun_Ticket_1021764.svg
  8. 1 0
      Documentation/img/noun_Ticket_1021765.svg
  9. 5 0
      Documentation/img/noun_Wireless_2468743.svg
  10. 1 0
      Documentation/img/noun_connecting_1736299.svg
  11. 1 0
      Documentation/img/noun_interface_332989.svg
  12. 1 0
      experiment/production/adapter-box/PopufareHousingCommon.scad
  13. 45 0
      experiment/production/adapter-box/PopufarePowerAdapterBottom.scad
  14. 37 0
      experiment/production/adapter-box/PopufarePowerAdapterMiddle.scad
  15. 38 0
      experiment/production/adapter-box/PopufarePowerAdapterMiddleSupport.scad
  16. 65 0
      experiment/production/adapter-box/PopufarePowerAdapterTop.scad
  17. 9 0
      experiment/production/adapter-box/README.md
  18. 3 0
      experiment/production/adapter-box/export/cleanit
  19. 58 0
      experiment/production/adapter-box/export/export-all
  20. 22 0
      experiment/production/adapter-box/render-all.scad
  21. 0 170
      experiment/production/housing/v2/PopufareHousingCommon.scad
  22. 1 0
      experiment/production/housing/v2/PopufareHousingCommon.scad
  23. 5 0
      experiment/production/housing/v2/PopufareHousingSideLeft.scad
  24. 1 1
      experiment/production/housing/v2/export/export-all
  25. 198 0
      experiment/production/scad/PopufareHousingCommon.scad

+ 7 - 0
Documentation/DIU-Assembly.md

@@ -0,0 +1,7 @@
+Driver Interface Unit (DIU) Assembly
+===
+
+This is a document that is a work in progress about
+how to assemble a DIU.
+
+

+ 14 - 0
Documentation/img/README.md

@@ -0,0 +1,14 @@
+Attribution
+---
+
+| File | URL | Attribution Text |
+|---|---|---|
+| `noun_Server_1474809.svg` | [thenounproject.com/term/server/1474809](https://thenounproject.com/term/server/1474809/) | Server by Aiden Icons from the Noun Project |
+| `noun_Server_1195685.svg` | [thenounproject.com/term/server/1195685](https://thenounproject.com/term/server/1195685/) | Server by Chinnaking from the Noun Project |
+| `noun_Admin panel_995816.svg` | [thenounproject.com/term/admin-panel/995816](https://thenounproject.com/term/admin-panel/995816/) | Admin panel by Creative Stall from the Noun Project |
+| `noun_interface_332989.svg` | [thenounproject.com/term/interface/332989](https://thenounproject.com/term/interface/332989/) | interface by Deivid Sáenz from the Noun Project |
+| `noun_Wireless_2468743.svg` | [thenounproject.com/term/wireless/2468743](https://thenounproject.com/term/wireless/2468743/) | Wireless by wardehpillai from the Noun Project |
+| `noun_connecting_1736299.svg` | [thenounproject.com/term/connecting/1736299](https://thenounproject.com/term/connecting/1736299/) | connecting by Xela Ub from the Noun Project |
+| `noun_Bus_573359.svg` | [thenounproject.com/term/bus/573359](https://thenounproject.com/term/bus/573359/) | Bus by Anniken & Andreas from the Noun Project |
+| `noun_Ticket_1021765.svg` | [thenounproject.com/term/ticket/1021765](https://thenounproject.com/term/ticket/1021765/) | Ticket by Anniken & Andreas from the Noun Project |
+| `noun_Ticket_1021764.svg` | [thenounproject.com/term/ticket/1021764](https://thenounproject.com/term/ticket/1021764/) |Ticket by Anniken & Andreas from the Noun Project |

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
Documentation/img/noun_Admin panel_995816.svg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
Documentation/img/noun_Bus_573359.svg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
Documentation/img/noun_Server_1195685.svg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
Documentation/img/noun_Server_1474809.svg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
Documentation/img/noun_Ticket_1021764.svg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
Documentation/img/noun_Ticket_1021765.svg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 5 - 0
Documentation/img/noun_Wireless_2468743.svg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
Documentation/img/noun_connecting_1736299.svg


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
Documentation/img/noun_interface_332989.svg


+ 1 - 0
experiment/production/adapter-box/PopufareHousingCommon.scad

@@ -0,0 +1 @@
+../scad/PopufareHousingCommon.scad

+ 45 - 0
experiment/production/adapter-box/PopufarePowerAdapterBottom.scad

@@ -0,0 +1,45 @@
+// License: CC0
+//
+// To the extent possible under law, Clementine Computing LLC has waived
+// all copyright and related or neighboring rights to this file.
+//
+// This work is published from: United States.
+//
+
+include <PopufareHousingCommon.scad>
+
+module PopufarePowerAdapterBottomPlate() {
+  _w = _POWER_BOX_WIDTH;
+  _h = _POWER_BOX_HEIGHT;
+  _r = _POWER_BOX_R;
+  
+  piu_usb_h = _POWER_BOX_PIU_USB_H;
+  
+  difference() {
+    rounded_rect(_w, _h, _r);
+    
+    // housing holes
+    //
+    translate([ (_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
+    translate([-(_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
+    translate([-(_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
+    translate([ (_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
+    
+    // max232 converter. It has no holes so we'll be using cable ties
+    //
+    translate([5,5])
+    union() {
+      translate([-_POWER_BOX_STRAP_DW/2, -_POWER_BOX_STRAP_DH/2]) circle(_r);
+      translate([ _POWER_BOX_STRAP_DW/2, -_POWER_BOX_STRAP_DH/2]) circle(_r);
+      translate([ _POWER_BOX_STRAP_DW/2,  _POWER_BOX_STRAP_DH/2]) circle(_r);
+      translate([-_POWER_BOX_STRAP_DW/2,  _POWER_BOX_STRAP_DH/2]) circle(_r);
+    }
+    
+    // PIU rs232 ttl USB out
+    //
+    translate([-_w/2+_PIU_USB_HOLE_DE, piu_usb_h + _PIU_USB_HOLE_DW/2])
+      circle(_PIU_USB_HOLE_R);
+    translate([-_w/2+_PIU_USB_HOLE_DE, piu_usb_h - _PIU_USB_HOLE_DW/2])
+      circle(_PIU_USB_HOLE_R);
+  }
+}

+ 37 - 0
experiment/production/adapter-box/PopufarePowerAdapterMiddle.scad

@@ -0,0 +1,37 @@
+// License: CC0
+//
+// To the extent possible under law, Clementine Computing LLC has waived
+// all copyright and related or neighboring rights to this file.
+//
+// This work is published from: United States.
+//
+
+include <PopufareHousingCommon.scad>
+
+module PopufarePowerAdapterMiddlePlate() {
+  _w = _POWER_BOX_WIDTH;
+  _h = _POWER_BOX_HEIGHT;
+  _r = _POWER_BOX_R;
+  
+  piu_usb_h = _POWER_BOX_PIU_USB_H;
+  
+  difference() {
+    rounded_rect(_w, _h, _r);
+    
+    // housing holes
+    //
+    translate([ (_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
+    translate([-(_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
+    translate([-(_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
+    translate([ (_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
+    
+    rounded_rect(_w - 12*_r, _h - 12*_r, _r);
+
+    // PIU rs232 ttl USB out
+    //
+    translate([-_w/2, piu_usb_h])
+      square([24*_r, _PIU_USB_WIDTH], center=true);
+
+  }
+}
+

+ 38 - 0
experiment/production/adapter-box/PopufarePowerAdapterMiddleSupport.scad

@@ -0,0 +1,38 @@
+// License: CC0
+//
+// To the extent possible under law, Clementine Computing LLC has waived
+// all copyright and related or neighboring rights to this file.
+//
+// This work is published from: United States.
+//
+
+include <PopufareHousingCommon.scad>
+
+module PopufarePowerAdapterMiddleSupportPlate() {
+  _w = _POWER_BOX_WIDTH;
+  _h = _POWER_BOX_HEIGHT;
+  _r = _POWER_BOX_R;
+  
+  piu_usb_h = _POWER_BOX_PIU_USB_H;
+  
+  difference() {
+    rounded_rect(_w, _h, _r);
+
+    translate([0,-_POWER_CONNECTOR_HEIGHT/2])
+      rounded_rect(_w - 12*_r, _h - 12*_r - _POWER_CONNECTOR_HEIGHT, _r);
+  
+    // housing holes
+    //
+    translate([ (_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
+    translate([-(_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
+    translate([-(_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
+    translate([ (_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
+    
+
+    // PIU rs232 ttl USB out
+    //
+    translate([-_w/2, piu_usb_h])
+      square([24*_r, _PIU_USB_WIDTH], center=true);
+
+  }
+}

+ 65 - 0
experiment/production/adapter-box/PopufarePowerAdapterTop.scad

@@ -0,0 +1,65 @@
+// License: CC0
+//
+// To the extent possible under law, Clementine Computing LLC has waived
+// all copyright and related or neighboring rights to this file.
+//
+// This work is published from: United States.
+//
+
+include <PopufareHousingCommon.scad>
+
+module PopufarePowerAdapterTopPlate() {
+  _w = _POWER_BOX_WIDTH;
+  _h = _POWER_BOX_HEIGHT;
+  _r = _POWER_BOX_R;
+  
+  conw = _POWER_CONNECTOR_WIDTH;
+  conh = _POWER_CONNECTOR_HEIGHT;
+  
+  piu_usb_h = _POWER_BOX_PIU_USB_H;
+  
+  difference() {
+    rounded_rect(_w, _h, _r);
+    translate([0, _h/2 - conh/2 -  6*_r]) square([conw, conh], center=true);
+    
+    // housing holes
+    //
+    translate([ (_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
+    translate([-(_w/2 - 3*_r), (_h/2 - 3*_r)]) circle(_r);
+    translate([-(_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
+    translate([ (_w/2 - 3*_r),-(_h/2 - 3*_r)]) circle(_r);
+    
+    // max232 converter. It has no holes so we'll be using cable ties
+    //
+    translate([5,5])
+    union() {
+      translate([-_POWER_BOX_STRAP_DW/2, -_POWER_BOX_STRAP_DH/2]) circle(_r);
+      translate([ _POWER_BOX_STRAP_DW/2, -_POWER_BOX_STRAP_DH/2]) circle(_r);
+      translate([ _POWER_BOX_STRAP_DW/2,  _POWER_BOX_STRAP_DH/2]) circle(_r);
+      translate([-_POWER_BOX_STRAP_DW/2,  _POWER_BOX_STRAP_DH/2]) circle(_r);
+    }
+    
+    // PIU rs232 ttl USB out
+    //
+    translate([-_w/2+_PIU_USB_HOLE_DE, piu_usb_h + _PIU_USB_HOLE_DW/2])
+      circle(_PIU_USB_HOLE_R);
+    translate([-_w/2+_PIU_USB_HOLE_DE, piu_usb_h - _PIU_USB_HOLE_DW/2])
+      circle(_PIU_USB_HOLE_R);
+    
+    // various holes for connections
+    //
+    translate([-_w/2+_PIU_USB_HOLE_DE*2, piu_usb_h + _PIU_USB_HOLE_DW/2+2*_r])
+      circle(_r);
+    translate([-_w/2+_PIU_USB_HOLE_DE*2, piu_usb_h - _PIU_USB_HOLE_DW/2-2*_r])
+      circle(_r);
+
+    translate([0,-_h/4+10]) circle(_r);
+    translate([10,-_h/4 + 10]) circle(_r);
+    translate([0,-_h/4]) circle(_r);
+    translate([0,-_h/4 - 10]) circle(_r);
+    translate([10,-_h/4]) circle(_r);
+    translate([10,-_h/4 - 10]) circle(_r);
+  }
+}
+
+PopufarePowerAdapterTopPlate();

+ 9 - 0
experiment/production/adapter-box/README.md

@@ -0,0 +1,9 @@
+Adapter Box
+===
+
+In order to connect to the legacy system's PIU and power connector,
+an adapter is needed.
+
+This box holds a `B2L 3.5/10 F SN SW` 20pin connector (10x2).
+
+

+ 3 - 0
experiment/production/adapter-box/export/cleanit

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+rm -f *.gp *.ngc *.svg *.ps *.eps

+ 58 - 0
experiment/production/adapter-box/export/export-all

@@ -0,0 +1,58 @@
+#!/bin/bash
+
+VERSION=0.1.0
+
+function ngc_position {
+  ifn="$1"
+
+  offsetx=10
+  offsety=10
+
+  if [[ "$ifn" == "" ]] ; then
+    echo "provide file"
+    exit 1
+  fi
+
+  dos2unix $ifn
+  sed -i 's/;.*//' $ifn
+
+  mx=`ngc_bounds $ifn | grep min_x | cut -f2 -d' '`
+  my=`ngc_bounds $ifn | grep min_y | cut -f2 -d' '`
+
+  shiftx=` echo "-($mx) + $offsetx" | bc -l`
+  shifty=` echo "-($my) + $offsety" | bc -l`
+
+  tfn=`mktemp`
+
+  #echo "G0 F5000" > $tfn
+  grecode -shift "$shiftx" "$shifty" $ifn | \
+    grep -v '^(' >> $tfn 2> /dev/null
+  mv $tfn $ifn
+
+  rm -f $tfn
+}
+
+tmpfn=`mktemp`
+
+for fn in `ls ../Popufare*.scad  | grep -v PopufareHousingCommon.scad ` ; do
+  bfn=`basename $fn .scad`
+  svg="$bfn.$VERSION.svg"
+  ngc="$bfn.$VERSION.ngc"
+
+  echo "## $bfn"
+
+  basedir=`dirname $( pwd ) `
+
+  echo "include <$basedir/$bfn.scad>" > $tmpfn
+  echo "${bfn}Plate();" >> $tmpfn
+
+  openscad -o "$svg" "$tmpfn"
+  svg2ngc "$svg" 2> /dev/null
+  ngc_position "$ngc" 2> /dev/null
+
+  sed -i 's/F800/F150/g' "$ngc"
+  sed -i 's/G0\(.*\)S\(.*\)/G0\1 F5000 S\2/g' "$ngc"
+
+done
+
+rm $tmpfn

+ 22 - 0
experiment/production/adapter-box/render-all.scad

@@ -0,0 +1,22 @@
+// License: CC0
+//
+// To the extent possible under law, Clementine Computing LLC has waived
+// all copyright and related or neighboring rights to this file.
+//
+// This work is published from: United States.
+//
+
+include <PopufareHousingCommon.scad>
+include <PopufarePowerAdapterTop.scad>
+include <PopufarePowerAdapterBottom.scad>
+include <PopufarePowerAdapterMiddle.scad>
+include <PopufarePowerAdapterMiddleSupport.scad>
+
+module render() {
+  PopufarePowerAdapterTopPlate();
+  translate([70,0]) PopufarePowerAdapterBottomPlate();
+  translate([140,0]) PopufarePowerAdapterMiddlePlate();
+  translate([70*3,0]) PopufarePowerAdapterMiddleSupportPlate();
+}
+
+render();

+ 0 - 170
experiment/production/housing/v2/PopufareHousingCommon.scad

@@ -1,170 +0,0 @@
-// License: CC0
-//
-// To the extent possible under law, Clementine Computing LLC has waived
-// all copyright and related or neighboring rights to this file.
-//
-// This work is published from: United States.
-//
-
-$fs = 1.0/64.0;
-
-// ...
-//
-
-// 1/8 inch sheet thickness
-//
-//_MATERIAL_THICKNESS = 3.175
-
-// 1/4 inch sheet thickness
-//
-_MATERIAL_THICKNESS = 6.35;
-
-_M2 = 2.0;
-_M2r = 2.0/2;
-
-_M3 = 3.0;
-_M3r = 3.0/2;
-
-_M4 = 4.0;
-_M4r = 4.0/2;
-
-_M5 = 5.0;
-_M5r = 5.0/2;
-
-// in mm
-//
-POPUFARE_HOUSING_WIDTH = 190;
-POPUFARE_HOUSING_DEPTH = 165;
-POPUFARE_HOUSING_HEIGHT = 135;
-
-POPUFARE_SCREEN_WIDTH_CAPACITIVE = 122;
-POPUFARE_SCREEN_HEIGHT_CAPACITIVE = 78;
-
-POPUFARE_SCREEN_WIDTH_RESISTIVE = 119;
-POPUFARE_SCREEN_HEIGHT_RESISTIVE = 71;
-
-
-POPUFARE_GLAND_DIAMETER = 37;
-POPUFARE_SCREEN_OUTER_WIDTH = 122;
-
-//POPUFARE_SCREEN_WIDTH = 118 + 1;
-//POPUFARE_SCREEN_HEIGHT = 70 + 1;
-
-POPUFARE_SCREEN_OUTER_HEIGHT = 78;
-
-POPUFARE_FRONT_HEIGHT = 60;
-
-POPUFARE_FIXTURE_DX = 65;
-POPUFARE_FIXTURE_DY = 65;
-POPUFARE_FIXTURE_SCREW_D = 7.5;
-
-POPUFARE_HINGE1_DE = 8.25 + 3.75/2;
-POPUFARE_HINGE1_DH = (22 - 3.75*2) + 3.75;
-POPUFARE_HINGE1_DW = 27.75 + (35.5 - 27.75)/2;
-POPUFARE_HINGE1_R = 2;
-
-// bracket
-//
-
-POPUFARE_BRACKET_CX = 20;
-POPUFARE_BRACKET_D = 5;
-
-POPUFARE_BRACKET_DS = 100;
-POPUFARE_BRACKET_DE = 40;
-POPUFARE_BRACKET_DE_SHORT = 20;
-
-// buck
-//
-
-POPUFARE_BUCK_HOLE_WIDTH0 = 53.6 + (59.8-53.6)/2;
-POPUFARE_BUCK_HOLE_WIDTH1 = 39 + (45-39)/2;
-
-POPUFARE_BUCK_HOLE_LEN1 = 6.2;
-POPUFARE_BUCK_HOLE_R = 3.0/2;
-
-POPUFARE_BUCK_WIDTH = 49.8;
-POPUFARE_BUCK_HEIGHT = 52.9;
-POPUFARE_BUCK_HOLE_DH = 25 + (6.25)/2 + 3.0/2;
-
-// 117 - 111 = 6
-// 111 + 3 = 114
-//
-// 87 - 81 = 6
-// 81 + 3 = 84
-
-// inner plates
-//
-POPUFARE_INNER_PLATE_WIDTH = 90;
-POPUFARE_INNER_PLATE_HEIGHT = 70;
-
-//POPUFARE_INNER_PLATE_HOLE_WIDTH = POPUFARE_SCREEN_OUTER_WIDTH + 0;
-//POPUFARE_INNER_PLATE_HOLE_HEIGHT = POPUFARE_SCREEN_OUTER_HEIGHT + 20;
-
-POPUFARE_INNER_PLATE_HOLE_WIDTH = 114;
-POPUFARE_INNER_PLATE_HOLE_HEIGHT = 84;
-
-
-POPUFARE_SPEAKER_HOLE_R = 2.5/2;
-POPUFARE_SPEAKER_HOLE_WIDTH = 34.5 + ((39.5 - 34.5) / 2);
-
-// hinge
-//
-POPUFARE_HINGE_TOP_HOLE_WIDTH = 32;
-POPUFARE_HINGE_TOP_HOLE_DE = 36;
-
-POPUFARE_HINGE_BACK_HOLE_WIDTH = 45;
-POPUFARE_HINGE_BACK_HOLE_DE = 28;
-
-POPUFARE_HINGE_D = _M4;
-
-// Raspberry Pi measurements
-//
-_RASPBERRY_PI_B_HOLE_DX = 58;
-_RASPBERRY_PI_B_HOLE_DY = 48;
-
-_SCREEN_HOLE_DX = 93;
-_SCREEN_HOLE_DY = 69;
-
-
-// Center for raspberry pi from screen
-// that sits on top of it.
-//
-_SCREEN_OUTER_CENTER = [ POPUFARE_SCREEN_OUTER_WIDTH/2, POPUFARE_SCREEN_OUTER_HEIGHT/2 ];
-
-// offset of left screen m2 screws
-// as seen from the back, front ribbon down
-//
-_SCREEN_LL_M2_C = [ 5,5 ];
-_SCREEN_UL_M2_C = [ 5, POPUFARE_SCREEN_OUTER_HEIGHT - 4 ];
-
-_SCREEN_CX = _SCREEN_HOLE_DX/2 + _SCREEN_LL_M2_C[0] - _SCREEN_OUTER_CENTER[0];
-_SCREEN_CY = _SCREEN_HOLE_DY/2 + _SCREEN_LL_M2_C[1] - _SCREEN_OUTER_CENTER[1];
-
-_RASPBERRY_PI_B_CX = (_SCREEN_HOLE_DX - _RASPBERRY_PI_B_HOLE_DX/2) + _SCREEN_LL_M2_C[0] - _SCREEN_OUTER_CENTER[0];
-_RASPBERRY_PI_B_CY = (_SCREEN_HOLE_DY - _RASPBERRY_PI_B_HOLE_DY/2) + _SCREEN_LL_M2_C[1] - _SCREEN_OUTER_CENTER[1];
-
-
-// Bounding box width of rouned rect is w and h,
-// so this function compensates for the rounded corner
-// radius.
-//
-// w - width or rectangle
-// h - height of rectangle
-// r - corner radius
-//
-// rounded rectangle has center of mass (center) at (0,0)
-//
-module rounded_rect(w,h,r) {
-  _w = w-2*r;
-  _h = h-2*r;
-  
-  x2 = _w/2;
-  y2 = _h/2;
-  
-  hull() {
-    translate([-x2, y2]) circle(r);
-    translate([ x2, y2]) circle(r);
-    translate([ x2,-y2]) circle(r);
-    translate([-x2,-y2]) circle(r);
-  }
-}

+ 1 - 0
experiment/production/housing/v2/PopufareHousingCommon.scad

@@ -0,0 +1 @@
+../../scad/PopufareHousingCommon.scad

+ 5 - 0
experiment/production/housing/v2/PopufareHousingSideLeft.scad

@@ -86,6 +86,11 @@ module PopufareHousingSideLeftPlate() {
       translate([-buck_dw1/2,  buck_dh/2]) circle(buck_r);
       translate([ buck_dw1/2,  buck_dh/2]) circle(buck_r);
     }
+    
+    // usb power out
+    //
+    translate([0,-h/4-10]) translate([0,_POWER_USB_HOLE_DW/2]) circle(_POWER_USB_HOLE_R);
+    translate([0,-h/4-10]) translate([0,-_POWER_USB_HOLE_DW/2]) circle(_POWER_USB_HOLE_R);
   }
 }
 

+ 1 - 1
experiment/production/housing/v2/export/export-all

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-VERSION=0.1.7
+VERSION=2.1.8
 
 function ngc_position {
   ifn="$1"

+ 198 - 0
experiment/production/scad/PopufareHousingCommon.scad

@@ -0,0 +1,198 @@
+// License: CC0
+//
+// To the extent possible under law, Clementine Computing LLC has waived
+// all copyright and related or neighboring rights to this file.
+//
+// This work is published from: United States.
+//
+
+$fs = 1.0/64.0;
+
+// ...
+//
+
+// 1/8 inch sheet thickness
+//
+//_MATERIAL_THICKNESS = 3.175
+
+// 1/4 inch sheet thickness
+//
+_MATERIAL_THICKNESS = 6.35;
+
+_M2 = 2.0;
+_M2r = 2.0/2;
+
+_M3 = 3.0;
+_M3r = 3.0/2;
+
+_M4 = 4.0;
+_M4r = 4.0/2;
+
+_M5 = 5.0;
+_M5r = 5.0/2;
+
+// in mm
+//
+POPUFARE_HOUSING_WIDTH = 190;
+POPUFARE_HOUSING_DEPTH = 165;
+POPUFARE_HOUSING_HEIGHT = 135;
+
+POPUFARE_SCREEN_WIDTH_CAPACITIVE = 122;
+POPUFARE_SCREEN_HEIGHT_CAPACITIVE = 78;
+
+POPUFARE_SCREEN_WIDTH_RESISTIVE = 119;
+POPUFARE_SCREEN_HEIGHT_RESISTIVE = 71;
+
+
+POPUFARE_GLAND_DIAMETER = 37;
+POPUFARE_SCREEN_OUTER_WIDTH = 122;
+
+//POPUFARE_SCREEN_WIDTH = 118 + 1;
+//POPUFARE_SCREEN_HEIGHT = 70 + 1;
+
+POPUFARE_SCREEN_OUTER_HEIGHT = 78;
+
+POPUFARE_FRONT_HEIGHT = 60;
+
+POPUFARE_FIXTURE_DX = 65;
+POPUFARE_FIXTURE_DY = 65;
+POPUFARE_FIXTURE_SCREW_D = 7.5;
+
+POPUFARE_HINGE1_DE = 8.25 + 3.75/2;
+POPUFARE_HINGE1_DH = (22 - 3.75*2) + 3.75;
+POPUFARE_HINGE1_DW = 27.75 + (35.5 - 27.75)/2;
+POPUFARE_HINGE1_R = 2;
+
+// bracket
+//
+
+POPUFARE_BRACKET_CX = 20;
+POPUFARE_BRACKET_D = 5;
+
+POPUFARE_BRACKET_DS = 100;
+POPUFARE_BRACKET_DE = 40;
+POPUFARE_BRACKET_DE_SHORT = 20;
+
+// buck
+//
+
+POPUFARE_BUCK_HOLE_WIDTH0 = 53.6 + (59.8-53.6)/2;
+POPUFARE_BUCK_HOLE_WIDTH1 = 39 + (45-39)/2;
+
+POPUFARE_BUCK_HOLE_LEN1 = 6.2;
+POPUFARE_BUCK_HOLE_R = 3.0/2;
+
+POPUFARE_BUCK_WIDTH = 49.8;
+POPUFARE_BUCK_HEIGHT = 52.9;
+POPUFARE_BUCK_HOLE_DH = 25 + (6.25)/2 + 3.0/2;
+
+// 117 - 111 = 6
+// 111 + 3 = 114
+//
+// 87 - 81 = 6
+// 81 + 3 = 84
+
+// inner plates
+//
+POPUFARE_INNER_PLATE_WIDTH = 90;
+POPUFARE_INNER_PLATE_HEIGHT = 70;
+
+//POPUFARE_INNER_PLATE_HOLE_WIDTH = POPUFARE_SCREEN_OUTER_WIDTH + 0;
+//POPUFARE_INNER_PLATE_HOLE_HEIGHT = POPUFARE_SCREEN_OUTER_HEIGHT + 20;
+
+POPUFARE_INNER_PLATE_HOLE_WIDTH = 114;
+POPUFARE_INNER_PLATE_HOLE_HEIGHT = 84;
+
+
+POPUFARE_SPEAKER_HOLE_R = 2.5/2;
+POPUFARE_SPEAKER_HOLE_WIDTH = 34.5 + ((39.5 - 34.5) / 2);
+
+// hinge
+//
+POPUFARE_HINGE_TOP_HOLE_WIDTH = 32;
+POPUFARE_HINGE_TOP_HOLE_DE = 36;
+
+POPUFARE_HINGE_BACK_HOLE_WIDTH = 45;
+POPUFARE_HINGE_BACK_HOLE_DE = 28;
+
+POPUFARE_HINGE_D = _M4;
+
+// Raspberry Pi measurements
+//
+_RASPBERRY_PI_B_HOLE_DX = 58;
+_RASPBERRY_PI_B_HOLE_DY = 48;
+
+_SCREEN_HOLE_DX = 93;
+_SCREEN_HOLE_DY = 69;
+
+
+// Center for raspberry pi from screen
+// that sits on top of it.
+//
+_SCREEN_OUTER_CENTER = [ POPUFARE_SCREEN_OUTER_WIDTH/2, POPUFARE_SCREEN_OUTER_HEIGHT/2 ];
+
+// offset of left screen m2 screws
+// as seen from the back, front ribbon down
+//
+_SCREEN_LL_M2_C = [ 5,5 ];
+_SCREEN_UL_M2_C = [ 5, POPUFARE_SCREEN_OUTER_HEIGHT - 4 ];
+
+_SCREEN_CX = _SCREEN_HOLE_DX/2 + _SCREEN_LL_M2_C[0] - _SCREEN_OUTER_CENTER[0];
+_SCREEN_CY = _SCREEN_HOLE_DY/2 + _SCREEN_LL_M2_C[1] - _SCREEN_OUTER_CENTER[1];
+
+_RASPBERRY_PI_B_CX = (_SCREEN_HOLE_DX - _RASPBERRY_PI_B_HOLE_DX/2) + _SCREEN_LL_M2_C[0] - _SCREEN_OUTER_CENTER[0];
+_RASPBERRY_PI_B_CY = (_SCREEN_HOLE_DY - _RASPBERRY_PI_B_HOLE_DY/2) + _SCREEN_LL_M2_C[1] - _SCREEN_OUTER_CENTER[1];
+
+
+// Bounding box width of rouned rect is w and h,
+// so this function compensates for the rounded corner
+// radius.
+//
+// w - width or rectangle
+// h - height of rectangle
+// r - corner radius
+//
+// rounded rectangle has center of mass (center) at (0,0)
+//
+module rounded_rect(w,h,r) {
+  _w = w-2*r;
+  _h = h-2*r;
+  
+  x2 = _w/2;
+  y2 = _h/2;
+  
+  hull() {
+    translate([-x2, y2]) circle(r);
+    translate([ x2, y2]) circle(r);
+    translate([ x2,-y2]) circle(r);
+    translate([-x2,-y2]) circle(r);
+  }
+}
+
+// adapter dimensions
+//
+
+_POWER_CONNECTOR_WIDTH = 36.5;
+_POWER_CONNECTOR_HEIGHT = 10.5;
+_POWER_CONNECTOR_DEPTH = 14.5;
+
+_POWER_USB_HOLE_DW = 9.11 + (15.11-9.11)/2;
+_POWER_USB_HOLE_R = 3/2;
+
+_PIU_USB_HOLE_DW = 9.25 + (12.5-9.25)/2;
+_PIU_USB_HOLE_DE = 8.5;
+_PIU_USB_HOLE_R = 2/2;
+_PIU_USB_WIDTH = 12;
+
+_POWER_BOX_R = 3/2;
+_POWER_BOX_WIDTH = _POWER_CONNECTOR_WIDTH + 12*_POWER_BOX_R;
+_POWER_BOX_HEIGHT = 3*_POWER_CONNECTOR_WIDTH + 12*_POWER_BOX_R;
+
+_POWER_BOX_PIU_USB_H = -_POWER_BOX_HEIGHT/4;
+
+
+_POWER_BOX_STRAP_DW = 18;
+_POWER_BOX_STRAP_DH = 22;
+_POWER_BOX_STRAP_R = 3/2;
+
+