CurviRiver: Curvilinear Mesh Generator for Rivers#

CI PyPi Conda Version CodeCov Python Versions

Downloads CodeFactor black pre-commit

Features#

CurviRiver takes as input a Polygon of a river segment and generates a 2/3D curvilinear mesh that can be used for hydrodynamic or hydrological modeling. The mesh is generated in the following main steps:

  • Determining the centerline of the input Polygon using Voroni diagram and Dijkstra’s algorithm,

  • Smoothing the generated centerline with a B-spline curve,

  • Computing the tangent angles of the centerline at each point along the centerline and generating cross-sections perpendicular to the centerline at given intervals,

  • Generating a 2D mesh from vertices of the cross-sections,

  • Generating a 3D mesh if depth data is provided, by determining the depth of 2D mesh vertices from the depth data using Inverse Distance Weighting (IDW).

https://raw.githubusercontent.com/cheginit/curviriver/main/doc/source/_static/curvilinear.png

Support#

The work for this project is funded by USGS through Water Resources Research Institutes (WRRI).