Shoreline intercept just outside one end of a wet run — the exact chainage where the (wet-side-extrapolated) water surface crosses the piecewise-linear ground between the run's boundary sample and its adjacent dry sample.
CellSurfaceInterp tapers the depth FIELD to the sub-cell waterline, but the painted band could only end at the last sample that happened to be wet — up to one resample step short of the true shoreline, with a vertical cliff of height (WSE − ground). This helper closes that sub-sample gap at paint time so the band tapers to a point on the ground line (premature-truncation fix).
The surface is extended from the run's two boundary-most wet samples (flat for a single-sample run) and intersected with the ground segment toward the dry neighbour. An intercept exists only when the ground actually rises through the surface within that segment — a dry neighbour whose ground stays below the surface (a no-data termination, e.g. the split flank of an unbridged pool over a low bench) keeps its hard edge, as does an off-mesh (NaN ground) neighbour and a run ending at the data edge.
- Parameters
-
| s | Ordered profile samples (chainage / ground). |
| top | Paint-top series from bridgedTops(), parallel to s. |
| runFirst | Index of the run's first wet (non-NaN top) sample. |
| runLast | Index of the run's last wet sample. |
| trailing | true → intercept past runLast; false → before runFirst. |
| outChainage,outElev | The intercept; written only on success. The elevation lies on the drawn ground segment by construction, so both the WSE polyline and the fill close exactly onto the ground line. |
- Returns
- true when a physically meaningful intercept exists.