Lilly pad and foam pattern algorithm