User:Dorkmo/Ideas/Battery/SCAD/201510

From Open Source Ecology
< User:Dorkmo‎ | Ideas‎ | Battery‎ | SCAD
Jump to: navigation, search

tub

  • grooves didnt seem to help with cracking in past versions
    • might tweak

height = 90;
tub_width = 38;
tub_length = 88;
basethickness = 5;
tub_wall = 2;
tub_outsidewall = 3;
tub_wallgroovedepth = 2;
tub_wallgroovewidth = 7.5;
tub_wallgroovecorners =6;
tub_wallgrooveshift = 0; //-0.5 1st try, messes up groove matchup
grooves_yn = 1; //1 yes 0 no

eyelets_rowside = 2;
eyelets_columnside = 3;

eyelets_belowtop = 10;
eyelets_walltoceneter = 5;
eyelets_od = 7;
eyelets_id = 3;
eyelets_width = 5;

tubs_rows    = 1;
tubs_columns = 1;

spacing = 1.940055;
space_belowcage=5;

cage_height = 65;
cage_wall = 7;
cage_endwall = 2;
cage_base = 4;

mesh_opening = 1.875 ;
mesh_angle = 50;
mesh_spacing = 4.1;

wire_diameter = 2;
wire_holeoffc = 0;
cage_lid_depthinto = 7;
cage_divot_height = 4;
tub_lid_depthinto = 7;
tub_divot_height = 5.5;

//*******************************************

tub_wallgroovewidthactual=((2*(tub_width+(2*tub_outsidewall)-tub_wallgroovecorners))+(2*(tub_length+(2*tub_outsidewall)-tub_wallgroovecorners)))/(2*round(((2*(tub_width+(2*tub_outsidewall)-tub_wallgroovecorners))+(2*(tub_length+(2*tub_outsidewall)-tub_wallgroovecorners)))/(2*tub_wallgroovewidth)));


echo("groove width=",tub_wallgroovewidthactual);

echo(tan(45)*(tub_width+(2*tub_outsidewall)-tub_wallgroovecorners)
-(floor((tub_width+(2*tub_outsidewall)-tub_wallgroovecorners)/tub_wallgroovewidthactual)*tub_wallgroovewidthactual));

echo((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth);

echo((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual);

echo((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners);

echo((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/tub_wallgroovewidthactual)*tub_wallgroovewidthactual)));

echo(((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual)+((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual))-((2*tub_wallgroovewidthactual)*floor(((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual)+((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual))/(2*tub_wallgroovewidthactual))))));

echo(((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual))
;



union()//eyelets
{
difference()//grooves
{
union()
 {

//tubs
for (c = [0 : tubs_columns-1])
 {
  translate([0,c*(tub_length+tub_wall),0])
   {
    for (r = [0 : tubs_rows-1])
    {
     translate([r*(tub_width+tub_wall),0,0])
      {
       tub();
      }
    }
   }
 }
//end tubs

//outer walls
translate([-tub_outsidewall+tub_wall+(tub_wallgroovecorners/2),-tub_outsidewall+tub_wall+(tub_wallgroovecorners/2),0])
 {
  difference()
   {
       $fn=50;
       minkowski()
       {
    cube(size = [(((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners,(((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners,height-1]);
    cylinder(r=(tub_wallgroovecorners/2),h=(1));
   }
       
    translate([tub_outsidewall-(tub_wallgroovecorners/2),tub_outsidewall-(tub_wallgroovecorners/2),0])
     {
      cube(size = [(((tub_width+tub_wall)*tubs_rows)+tub_wall)-(tub_wall*2),(((tub_length+tub_wall)*tubs_columns)+tub_wall)-(tub_wall*2),height+1]);
     }
   }
 }

//end outer walls

} //end union

////grooves
//1
rotate([0,0,0])
{
translate([tub_wall-tub_outsidewall+(tub_wallgroovecorners/2),tub_wall-tub_outsidewall,0])
{
if(grooves_yn==1)grooves(tub_wallgroovedepth,tub_wallgroovewidthactual,(((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners,height,0);
}
}
//2
rotate([0,0,90])
{
translate([(tub_wall-tub_outsidewall)+(tub_wallgroovecorners/2),-(tub_wall-tub_outsidewall)-(((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall),0])
{
if(grooves_yn==1)grooves(tub_wallgroovedepth,tub_wallgroovewidthactual,((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall-tub_wallgroovecorners,height,(((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual))-(tub_wallgrooveshift*1));
}
}
//3
rotate([0,0,180])
{
translate([-(tub_wall-tub_outsidewall)-(tub_wallgroovecorners/2)-((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners),-tub_wall-tub_outsidewall-((((tub_length+tub_wall)*tubs_columns)+tub_wall)-(tub_wall*2)),0])
{
if(grooves_yn==1)grooves(tub_wallgroovedepth,tub_wallgroovewidthactual,(((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners,height,((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual)+((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual))-((2*tub_wallgroovewidthactual)*floor(((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual)+((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidthactual*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual))/(2*tub_wallgroovewidthactual)))))-(tub_wallgrooveshift*2));
}
}
//4
rotate([0,0,270])
{
translate([-tub_wall-tub_outsidewall-((((tub_length+tub_wall)*tubs_columns)+tub_wall)-(tub_wall*2))+(tub_wallgroovecorners/2),(tub_wall-tub_outsidewall),0])
{
if(grooves_yn==1)grooves(tub_wallgroovedepth,tub_wallgroovewidth,((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall-tub_wallgroovecorners,height,((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-
(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-
tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual)
+
((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-
(2*tub_wallgroovewidthactual*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-
tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual)
+
((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-
(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-
tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual))
-
((2*tub_wallgroovewidthactual)
*
floor(((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-
(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-
tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual)
+
((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-
(2*tub_wallgroovewidthactual*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-
tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual)
+
((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-
(2*tub_wallgroovewidthactual*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-
tub_wallgroovecorners)/(2*tub_wallgroovewidthactual))))-tub_wallgroovewidthactual))
/
(2*tub_wallgroovewidthactual)))))-(tub_wallgrooveshift*3)+1.5);
}
}

////end grooves
} //end difference
//begin eyelets
//1 rowside
translate([(tub_wall-tub_outsidewall),(tub_wall-tub_outsidewall)-eyelets_walltoceneter,height-eyelets_belowtop])
{
for (e = [1:eyelets_rowside])
{
translate([(((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)/(eyelets_rowside+1)*e,0,0])
{
rotate([0,0,180])
{
eyelet(eyelets_od,eyelets_id,eyelets_width,tub_wallgroovedepth+eyelets_walltoceneter-(eyelets_od/2));
}
}
}
}
//2
//3
translate([(tub_wall-tub_outsidewall),((tub_length*tubs_columns)+(tub_wall*(tubs_columns))+tub_wall)+(tub_outsidewall*2),height-eyelets_belowtop])
{
for (e = [1:eyelets_rowside])
{
translate([(((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)/(eyelets_rowside+1)*e,0,0])
{
rotate([0,0,0])
{
#eyelet(eyelets_od,eyelets_id,eyelets_width,tub_wallgroovedepth+eyelets_walltoceneter-(eyelets_od/2));
}
}
}
}
//4

//end eyelets
} //end union



//////end render
//////begin modules

////tub module
module tub()
{
union()
{
//walls
 difference()
  {
   cube(size = [tub_width+(tub_wall*2), tub_length+(tub_wall*2), height], center=false);
   translate([tub_wall+spacing,tub_wall+spacing,basethickness+spacing])
    {
        $fn=50;
      minkowski()
        {
       cube(size = [tub_width-(spacing*2), tub_length-(spacing*2), height-basethickness+1-1], center=false);
        sphere(r=spacing);
      }
    }
  }
//end walls

//spheres lock ins
//1
      translate([tub_wall,(tub_length*1/4)+tub_wall,height-(((tub_lid_depthinto-tub_divot_height)/2)+(tub_divot_height/2))])
       {
        mirror([1,0,0])
         {
          #divot_sphere();
         }
       }
//2
      translate([tub_wall,(tub_length*3/4)+tub_wall,height-(((tub_lid_depthinto-tub_divot_height)/2)+(tub_divot_height/2))])
       {
        mirror([1,0,0])
         {
          divot_sphere();
         }
       }
//3
      translate([tub_width+tub_wall,(tub_length*1/4)+tub_wall,height-(((tub_lid_depthinto-tub_divot_height)/2)+(tub_divot_height/2))])
       {
        mirror([0,0,0])
         {
          divot_sphere();
         }
       }
//4
      translate([tub_width+tub_wall,(tub_length*3/4)+tub_wall,height-(((tub_lid_depthinto-tub_divot_height)/2)+(tub_divot_height/2))])
       {
        mirror([0,0,0])
         {
          divot_sphere();
         }
       }
//5
      translate([(tub_width*1/2)+tub_wall,tub_wall,height-(((tub_lid_depthinto-tub_divot_height)/2)+(tub_divot_height/2))])
       {
        mirror([0,1,0])
         {
          rotate([0,0,90])
           {
            #divot_sphere();
           }
         }
       }
//6
      translate([(tub_width*1/2)+tub_wall,tub_length+tub_wall,height-(((tub_lid_depthinto-tub_divot_height)/2)+(tub_divot_height/2))])
       {
        mirror([0,0,0])
         {
          rotate([0,0,90])
           {
            #divot_sphere();
           }
         }
       }
//end spheres

//begin locks

translate([(spacing/4)+(tub_width*1/4)+tub_wall,tub_length+tub_wall,basethickness+space_belowcage+(((tub_width-(spacing*3))/2)/2)])
{
#slidelock(spacing);
}

translate([(-spacing/4)+(tub_width*3/4)+tub_wall,tub_length+tub_wall,basethickness+space_belowcage+(((tub_width-(spacing*3))/2)/2)])
{
#slidelock(spacing);
}

translate([(spacing/4)+(tub_width*1/4)+tub_wall,tub_wall,basethickness+space_belowcage+(((tub_width-(spacing*3))/2)/2)])
{
mirror([0,1,0])
{
#slidelock(spacing);
}
}

translate([(-spacing/4)+(tub_width*3/4)+tub_wall,tub_wall,basethickness+space_belowcage+(((tub_width-(spacing*3))/2)/2)])
{
mirror([0,1,0])
{
#slidelock(spacing);
}
}

////upper lock rails



translate([(spacing/4)+(tub_width*1/4)+tub_wall,tub_length+tub_wall,cage_height+basethickness+space_belowcage-(((tub_width-(spacing*3))/2)/2)])
{
#slidelockupper(spacing);
}

translate([(-spacing/4)+(tub_width*3/4)+tub_wall,tub_length+tub_wall,cage_height+basethickness+space_belowcage-(((tub_width-(spacing*3))/2)/2)])
{
#slidelockupper(spacing);
}

translate([(spacing/4)+(tub_width*1/4)+tub_wall,tub_wall,cage_height+basethickness+space_belowcage-(((tub_width-(spacing*3))/2)/2)])
{
mirror([0,1,0])
{
#slidelockupper(spacing);
}
}

translate([(-spacing/4)+(tub_width*3/4)+tub_wall,tub_wall,cage_height+basethickness+space_belowcage-(((tub_width-(spacing*3))/2)/2)])
{
mirror([0,1,0])
{
#slidelockupper(spacing);
}
}



//end locks
}
}
////end tub module


//divider modules
module divider()
 {
  difference()
   {
    union()
     {
      cube(size=[spacing-1,spacing+cage_endwall+2,(spacing+cage_endwall+2)*2]);
      translate([0,0,(spacing+cage_endwall+2)*2])
       {
        rotate([0,45,0])
         {
          cube(size=[(sin(45)*(spacing-1)),spacing+cage_endwall+2,(sin(45)*(spacing-1))]);
         }
       }
     }
    translate([0,spacing+cage_endwall+2,-(((spacing+cage_endwall+2)/sin(45))/sin(45))/2])
     {
      rotate([45,0,0])
       {
        cube(size=[spacing-1,((spacing+cage_endwall+2)/sin(45)),((spacing+cage_endwall+2)/sin(45))]);       
       }
     }
   }
 }
//end divider module

//spacer module
module tub_spacer(length)
 {
translate([-(spacing-1),-length/2,0])
  {
  difference()
   {
    rotate([0,45,0])
     {
      cube(size = [((spacing-1)/sin(45)),length,((spacing-1)/sin(45))]);
     }
    translate([-(spacing-1)-0.1,0,-(spacing-1)])
     {
      #cube(size = [((spacing-1)/sin(45))/sin(45),length,((spacing-1)/sin(45))/sin(45)]);
     }
   }
 }
}
//end spacer

//divot
module divot_sphere()
{
difference()
{
translate([(tub_divot_height/2)/sin(45)*sin(45),0,0])
{
sphere(r = (tub_divot_height/2)/sin(45));
}
translate([(tub_divot_height/2)/sin(45),0,0])
cube(size = [((tub_divot_height/2)/sin(45)*2),((tub_divot_height/2)/sin(45)*2),((tub_divot_height/2)/sin(45)*2)], center=true);
}
}
//end divot module

////groove module

module grooves(tub_wallgroove,groove_width,groove_length,groove_height,groove_shift)
{
translate([((cos(45)*((groove_height/sin(45))+((groove_width*sin(45)*sin(45))/cos(45)))))-height/2,-.0001,height/2])
{
intersection()
{

intersection()
{
for(g = [(-(cos(45)*((groove_height/sin(45))+((groove_width*sin(45)*sin(45))/cos(45))))/groove_width/2) : (groove_length/groove_width/2)])
{
 translate([(g*groove_width*2)+(groove_width*sin(45)*sin(45)),0,groove_shift])
  {
  rotate([0,45,0])
   {
    rotate([0,0,45])
     {
      #cube(size = [groove_width*sin(45)*sin(45),groove_width*sin(45)*sin(45),((groove_height/sin(45))+((groove_width*sin(45)*sin(45))/cos(45)))+(abs(groove_shift/cos(45)*2))], center=true);
     }
   }
  }
}
translate([(-groove_height/2)-(groove_width*sin(45)*sin(45)),0,-groove_height/2])
{
#cube(size = [groove_length,tub_wallgroove,groove_height]);
}
}
translate([((-groove_height/2)-(groove_width*sin(45)*sin(45)))+(groove_length/2),0,0])
{
rotate([0,0,45])
{
cube(size = [groove_length*cos(45),groove_length*cos(45),groove_height],center=true);
}
}

 }//end intersection
}
}
////end groove mdoule

////begin eyelet module

module eyelet(od,id,eyelet_width,standoff)
{

translate([-eyelet_width/2,-(od/2)-standoff,-((od)+od)-standoff+(od/2)])//orgin set at the center of hole cylinder
{
difference()
   {
    union()
     {
      translate([0,standoff,standoff])
       {
        cube(size=[eyelet_width,od,(od/2)+od]);
       }
      translate([0,((od)/2)+standoff,((od/2)+od)+standoff])
       {
        rotate([0,90,0])
         {
          cylinder(r = od/2,h = eyelet_width, $fn=60);
         }
       }
      translate([0,0,0])
       {
        cube(size=[eyelet_width,(od/2)+standoff,((od)+od)+standoff]);
       } 
     }
    translate([-1,eyelet_width+2,-(((eyelet_width+2)/sin(45))/sin(45))/2])
     {
      rotate([45,0,0])
       {
        #cube(size=[eyelet_width+2,((od+standoff+2)/sin(45)),((eyelet_width+2)/sin(45))]);       
       }
     }
      translate([-1,((od)/2)+standoff,((od/2)+od)+standoff])
       {
        rotate([0,90,0])
         {
          cylinder(r = id/2,h = eyelet_width+2, $fn=60);
         }
       }

   }
  }
}

////end eyelet module

////calculations

echo("space above cages for extra fluid is", height-basethickness-space_belowcage-cage_height-tub_lid_depthinto);


echo("tub print area x",((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall);

echo("tub print area y",((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall);

echo("tub print area z",height);

echo("cage cavity y",((tub_width-(spacing*3))/2)-(cage_wall*2));

echo("cage cavity x",(tub_length-(spacing*2))-(cage_endwall*2));

echo("cage cavity z",cage_height-cage_base);

echo("powder volume per cage",((((tub_width-(spacing*3))/2)-(cage_wall*2)))/10*(((tub_length-(spacing*2))-(cage_endwall*2)))/10*(cage_height-cage_base-cage_lid_depthinto)/10,"cm3");

echo("grams nickle hydroxide per cage",(((((tub_width-(spacing*3))/2)-(cage_wall*2)))/10*(((tub_length-(spacing*2))-(cage_endwall*2)))/10*(cage_height-cage_base-cage_lid_depthinto)/10)*(4.10),"grams");//density is 4.10

echo("total grams nickle hydroxide",(((((tub_width-(spacing*3))/2)-(cage_wall*2)))/10*(((tub_length-(spacing*2))-(cage_endwall*2)))/10*(cage_height-cage_base-cage_lid_depthinto)/10)*(4.10)*(tubs_columns*tubs_rows),"grams");

echo(((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/tub_wallgroovewidth)-floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/tub_wallgroovewidth))*tub_wallgroovewidth)+tub_wallgroovewidth));

//2
echo((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth);

//3
echo((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth);

//2+3
echo(((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth)+((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth));

//(2+3)/absfloor
echo((2*tub_wallgroovewidth)*floor(((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth)+((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth))/(2*tub_wallgroovewidth))));

//3
echo((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth)+((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth))-((2*tub_wallgroovewidth)*floor(((((((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth)+((((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)-(2*tub_wallgroovewidth*floor(((((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall)-tub_wallgroovecorners)/(2*tub_wallgroovewidth))))-tub_wallgroovewidth))/(2*tub_wallgroovewidth)))));




//slidelocking module
module slidelock(spacing)
{
 difference()
  {
   translate([0,-spacing,0]) //translate all
    {

//left
     translate([-(spacing/(1-cos(45)))*cos(45),0,-(spacing/(1-cos(45)))*cos(45)])
      {
       rotate([0,0,45])
        {
         cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+spacing*2]);
        }//end rotate left
      }//end translate left

//right
      translate([(spacing/(1-cos(45)))*cos(45),0,-(spacing/(1-cos(45)))*cos(45)])
       {
        rotate([0,0,45])
         {
          cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+spacing*2]);
         }//end rotate right
       }//end translate right
//bottom
       translate([(-(spacing/(1-cos(45)))*cos(45))-spacing,0,-(spacing/(1-cos(45)))*cos(45)])
        {
         rotate([90,45,90])
          {
           cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+spacing*2]);
          }//end rotate bottom
        }//end translate bottom
//bump
        translate([(-(spacing/(1-cos(45)))*cos(45))-spacing,spacing*(2/5),((spacing/(1-cos(45)))*cos(45))-spacing*(2/5)])//set bump fraction
         {
          rotate([90,45,90])
           {
            cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+spacing*2]);
           }//end rotate bump
         }//end translate bump
       
     }//end translate all

//trim left
translate([(-(spacing/(1-cos(45)))*cos(45))-spacing,-spacing*2,(-(spacing/(1-cos(45)))*cos(45))-spacing-1])
{
rotate([0,0,45])
{
cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+(spacing*2)+spacing+2]);
}//end rotate left
}//end translate left

//trim right
translate([((spacing/(1-cos(45)))*cos(45))+spacing,-spacing*2,(-(spacing/(1-cos(45)))*cos(45))-spacing-1])
{
rotate([0,0,45])
{
cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+(spacing*2)+spacing+2]);
}//end rotate right
}//end translate right

//trim back
translate([0,((spacing/(1-cos(45)))*2)/2,spacing/2])
{
cube(size = [((spacing/(1-cos(45)))*2)+1,((spacing/(1-cos(45)))*2),((spacing/(1-cos(45)))*2)+spacing+1], center=true);
}

}//end difference
}///end slidelocking module

//slidelocking module
module slidelockupper(spacing)
{
 difference()
  {
   translate([0,-spacing,0]) //translate all
    {
//left
     translate([-(spacing/(1-cos(45)))*cos(45),0,-(spacing/(1-cos(45)))*cos(45)])
      {
       rotate([0,0,45])
        {
         cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+spacing*2]);
        }//end rotate left
      }//end translate left
//right
     translate([(spacing/(1-cos(45)))*cos(45),0,-(spacing/(1-cos(45)))*cos(45)])
      {
       rotate([0,0,45])
        {
         cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+spacing*2]);
        }//end rotate right
      }//end translate right
    }//end translate all
//trim left
   translate([(-(spacing/(1-cos(45)))*cos(45))-spacing,-spacing*2,(-(spacing/(1-cos(45)))*cos(45))-spacing-1])
    {
     rotate([0,0,45])
      {
       cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+(spacing*2)+spacing+2]);
      }//end rotate left
    }//end translate left
//trim right
   translate([((spacing/(1-cos(45)))*cos(45))+spacing,-spacing*2,(-(spacing/(1-cos(45)))*cos(45))-spacing-1])
    {
     rotate([0,0,45])
      {
       cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+(spacing*2)+spacing+2]);
      }//end rotate right
    }//end translate right
//trim back
   translate([0,((spacing/(1-cos(45)))*2)/2,spacing/2])
    {
     cube(size = [((spacing/(1-cos(45)))*2)+1,((spacing/(1-cos(45)))*2),((spacing/(1-cos(45)))*2)+spacing+1], center=true);
//trim bottom
       translate([0,(-((spacing/(1-cos(45)))*2)/2)-spacing,(-(spacing/(1-cos(45)))*cos(45))-1])
        {
         rotate([90,45,90])
          {
           #cube(size = [(spacing/sin(45)),(spacing/sin(45)),((spacing/(1-cos(45)))*cos(45)*2)+spacing*2],center=true);
          }//end rotate bottom
        }//end translate bottom
    }
  }//end difference
}///end slidelocking module


//divot by depth module
module divot_sphere_d()
 {
  translate([0,0,0])
   {
    difference()
     {
      translate([(spacing/(1-cos(45)))*sin(45),0,0])
       {
        sphere(r = (spacing/(1-cos(45))));
       }
      translate([(spacing/(1-cos(45))),0,0])
       {
        cube(size = [((spacing/(1-cos(45)))*2),((spacing/(1-cos(45)))*2),((spacing/(1-cos(45)))*2)], center=true);
       }       
     }
   }
 }
//end divot module


//divot by height
module divot_sphere()
{
difference()
{
translate([(tub_divot_height/2)/sin(45)*sin(45),0,0])
{
sphere(r = (tub_divot_height/2)/sin(45));
}
translate([(tub_divot_height/2)/sin(45),0,0])
cube(size = [((tub_divot_height/2)/sin(45)*2),((tub_divot_height/2)/sin(45)*2),((tub_divot_height/2)/sin(45)*2)], center=true);
}
}
//end divot

 

cage

  • added a little piece to pull on to remove from tub
height = 90;
tub_width = 38;
tub_length = 88;
basethickness = 5;
tub_wall = 2;
tub_outsidewall = 3;
tub_wallgroovedepth = 2;
tub_wallgroovewidth = 7.5;
tub_wallgroovecorners =6;
tub_wallgrooveshift = 0; //-0.5 1st try, messes up groove matchup
grooves_yn = 1; //1 yes 0 no

eyelets_rowside = 2;
eyelets_columnside = 3;

eyelets_belowtop = 10;
eyelets_walltoceneter = 5;
eyelets_od = 7;
eyelets_id = 3;
eyelets_width = 5;

tubs_rows    = 1;
tubs_columns = 1;

spacing = 1.940055;
space_belowcage=5;

cage_height = 65;
cage_wall = 7;
cage_endwall = 2;
cage_base = 4;

mesh_opening = 1.875 ;
mesh_angle = 50;
mesh_spacing = 4.1;

wire_diameter = 2;
wire_holeoffc = 0;
cage_lid_depthinto = 7;
cage_divot_height = 4;
tub_lid_depthinto = 7;
tub_divot_height = 5.5;

//*******************************************

//begin underlying cage module
module cage()
 {
  union()
   {
    difference()
     {
      cube(size = [(tub_width-(spacing*3))/2,tub_length-(spacing*2),cage_height], center=false);
//cut hole for powder to sit in
       translate([cage_wall, cage_endwall, cage_base])
        cube(size = [((tub_width-(spacing*3))/2)-(cage_wall*2)+0.001,(tub_length-(spacing*2))-(cage_endwall*2),cage_height-cage_base+1], center=false);
//cut rectangle hole for lid         
       translate([cage_endwall, cage_endwall, cage_height-cage_lid_depthinto])
        cube(size = [((tub_width-(spacing*3))/2)-(cage_endwall*2)+0.001,(tub_length-(spacing*2))-(cage_endwall*2),cage_lid_depthinto], center=false);

//cut angled hole for lid space
//should probably make angle match mesh angle
       translate([(((tub_width-(spacing*3))/2)/2), ((tub_length-(spacing*2))/2), cage_height-cage_lid_depthinto])
        rotate([0,45,0])
        cube(size = [(cos(45)*(((tub_width-(spacing*3))/2)-(cage_endwall*2)+0.001)),(tub_length-(spacing*2))-(cage_endwall*2),(cos(45)*(((tub_width-(spacing*3))/2)-(cage_endwall*2)+0.001))], center=true);         
         
     }
   }//end difference begin union
//side locking divots
//1
translate([((tub_width-(spacing*3))/2)/2,0,((tub_width-(spacing*3))/2)/2])
rotate([0,0,90])
divot_sphere_d();
//2
translate([((tub_width-(spacing*3))/2)/2,0,cage_height-(((tub_width-(spacing*3))/2)/2)])
rotate([0,0,90])
divot_sphere_d();
//3
translate([((tub_width-(spacing*3))/2)/2,tub_length-(spacing*2),((tub_width-(spacing*3))/2)/2])
rotate([0,0,270])
divot_sphere_d();
//4
translate([((tub_width-(spacing*3))/2)/2,tub_length-(spacing*2),cage_height-(((tub_width-(spacing*3))/2)/2)])
rotate([0,0,270])
divot_sphere_d();

//end side locking divots
   
//begin puller

translate([0,0,cage_height])
puller(6,2,2);

translate([0,(tub_length-(spacing*2))-cage_endwall,cage_height])
puller(6,2,2);

 }//end union
//end cage
     
//begin mesh hole grid module
module holes()
 {
intersection()
{
translate([0,-(sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening))),0])
cube([cage_wall+0.2,1+((((tub_length-(spacing*2))-(cage_endwall*2)))),cage_height], center=false);


//need to translate closer to the cube here with llarge holes

translate([0,0,-mesh_spacing])
{

rotate([0,-mesh_angle,0])

scale([1,1,(sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))/(((sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))/sin(90-mesh_angle))*sin(90))])
{
//for - pair of rows to height
//could simplify
  for (h = [1 : floor((((cage_height-cage_base-((((((sin(90)*(cage_wall/sin(90-mesh_angle))))-((sin(mesh_angle)*((sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))/(sin(90))))))/sin(90))*sin(mesh_angle)))))-cage_lid_depthinto)/mesh_spacing)])
   {
    translate(h*[0,0,mesh_spacing])
{

//for - second row

 for (w = [1 : floor((((tub_length-(spacing*2))-(cage_endwall*2))-(sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening))))/mesh_spacing)])
        {
//translate second row
         translate([0,-mesh_spacing/2,mesh_spacing/2])
           {
//make second row copies
            translate(w*[0,mesh_spacing,0])
             {
              rotate([45,0,0])
               {
    cube(size = [(cage_wall*2)+(cage_height/sin(90))*sin(mesh_angle),mesh_opening,mesh_opening], center=false);

               }
             }
           }
         }

//for - create first row
for (w = [0 : floor((((tub_length-(spacing*2))-(cage_endwall*2))-(sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening))))/mesh_spacing)])

             {
              translate(w*[0,mesh_spacing,0])

 {
  rotate([45,0,0])
   { 
//need to tweak
    cube(size = [(cage_wall*2)+(cage_height/sin(90))*sin(mesh_angle),mesh_opening,mesh_opening],center=false);
   }
 }
}
}
}
}
////end cube
}
}
}
////end mesh hole grid module

//////divot
module divot_sphere()
{
difference()
{
translate([(cage_divot_height/2)/sin(45)*sin(45),0,0])
{
sphere(r = (cage_divot_height/2)/sin(45));
}
translate([(cage_divot_height/2)/sin(45),0,0])
cube(size = [((cage_divot_height/2)/sin(45)*2),((cage_divot_height/2)/sin(45)*2),((cage_divot_height/2)/sin(45)*2)], center=true);
}
}
////end divot module

//begin final cage construction
difference()
 {
  cage();
//begin holes
  translate([(((tub_width-(spacing*3))/2)-cage_wall)+0.0, cage_endwall+((sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))/2)+(((((tub_length-(spacing*2))-(cage_endwall*2))-(((floor((((tub_length-(spacing*2))-(cage_endwall*2))-(sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening))))/mesh_spacing))*mesh_spacing)+sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))))/2), cage_base])
   {
    holes();
   }
    translate([(cage_wall)-0.0,cage_endwall+((sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))/2)+(((((tub_length-(spacing*2))-(cage_endwall*2))-(((floor((((tub_length-(spacing*2))-(cage_endwall*2))-(sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening))))/mesh_spacing))*mesh_spacing)+sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))))/2), cage_base])
   {

  mirror([1,0,0])
     {
      #holes();
     }
   }
//end holes

//begin divots

//1
      translate([cage_endwall,(((tub_length-(spacing*2))-(cage_endwall*2))*1/4)+cage_endwall,cage_height-(((cage_lid_depthinto-cage_divot_height)/2)+(cage_divot_height/2))])
       {
        #divot_sphere();
       }
//2
      translate([cage_endwall,(((tub_length-(spacing*2))-(cage_endwall*2))*3/4)+cage_endwall,cage_height-(((cage_lid_depthinto-cage_divot_height)/2)+(cage_divot_height/2))])
       {
        #divot_sphere();
       }
//3
      translate([cage_endwall+(((tub_width-(spacing*3))/2)-(cage_endwall*2)),(((tub_length-(spacing*2))-(cage_endwall*2))*1/4)+cage_endwall,cage_height-(((cage_lid_depthinto-cage_divot_height)/2)+(cage_divot_height/2))])
       {
        mirror([1,0,0])
         {
          #divot_sphere();
         }
       }
//4
      translate([cage_endwall+(((tub_width-(spacing*3))/2)-(cage_endwall*2)),(((tub_length-(spacing*2))-(cage_endwall*2))*3/4)+cage_endwall,cage_height-(((cage_lid_depthinto-cage_divot_height)/2)+(cage_divot_height/2))])
       {
        mirror([1,0,0])
         {
          #divot_sphere();
         }
       }
//end divots
 }
//end cage

//divot by depth module
module divot_sphere_d()
 {
  translate([0,0,0])
   {
    difference()
     {
      translate([(spacing/(1-cos(45)))*sin(45),0,0])
       {
        sphere(r = (spacing/(1-cos(45))));
       }
      translate([(spacing/(1-cos(45))),0,0])
       {
        cube(size = [((spacing/(1-cos(45)))*2),((spacing/(1-cos(45)))*2),((spacing/(1-cos(45)))*2)], center=true);
       }       
     }
   }
 }
//end divot module

//puller module
 
module puller(height_above, hole, thickness)
difference()
{

hull()
     {


  cube(size= [((tub_width-(spacing*3))/2),cage_endwall,0.5], center=false);
  translate([((tub_width-(spacing*3))/2)/2,0,height_above-thickness])
     rotate([270,0,0])
     cylinder(r=thickness,h=cage_endwall,$fn=50);     
 }
  translate([((tub_width-(spacing*3))/2)/2,-1,height_above-thickness])
     rotate([270,0,0])
     cylinder(r=hole/2,h=cage_endwall+2,$fn=50); 

}

//calculate mesh wall minimum thickness
echo(sin(45)*((mesh_spacing-((sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))))/sin(90)));


//calculate verticle height of mesh holes to take away from max height of holes
//works okay up to 45 then bugs out. might be because its before the scale down
echo((((((sin(90)*(cage_wall/sin(90-mesh_angle))))-((sin(mesh_angle)*((sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))/(sin(90))))))/sin(90))*sin(mesh_angle)));



echo("cage cavity y",((tub_width-(spacing*3))/2)-(cage_wall*2));

echo("cage cavity x",(tub_length-(spacing*2))-(cage_endwall*2));

echo("cage cavity z",cage_height-cage_base);

echo("powder volume per cage",((((tub_width-(spacing*3))/2)-(cage_wall*2)))/10*(((tub_length-(spacing*2))-(cage_endwall*2)))/10*(cage_height-cage_base-cage_lid_depthinto)/10,"cm3");

echo("grams nickle hydroxide per cage",(((((tub_width-(spacing*3))/2)-(cage_wall*2)))/10*(((tub_length-(spacing*2))-(cage_endwall*2)))/10*(cage_height-cage_base-cage_lid_depthinto)/10)*(4.10),"grams");//density is 4.10

echo("total grams nickle hydroxide",(((((tub_width-(spacing*3))/2)-(cage_wall*2)))/10*(((tub_length-(spacing*2))-(cage_endwall*2)))/10*(cage_height-cage_base-cage_lid_depthinto)/10)*(4.10)*(tubs_columns*tubs_rows),"grams");

//calculate mesh wall minimum thickness
echo("mesh dividers thickness",sin(45)*((mesh_spacing-((sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening)))))/sin(90)));