compute hull of polygons