Q:

Check if circles completely cover an area

Starting with an arbitrary rectangle, a user can place any number of circles within.
The circles are allowed to overlap each other without restrictions.
The circles can be of different sizes.
What would be the best way to test if the rectangle is completely covered by the circles?

A:

I eventually found that the simplest solution (for me anyway) in both JS and Objective-C was to simply iterate of over each pixel and check for the colour (assuming circles are coloured) and check if it was the colour of a circle (or it's border). As soon as a colour from a circle was found then iteration stops as the area is obviously not fully covered by the shapes.
The advantage to this solution is that the actual shape doesn't matter (we ended up adding other shapes also).

