basic flood fill to generate the mesh