Implemented connect_2d_shapes for polygons