Skeletization of polygonal figure