Merge (Boolean Union) rectangular areas with integer precision

Given any number of intersections, disjoint, and touching rectangles, how do I find (multiple) contour polylines? Rectangles are defined in pixel coordinates, so they have integer precision, but they can be thousands of units.

Box collection

I really need the numerical coordinates for the contours; there will be no merging of the GDI regions. I know that I can simplify this problem by creating a GDI scope and calling GetRegionScans, but it still will not solve the problem.

This is part of the real-time user interface, so the algorithm should be fast enough (I assume that there are no more than a dozen or so boxes, maybe hundreds).

#, , . .

+5
1

, , :

  • .
  • . , , , .
  • .
  • , .

, .


      Illustration

+4

All Articles