// 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 PopufareHousingBottomPlate() {
  w = POPUFARE_HOUSING_WIDTH;
  h = POPUFARE_HOUSING_DEPTH;
  
  fixture_dx = POPUFARE_FIXTURE_DX;
  fixture_dy = POPUFARE_FIXTURE_DY;
  fixture_bolt = 5.0/2.0;
  
  bx = POPUFARE_BRACKET_CX;
  br = POPUFARE_BRACKET_D/2.0;
  
  fix_c = [0,30];
  
  difference() {
    square([w,h], center=true);
    
    // generic cable access
    //
    translate(fix_c)
    circle(POPUFARE_GLAND_DIAMETER/2.0);
    
    // fixture bolts
    //
    translate(fix_c)
    translate([-fixture_dx/2.0, -fixture_dy/2.0]) circle(fixture_bolt);
    translate(fix_c)
    translate([ fixture_dx/2.0, -fixture_dy/2.0]) circle(fixture_bolt);
    translate(fix_c)
    translate([ fixture_dx/2.0,  fixture_dy/2.0]) circle(fixture_bolt);
    translate(fix_c)
    translate([-fixture_dx/2.0,  fixture_dy/2.0]) circle(fixture_bolt);
    
    // side bracket attachments
    //
    translate([ (w/2 - bx), (h/2-POPUFARE_BRACKET_DE)]) circle(br);
    translate([ (w/2 - bx),-(h/2-POPUFARE_BRACKET_DE)]) circle(br);
    translate([-(w/2 - bx), (h/2-POPUFARE_BRACKET_DE)]) circle(br);
    translate([-(w/2 - bx),-(h/2-POPUFARE_BRACKET_DE)]) circle(br);
    
    // front bracket attachments
    //
    translate([ (w/2 - POPUFARE_BRACKET_DE), -(h/2 - bx)]) circle(br);
    translate([-(w/2 - POPUFARE_BRACKET_DE), -(h/2 - bx)]) circle(br);
    
    // hinge assembly attachment
    //
    
    
  }
}

//PopufareHousingBottomPlate();