User:Dorkmo/Ideas/Battery/SCAD/201509
< User:Dorkmo | Ideas | Battery | SCAD
Jump to navigation
Jump to search
tub
height = 90; tub_width = 72; tub_length = 70; basethickness = 5; tub_wall = 2; tub_outsidewall = 6; tub_wallgroovedepth = 2.5; tub_wallgroovewidth = 12; tub_wallgroovecorners =5; 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; wall_spacers_yn = 0; //1 yes 0 no center_dividers = 0; //1 yes 0 no cage_height = 60; cage_wall = 5.5; cage_endwall = 2; cage_base = 5; mesh_opening = 1.5 ; mesh_angle = 45; mesh_spacing = 3.5; wire_diameter = 2; wire_holeoffc = 0; cage_lid_depthinto = 7; cage_divot_height = 5.5; 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_outsidewall+tub_wall,0]) { difference() { cube(size = [((tub_width+tub_wall)*tubs_rows)+(tub_outsidewall*2)-tub_wall,((tub_length+tub_wall)*tubs_columns)+(tub_outsidewall*2)-tub_wall,height]); translate([tub_outsidewall,tub_outsidewall,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)); } } //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))))); } } //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))))); } } ////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+tub_wall)*tubs_columns)+(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,tub_wall,basethickness]) { cube(size = [tub_width, tub_length, height-basethickness+1], center=false); } } //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+spacing+(((tub_width-(spacing*3))/2)/2)]) { #slidelock(spacing); } translate([(-spacing/4)+(tub_width*3/4)+tub_wall,tub_length+tub_wall,basethickness+spacing+(((tub_width-(spacing*3))/2)/2)]) { #slidelock(spacing); } translate([(spacing/4)+(tub_width*1/4)+tub_wall,tub_wall,basethickness+spacing+(((tub_width-(spacing*3))/2)/2)]) { mirror([0,1,0]) { #slidelock(spacing); } } translate([(-spacing/4)+(tub_width*3/4)+tub_wall,tub_wall,basethickness+spacing+(((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+spacing-(((tub_width-(spacing*3))/2)/2)]) { #slidelockupper(spacing); } translate([(-spacing/4)+(tub_width*3/4)+tub_wall,tub_length+tub_wall,cage_height+basethickness+spacing-(((tub_width-(spacing*3))/2)/2)]) { #slidelockupper(spacing); } translate([(spacing/4)+(tub_width*1/4)+tub_wall,tub_wall,cage_height+basethickness+spacing-(((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+spacing-(((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-spacing-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); } }//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