Algorithm to fill shapes.