I needed a battery holder that could be screw mounted on a little robot and decided to design one that could be 3D printed.I have put comments in the OpenSCAD code, so if you want to modify things, it should be relatively easy to find the right spots to edit.If all you want to change is the number of cells, simply call the module with a different argument.
Technical
This battery box is designed for AA batteries using a little clip from Keystone Electronics (part number 5209).
I got them from DigiKey
You will need two of these for each cell in the holder.
In addition, you will also need some relatively thin wire, to connect the cells on the back, and some wire to connect the battery box to your load.