Yet another customizable bearing

This is actually my yesterday's evening-hack. It's redundant, because there are many bearings in thingiverse and it's of no use because I have loads of proper cheap Chinese metal bearings of different sizes and I guess that you have some, too. I just made ist to distract me from some other project, a heat-exchanger. Anyway, I share it for fun. Maybe someone likes the look of my rounded edges or maybe someone gets some inspiration from the code, like not to work with the basic object directives so much when constructing objects but to increase use of linear_extrude() and rotate_extrude() with parameterized polygons stuck together with concat(). A good practice could be changing the function kreislinie(), that returns the 2D-points of an arc, so that start- and end-angle can be overwritten by start- and end-height,
This is also an experiment to give Error messages and Object-Information to the user via text-output in customizer. Unfortunately newline-characters aren't rendered as such, so lines may get too long. Disable the option view_sectioned before you create your stl. It's default is yes, because you should use it first, to check if everything looks good inside. Try view_info in the in the Design-Check tab to see the overhang-angle of the chamfer to adjust your slicer not to support this overhang but the balls.
The "au" setting reduces the number ob balls by virtually enlarging the balls by this percentage and looking up the value of the largest inner circle that smaller than the diameter of this inner circle. Don't set this too high, as the bearing may then fall apart if all the balls are one one side.
I haven't made a good print of this, yet. The balls I print (avoiding the phrase "my ..") are too much the shape of a pill. For me, balls are generally something difficult to print I'll try less infill or less heatbed, next time. Of course it's best practice to find printing parameters that create good balls, but itt maybe interesting, to experiment with the shape of the balls, anyway. Please give me advice in the comments if you know more about printing balls, than me.
So next step will be to make the shape of the balls customizable using rotate_extrude with a parametrized polygon, so I (or you) can try any instance of cylinder with rounded corners including ball, oval and cylinder.

See also:
http://www.thingiverse.com/thing:40559

History:
2016-07-28: Initial hack
2016-07-29: Published it.
2016-07-30: Changed the recursive lookup-function, that searches a given inner diameter and finds the corresponding number of surrounding circles, to a function that calculates the value.
Before:
V_innerradiusses = [ for(i=[0:1:100]) ((i>2)?(sqrt(1+sqr(tan(90-(360/i/2))))-1):0) ];
function findbiggestsmaller(V, x, i) = (V[i+1] > x) ? i : findbiggestsmaller(V, x, i+1);
Now:
function balls_by_ri(ri,rb) = round((180/(90-atan(sqrt(sqr((ri/rb+1))-1))))-0.5);