How can I group an array of rectangles into "Islands" of connected regions?
- by Eric
The problem
I have an array of java.awt.Rectangles. For those who are not familiar with this class, the important piece of information is that they provide an .intersects(Rectangle b) function.
I would like to write a function that takes this array of Rectangles, and breaks it up into groups of connected rectangles.
Lets say for example, that…