extended and cleaned mesh generation code

modularised stuff, generates cylinders of any order >= 3