Kivented

Not necesserally expecting you to merge this - just a PR showing current diff between my kivented version and the gl_polygon branch it is forked from. Segments are created correctly here.