polygons.smooth: refactor, cleanup gap generation