User:Dorkmo/Ideas/Battery/SCAD: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:




===inside cage===
==inside cage==
  <nowiki>
  <nowiki>


Line 135: Line 135:


  </nowiki>
  </nowiki>
===cage lid with divots and cleat===
==cage lid with divots and cleat==


  <nowiki>
  <nowiki>
Line 304: Line 304:
  </nowiki>
  </nowiki>


===single cell tub===
==single cell tub==


  <nowiki>
  <nowiki>

Revision as of 18:32, 16 November 2014

User:Dorkmo/Ideas/Battery/SCAD/Sandbox


inside cage


height = 80;
tub_width = 65;
tub_length = 70;
outsidewall = 5;
basethickness = 5;
tub_wall = 5;

spacing = 5;
cage_height = 60;
cage_wall = 7.5;
cage_endwall = 2;
cage_base = 5;
wedge_hieght = 10;

mesh_opening = 1 ;
mesh_angle = 45;
mesh_spacing = 2.5;


//begin underlying cage module
module cage()
 {
  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),(tub_length-(spacing*2))-(cage_endwall*2),cage_height-cage_base+1], center=false);
   }
 }
//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

  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))))-(sqrt((mesh_opening*mesh_opening)+(mesh_opening*mesh_opening))))/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

//begin final cage construction
difference()
 {
  cage();
  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 cage


//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)));



 

cage lid with divots and cleat

height = 80;
tub_width = 65;
tub_length = 70;
outsidewall = 5;
basethickness = 5;
tub_wall = 5;

spacing = 5;
cage_height = 60;
cage_wall = 7.5;
cage_endwall = 2;
cage_base = 5;
wedge_hieght = 10;

mesh_opening = 1 ;
mesh_angle = 45;
mesh_spacing = 2.5;

wire_diameter = 2;
wire_holeoffc = 0;
lid_depthinto = 7;
divot_height = 5.5;

union()
 {
  difference()
   {
    union()
     {
      cube(size = [((tub_width-(spacing*3))/2)-(cage_wall*2),(tub_length-(spacing*2))-(cage_endwall*2),lid_depthinto], center=false);
      translate([-1,-1,lid_depthinto])
       {
        cube(size = [(((tub_width-(spacing*3))/2)-(cage_wall*2))+2,((tub_length-(spacing*2))-(cage_endwall*2))+2,2], center=false);
       }
//spheres lock ins
//1
      translate([0,((tub_length-(spacing*2))-(cage_endwall*2))*1/4,((lid_depthinto-divot_height)/2)+(divot_height/2)])
       {
        divot_sphere();
       }
//2
      translate([0,((tub_length-(spacing*2))-(cage_endwall*2))*3/4,((lid_depthinto-divot_height)/2)+(divot_height/2)])
       {
        divot_sphere();
       }
//3
      translate([((tub_width-(spacing*3))/2)-(cage_wall*2),((tub_length-(spacing*2))-(cage_endwall*2))*1/4,((lid_depthinto-divot_height)/2)+(divot_height/2)])
       {
        mirror([1,0,0])
         {
          divot_sphere();
         }
       }
//4
      translate([((tub_width-(spacing*3))/2)-(cage_wall*2),((tub_length-(spacing*2))-(cage_endwall*2))*3/4,((lid_depthinto-divot_height)/2)+(divot_height/2)])
       {
        mirror([1,0,0])
         {
          divot_sphere();
         }
       }
//end spheres



     }
//end union begin difference
  translate([1,1,1])
   {
    cube(size = [((tub_width-(spacing*3))/2)-(cage_wall*2)-2,(tub_length-(spacing*2))-(cage_endwall*2)-2,lid_depthinto+3], center=false);
   }
//chamfer underside of lip
  translate([-2,-1,lid_depthinto-1])
   {
    rotate([45,0,0])
     {
      cube(size = [(((tub_width-(spacing*3))/2)-(cage_wall*2))+4,sqrt(2),sqrt(2)], center=false);
     }
   }
  translate([-2,(tub_length-(spacing*2))-(cage_endwall*2)+1,lid_depthinto-1])
   {
    rotate([45,0,0])
     {
      cube(size = [(((tub_width-(spacing*3))/2)-(cage_wall*2))+4,sqrt(2),sqrt(2)], center=false);
     }
   }
  translate([-1,-2,lid_depthinto-1])
   {
    rotate([45,0,90])
     {
      cube(size = [((tub_length-(spacing*2))-(cage_endwall*2))+4,sqrt(2),sqrt(2)], center=false);
     }
   }
  translate([(((tub_width-(spacing*3))/2)-(cage_wall*2))+1,-2,lid_depthinto-1])
   {
    rotate([45,0,90])
     {
      cube(size = [((tub_length-(spacing*2))-(cage_endwall*2))+4,sqrt(2),sqrt(2)], center=false);
     }
   }
//end chamfer
//begin wire hole
  translate([((((tub_width-(spacing*3))/2)-(cage_wall*2)))/2,(((tub_length-(spacing*2))-(cage_endwall*2))*1/2),-1])
   {
    cylinder(r = wire_diameter/2, h = 3);
   }
//end wire hole
//end difference
 }
//begin union

//cleat
    translate([((((tub_width-(spacing*3))/2)-(cage_wall*2)))/2,(((tub_length-(spacing*2))-(cage_endwall*2))*1/2)-(wire_diameter*1.5)-1+wire_holeoffc,0])
     {
      cleat(2,lid_depthinto+2);
     }
    translate([((((tub_width-(spacing*3))/2)-(cage_wall*2)))/2,(((tub_length-(spacing*2))-(cage_endwall*2))*1/2)+(wire_diameter*1.5)+1+wire_holeoffc,0])
     {
      mirror([0,1,0])
       {
        cleat(2,lid_depthinto+2);
       }
     }
//end cleat
}


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

////cleat module
module cleat(size,height)
 {
  translate([0,0,-size])
  {
  difference()
   {
    rotate([45,0,0])
     {
      rotate([0,0,45])
       {
        cube(size = [size,size,height/sin(45)], center=false);
       }
     }
    translate([-size*3/2,-size*3/2,0])
     {
      #cube(size = [size*3,size*3,size],center=false);
     }
   }
 }
}


 

single cell tub

height = 60;
oa_width = 80;
oa_length = 105;
outsidewall = 5;
basethickness = 5;
membranethickness = 5;
tub_wall = 5;

spacing = 5;
cage_height = 40;
cage_wall = 10;
cage_base = 5;

difference()
	{
		cube(size = [oa_width, oa_length, height], center=false);
		translate([outsidewall,outsidewall,basethickness])
			cube(size = [oa_width-(outsidewall*2), oa_length-(outsidewall*2), height-basethickness], center=false);
	}