by flummer, published
This is a battery box designed as a module in OpenSCAD, that allows you to make a holder for 1 to as many as you like (or your OpenSCAD installation will want to compile)
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.