Hi
In my first development attempt I successfully implemented an algorithm that extracted the minimum path loops first. It worked very well but soon realized that the condition had very common ill cases:
In the above figure, the minimum path for the outer loops overlaps the inner loop, causing messed geometry in latter stages of the pipeline:
Filled loops should not overlap , but that term is a bit tricky because we are talking of 3D meshes so some sort of projection or volume intersection test needs to be implemented, and we all know those arbitrary precision intersection mesh calculations are very heavy for close to real-time performance.
I eventually found a very elegant solution: Filled contour areas, non overlapping adjacent contours have minimum area compared to the overlapped ones, In terms of a Set theory, overlapping is equivalent to a Union and non overlapping to a Difference.
And that’s it! after implement that condition, arbitrary graph sets can be decomposed in minimum area loops or adjacent non overlapping sets.