I am trying to find the open spaces given list of rectangles. So a base rectangle of a given size has rectangles placed down on it covering space the now open spaces that are not covered by the recently placed rectangles make new rectangles I am trying to find those.
I want to create an algorithm to find those open space rectangles. Any pointer would be greaterly appreciated.
Below are some examples I am trying to reproduce algorithmicaly.
First example:
Second example:
Third example :


