I have list of closed curves with different z values. Some of the curves intersects each other when projected to xy plane. Every curve has only one z-value. In the areas where curves intersects in xy-plane I wan to do region difference to trim the curve with bigger z value with the curve with smaller z value.
I was thinking to project all the curves to the xy-plane, do the region difference there and then move the trimmed curves back to their original elevation. I think I need to some kind of loop to first test the region difference with the lowest curve and all the other curves and then test with the second lowest curve and all he remaining curves and so on. Any help with the loop?
Here is example of the situation. In the real situation there would be more curves and not all will intersect with anything. And some of them will intersect with multiple curves.






