I wanted a small box to hold a few pills that would keep them clean and safe from crushing. But this box could be used for anything small with some adjustments to the cavity shape. The lid uses a dovetail joint for tightness and fit tolerance.
This model is fully parametric, but some of the parameters need some work so that the adjusted box always works. Some of the walls may be thicker than necessary.
The first design holds 4 pills in two stacks. The second design holds 5 pills on their edge instead.
The second version of the lid has a square indention (which bridges nicely) to make opening the box easier.
The outside dimensions of the two boxes are identical.
The box size and pill cavity can be adjusted. If the lid is loose, that can be adjusted too, see comments in the openscad file.
File the mating surfaces of the box top and lid to give a smooth tight fit.
This was originally printed on a low resolution printer with a plastic that was easy to aggressively file down sharp corners. Since OpenSCAD doesn't (yet) have a good bevel function, I beveled the edges in blender and have uploaded the resulting STL.
Soon I'll update the lid to improve the fit and deepen the detent so it isn't printer resolution dependant.