A computer-implemented method for civil engineering, the method comprising: - providing a mesh representing a terrain; and - computing a watershed segmentation of the terrain based on the mesh, the computing of the watershed segmentation including: ∘ identifying one or more saddle points on the mesh, at least one of the identified one or more saddle points being a degenerate saddle point; and ∘ for each identified saddle point, identifying: ▪ paths each ascending from the saddle point according to a direction of a local maximal slope around the saddle point, and ▪ a path descending from the saddle point according to a direction of a steepest slope around the saddle point, the identified ascending paths dividing the mesh into connected components, each connected component being a connected part of the mesh bounded by two identified ascending paths and comprising no other identified ascending path; and ∘ for each identified saddle point, merging each connected component of which bottom point is the saddle point with a connected component comprising the identified path descending from the saddle point according to a direction of a steepest slope around the saddle point, the merging yielding at least a part of a basin. - providing a mesh representing a terrain; and - computing a watershed segmentation of the terrain based on the mesh, the computing of the watershed segmentation including: ∘ identifying one or more saddle points on the mesh, at least one of the identified one or more saddle points being a degenerate saddle point; and ∘ for each identified saddle point, identifying: ▪ paths each ascending from the saddle point according to a direction of a local maximal slope around the saddle point, and ▪ a path descending from the saddle point according to a direction of a steepest slope around the saddle point, the identified ascending paths dividing the mesh into connected components, each connected component being a connected part of the mesh bounded by two identified ascending paths and comprising no other identified ascending path; and ∘ for each identified saddle point, merging each connected component of which bottom point is the saddle point with a connected component comprising the identified path descending from the saddle point according to a direction of a steepest slope around the saddle point, the merging yielding at least a part of a basin. ∘ identifying one or more saddle points on the mesh, at least one of the identified one or more saddle points being a degenerate saddle point; and ∘ for each identified saddle point, identifying: ▪ paths each ascending from the saddle point according to a direction of a local maximal slope around the saddle point, and ▪ a path descending from the saddle point according to a direction of a steepest slope around the saddle point, the identified ascending paths dividing the mesh into connected components, each connected component being a connected part of the mesh bounded by two identified ascending paths and comprising no other identified ascending path; and ▪ paths each ascending from the saddle point according to a direction of a local maximal slope around the saddle point, and ▪ a path descending from the saddle point according to a direction of a steepest slope around the saddle point, ∘ for each identified saddle point, merging each connected component of which bottom point is the saddle point with a connected component comprising the identified path descending from the saddle point according to a direction of a steepest slope around the saddle point, the merging yielding at least a part of a basin.