Given any number of intersection, disjoint and touching rectangles, how to find the (multiple) outline polylines? Rectangles are defined in pixel coordinates so they have integer accuracy, but they may be thousands of units large.
I really need numeric coordinates for the outlines, merging GDI regions won't do. I know I can simplify the problem by creating a GDI region and calling GetRegionScans, but it still won't solve the problem.
This is part of real-time UI, so the algorithm needs to be reasonably fast (I'm guessing never more than a dozen or so boxes, maybe a hundred).
I'm doing this in C#, but since this is an algorithmic question I don't really care about language. Any ideas most welcome.
I have no idea if this satisfies your performance requirements, but it should work:
The resulting set contains all the lines that make up the outline.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With