From a vtk self intersected polydata, I would like to separate it into multiple polygons.
Note that intersections in the initial polygon can be detected from duplicate points in the list of points that form the polygon.
Get the test file from a wget https://thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds/brocksce/tmp/poly_11.vtk
then
import pyvista as pv
a = pv.read('poly_11.vtk')
pl = pv.Plotter()
pl.add_mesh(a)
viewer = pl.show(jupyter_backend='trame', return_viewer=True)
display(viewer)
In fact I would like to describe its coordinates anti-clockwise as requested by the matplotlib path structure.
A solution could be to separate the polydata into 2 convex polygons then use the shapely orient function as needed (https://shapely.readthedocs.io/en/stable/manual.html?highlight=orient#shapely.geometry.polygon.orient).
So how to have 2 convex polygons from this set of lines (polydata) ?