I am trying to find the polygons formed by line segments as shown in the below image. I have tried using Shapely\'s polygonize() function, but it seems to fail in certain si