Texture on dynamically created object

I agree with @Mugen87.

It is not easy at first to generate such data correctly. But I myself was just interested in it and it is possible with some commitment. The exercise does it then.

An example for such calculations in my addon
Addon to create special / extended geometries
see e.g.
https://github.com/hofk/THREEg.js/blob/42dfd7a44ea6a327e0164466ad7c04f14b4c9a12/THREEg.js from line 435, 1779 …

see also
https://hofk.de/main/threejs/sandboxthreeg/
https://github.com/hofk/THREEg.js
https://hofk.de/main/threejs/sandboxthreeg/MagicSphereTHREEg.html