![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Terrain-error size field (workplans/MESH_OVERHAUL_PLAN_2026-09-29.md §3, Stage 2). More...
#include <QPointF>#include <QString>#include <QVector>#include <functional>Go to the source code of this file.
Classes | |
| struct | mesh::TerrainSizeOptions |
| class | mesh::TerrainSizeField |
Namespaces | |
| namespace | mesh |
Terrain-error size field (workplans/MESH_OVERHAUL_PLAN_2026-09-29.md §3, Stage 2).
Terrain-error size field (workplans/MESH_OVERHAUL_PLAN_2026-09-29.md §3, Stage 2). Replaces the DTM thinner's Steiner point cloud with a SIZE: for every place on the DEM, the largest square block of pixels whose surface is within a vertical tolerance of the bilinear plane through the block's four corner pixels. A mesh cell of that size interpolates the ground to within the tolerance; a larger one may not.
Algorithm. Blocks are dyadic: level k is a 2^k × 2^k pixel block aligned to multiples of 2^k inside the pixel window. A level-1 block "resolves" to level k when every ancestor block up to level k passes the tolerance and the level k+1 ancestor fails (first-failure rule — a block is never accepted on the strength of a larger block that happens to pass). The output raster stores, per output cell of 2^outLevel pixels, the minimum resolved size over the level-1 blocks it contains, in pixels.
Cost: every level scans only the pixels of blocks whose children all passed, so rough terrain is cheap (fails early) and smooth terrain costs O(pixels · levels). The DEM is read in horizontal bands of 2^maxLevel rows aligned to the block grid, so every block of every level lies in exactly one band and no halo is needed; peak memory is one band plus the output.
NoData / NaN pixels are skipped inside a block; a NaN corner fails the block (conservative near the DEM edge; the caller's minimum size clamps).
Finally the output grid takes the minimum over each 3×3 neighbourhood: a step lying exactly on a block boundary is seen only by the blocks whose far corner touches it, which would refine one side of it and not the other. (Phase 6b, MESH_OVERHAUL_PHASE6B_FEATURE_CAPTURE_2026-09-30.md.)