My question is similar to question here Divide self-intersecting polygon
I have points of self-intersecting polygon, its edges and also I am able to find points where it intersects.
I have to divide it into simple polygons and tessellate them later.
I have an issue how we currently select the edge after the intersection point is encountered. Right now we select an intersecting-edge which makes the smallest angle with the preceding edge. This approach simplifies some intersecting loops (e.g. horizontal '8' is divided into two 'o' loops).
But this approach has some issue. Say two polygons one inside another. Such polygons are not divided into two loops.
I plan to select an intersecting-edge which makes the largest angle with the preceding edge. This way I can get the outermost loop first and than I will form the internal loops with remaining edges. This will solve the problem for 'two polygons one inside another'. (This will fail for cases such as 'horizontal '8''. But this is OK as such case is handles while tessellating polygon)
Are there any known/unforeseen problems with this approach?