//length regular beer bottle of 330cc is 238mm //diameter regular 330cc beer bottle is 61mm holesDia = 63; // hole vertical_holes=3; horizontal_holes =3; sides=2; //sides thickness in mm in_between=sides; //distance between bottle holes in mm bottom=4; //thickness of the bottom in mm xSize = horizontal_holes*(holesDia+sides)+1*sides; // width of the bottle box ySize = vertical_holes*(holesDia+sides)+1*in_between; // height of the bottle box zSize = 180; //depth of the bottle box //width of the box (same as height for 3x3 bottle box) is 3x63+4x2mm=197mm fn=96; /* [Hidden] */ holes_big_Rad = holesDia*0.5; holes_small_Rad=holesDia*0.3; // preview[view:south, tilt:top diagonal] baseSize = [xSize, ySize, zSize]; include module texts(){ translate([-xSize/2+10,ySize/2-1.5,zSize/2-8])rotate([90,180,180]) { linear_extrude(3) text(" Jantec.nl", font = "Liberation Sans:style=Bold Italic", size=20);} } module horizontal_holes_cutouts(){ repeat=zSize/holesDia; //repeat=2; for ( ii = [0 : horizontal_holes-1] ){// number counter for ( i = [0 : repeat-1] ){//number counter x= ((-horizontal_holes/2)+1)*(holesDia+sides)+i*(holesDia+sides); y= ((-zSize/2)+holesDia*0.8+sides)+i*(holesDia+sides); z= (-zSize/2)+holesDia*0.68+sides+((holesDia+sides)*ii); // horizontal holes translate([y,z-20,x]) rotate([90,0,90]) cylinder(r = holes_big_Rad*0.8, h = zSize*20, center=true, $fn=4 ); }} for ( ii = [0 : vertical_holes-1] ){// number counter for ( i = [0 : repeat-1] ){//number counter x= ((-horizontal_holes/2)+0.5)*(holesDia+sides)+ii*(holesDia+sides); y= ((-vertical_holes/2)+1)*(holesDia+sides)+i*(holesDia+sides); z= (-zSize/2)+holesDia*0.8+sides+((holesDia+sides)*ii); // vertical holes are OK translate([x,z,y]) rotate([90,0,0]) cylinder(r = holes_big_Rad*0.8, h = zSize*20, center=true, $fn=4 ); //cube([holes_big_Rad, zSize*20+0.1, holes_big_Rad] , center=true ); }}} module centerholes(holes_size,holes_offset, holes_bottom) { for ( ii = [0 : horizontal_holes-1] ){ for ( i = [0 : vertical_holes-1] ){ translate([((-horizontal_holes/2)+0.5)*(holesDia+sides)+ii*(holesDia+sides),((-vertical_holes/2)+0.5)*(holesDia+sides)+i*(holesDia+sides),holes_bottom]) // hole. center the lot as follows: 1st hiole is centered and OK. If you have 5 horizontal holes, you need to get the 3rd centered which is 2 holes and 2 in_betweens away. so it is 2/5*xSize to subtract here cylinder(r = holes_size, h = zSize+0.1, $fn = fn, center=true );}} } module makeBase() { difference () { translate([0, 0, 0]) // cube(center = true,size = [xSize, ySize, zSize] ); roundedBox(baseSize, radius = 4, sidesonly = 0, $fn = fn); centerholes(holes_big_Rad,sides, bottom); centerholes(holes_small_Rad,0,0); horizontal_holes_cutouts(); }texts(); } makeBase(); //centerholes();