3D-printed holder for magnetic spheres built with OpenSCAD

When I built the low-cost and precise rotary encoder with magnetic spheres I used 21 spheres because they fitted nicely in the other parts of the build I had around.

However, if an arbitrary number of spheres is to be used then an appropriate holder must be built.