fixed handling convex polygons