[general]
name=BlueMesh2D
qgisMinimumVersion=3.34
description=Generate unstructured triangular meshes from bathymetry rasters (BlueMesh2D)
about=Wraps the BlueMesh2D meshing library as QGIS Processing algorithms: from a bathymetry GeoTIFF to an unstructured triangular mesh, written as a UGRID NetCDF that loads directly as a QGIS mesh layer. The workflow runs as six stages:
    • 1 - Extract the water polygon (coastline and domain) from the raster.
    • 2 - Build a gradient-limited element-size raster: depth polynomial, wavelength (Hunt 1979) or a custom Python function, with optional finer detail regions.
    • 3 - Resample the boundary to the element size, as an editable line layer.
    • 4 - Generate the mesh: Delaunay or Frontal-Delaunay refinement, optional smoothing and smood orthogonalisation for Delft3D-FM.
    • 5 - Classify the boundary nodes into open, closed and island, editable in QGIS.
    • 6 - Export: UGRID NetCDF, Delft3D-FM open-boundary files (.pli / .bc / .ext) or ADCIRC .grd.
    Each stage produces an ordinary QGIS layer, so every intermediate result can be inspected and hand-edited before the next step; an all-in-one algorithm is also available for a single-dialog run.
    Step-by-step tutorial (PDF): https://github.com/GeoOcean/BlueMesh2D/blob/develop/docs/Tuto_BlueMesh2D_Santander.pdf
    Dependencies need no manual setup. On first load the plugin detects what is missing and installs it in one click (Plugins ▸ BlueMesh2D ▸ Check / install dependencies). pip runs in QGIS's own interpreter; on Debian/Ubuntu system Python (PEP 668) the packages go into a plugin-managed virtual environment instead, leaving the system Python untouched. Installing bluemesh2d brings numpy, scipy, shapely, rasterio, matplotlib, netCDF4, xarray and triangle with it.
version=0.2.0
author=Geomatics and Ocean Engineering Group
email=faugeree@unican.es
tracker=https://github.com/GeoOcean/BlueMesh2D/issues
repository=https://github.com/GeoOcean/BlueMesh2D
homepage=https://github.com/GeoOcean/BlueMesh2D/tree/develop/bluemesh2d_qgis
changelog=
    0.2.0
    - Cross-platform install fixes. The manual fallback commands shown in the
      dependency dialog now quote every requirement: unquoted, "bluemesh2d>=0.1.8"
      is a redirection in cmd, PowerShell, bash and zsh and installed the
      unpinned package.
    - Packages installed by the dialog now take precedence over older copies
      in the system site-packages (e.g. Ubuntu's python3-shapely 1.8), which
      used to shadow them so the upgrade changed nothing.
    - The plugin virtual environment (Debian/Ubuntu, Homebrew) is built with a
      real Python interpreter. Where QGIS provides none (macOS: sys.executable
      is the QGIS application) pip runs in QGIS itself instead of launching a
      second QGIS.
    - Windows: no console window flashes up during installation, the venv
      interpreter is looked up as python.exe, and a missing pip gets an
      OSGeo4W-specific hint. Linux: the missing-pip hint also covers Fedora and
      Arch.
    - Export 6a no longer fails when the output is the same file as the input
      spelled differently (drive-letter case, or file-name case on Windows and
      macOS); mesh layers are located through their provider instead of by
      splitting the URI.
    0.1.9
    - Fix "hfun raster failed: module 'shapely' has no attribute 'prepare'"
      (seen on macOS, where QGIS ships Shapely 1.x): the library needs
      Shapely 2.0 or newer.
    - Fix "module 'numpy' has no attribute 'bool'" (boundary classification
      and any stage reading the mesh) on machines whose QGIS Python has an
      old netCDF4 next to NumPy 1.24 or newer.
    - The dependency check now verifies minimum versions of shapely (2.0),
      netCDF4 (1.6.4), xarray (2023.1) and scipy (1.10), not just that they
      are present; the install button upgrades any that are too old and the
      dialog lists which ones.
    0.1.8
    - ADCIRC .grd export: the nodes of each element are now sorted clockwise
      before writing, as the .grd format requires.
    - Requires bluemesh2d 0.1.8 or newer for the sorted export.
    0.1.7
    - Stage 2 / all-in-one: new option "Clip to the water polygon". The size
      function is now clipped to the stage-1 polygon itself, not just to its
      bounding box: outside it the size is the neutral maximum, so land pixels
      no longer drag the element size of the water down through the gradient
      limiting. On a 100 m deep channel next to flat land the elements 1 km
      offshore were 200 m instead of the 4200 m the depth asks for; they are
      now 4200 m. Untick the option for the previous behaviour.
    - Slope refinement no longer straddles the coastline: the depth gradient
      is evaluated one-sided when a sample falls on land, instead of
      subtracting a land elevation from a sea depth and inventing a huge
      gradient that produced tiny elements along the shore.
    - Check / install dependencies now reports whether the installed
      bluemesh2d is the latest release on PyPI, and offers to upgrade. The
      query runs only when the dialog is opened, never on plugin load, and
      every failure (offline, proxy, timeout) is ignored silently.
    - Requires bluemesh2d 0.1.7 or newer for the clipping option.
    0.1.3
    - Stage 4 / all-in-one: new smood option "merge the remaining problematic
      elements during recovery", on by default from recovery cycle 2. A mesh
      whose last few small flow links sit on nodes smoothing may not move
      (fixed points, boundary vertices) now completes instead of failing with
      "mesh still violates dual criteria". The recovery cycle it starts at is
      an advanced setting; untick the option for the previous behaviour.
    - The smood progress table gained an N_MERGED column, so it is visible
      whether a recovery cycle merged anything.
    - Declares its Python dependencies (bluemesh2d, pyproj) in the metadata,
      so they are listed on the plugin page.
    - Clearer About text: the six stages as a bullet list.
    0.1.2
    - First public release.
    - The meshing library is installed from PyPI (bluemesh2d) instead of being
      bundled with the plugin: one dependency to install, and library fixes
      reach users without a plugin update.
    - One-click dependency installer: detects what is missing on load and
      installs it into QGIS's own Python, or into a plugin-managed virtual
      environment on PEP 668 systems (Debian/Ubuntu).
    - Qt6-compatible scoped enums throughout; requires QGIS 3.34 or newer.
    0.1.0
    - Initial release: 6-stage Processing workflow from bathymetry raster to
      UGRID NetCDF, plus an all-in-one algorithm.
category=Analysis
icon=icon.png
external_deps=bluemesh2d>=0.1.8,pyproj,shapely>=2.0,netCDF4>=1.6.4,xarray>=2023.1,scipy>=1.10
experimental=False
deprecated=False
hasProcessingProvider=yes
tags=mesh,bathymetry,ocean,unstructured,ugrid,delft3d,adcirc,triangulation
