Text this: Design of dams for percolation and erosion