Every few months I decide I need to use a honeycomb-type arrangement of something-or-other. Today it was holes to fit a bunch of CR2032 cells. I usually grab a piece of paper and figure out the spacing all over again - I know I have a dozen or more programs in various languages that do it, but I never can seem to find one, so I decided to document it here. Maybe mostly for me :-)

If you remember one thing, it's that the row spacing is sqrt(3)/2 * the column spacing. Every other row is offset by 1/2 the column spacing, which causes the staggering of adjacent rows. A diagram is easier to visualize:

Using this, it's pretty easy to perforate a flat sheet with honeycombed holes in OpenSCAD:
// coin cell honeycomb separator
cell_dia = 20.5;
thickness = 2.0;
dx = 22;
length = 5*dx;
width = 3*sqrt(3)*dx;
epsilon = 0.1;
module spacer(){
difference(){
translate([-length/2, -width/2, 0]){
cube([length, width, thickness]);
}
for (i = [-5:5]){
for (j = [-5:5]){
x = dx * i - dx * (j % 2) / 2;
y = dx * (sqrt(3)/2 * j);
translate([x, y, -epsilon]){
cylinder(d = cell_dia, h = thickness + 2*epsilon);
}
}
}
}
}
spacer();
%translate([length, 0, 0]) spacer();
%translate([0, width, 0]) spacer();
%translate([length, width, 0]) spacer();
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.