//Copyright © 2018 by Abbott Analytical Products. All Rights Reserved. 
/*
Tab half of puzzle box

see box_tab
988: added chamber and its cut
989: good balnce on slices
990: better spcing of slcies
991: set slicex/y variables
992: move parallel slices 
993: rotate top slices move to ut1 and cut2
994: both cuts in top
moved cut1 added cut2
cut1
slice from top of block
added slicedepth and slicetop
*/

module boxtab( )
{
    echo(version=version());
    slicedepth = .35;
    slicex     = 8;
    slicey     = 1;//.75;
    angle     = 45;

$fn = 90;

module slicetop()
{
   rotate([0,0,angle])translate ([0,0,-slicedepth]) 
    {
    cube([slicex, slicey,slicedepth]);
    }
}

module cut1()
{
    { slicetop();}
}


module cut2()
{
    {slicetop();}
}


module chamber()
{
    cylinder(3.5,1.5,1.5,false);
}



module stud()
{
    cylinder(3,.25,.25,false);
}


module base()
{    
   translate ([0,0,-1]) 
    {
    cube([4,4,1]);
    }   
}   
 
module diff1()
difference()
{
    base();
    translate([0,1.25,0]) {cut1();}
}

module diff2()
{
    difference()
    {
    diff1();
    translate([0,-2.5,0]){cut2();}
    }
} //end of diff2



module cutchamber()
{
    difference()
    {
       diff2();
       translate([2,2,-.75])chamber();        
    }
}

module final()
{
   difference()
   { 
   cutchamber();
   translate([.6,.6,-.75])
       stud(); 
   }
} // end of final


final();

} // end of boxtab


boxtab( );