Keypoint Engine
Analyzes stream slopes to find the Keypoint (the vertex with the largest steep-to-flat drop in smoothed slope) and extracts the Master Keyline contour.
Overview
Analyzes stream slopes to find the inflection point (Keypoint) and extracts the Master Keyline contour.
Inputs (4)
- Terrain (Mesh): The base topography mesh
- Streams (Curve): Stream curves from Hydro-DEM
- Smoothing (Integer): Smoothing window for slope analysis (helps ignore mesh noise)
- Run (Boolean): Optional. False = skip the analysis and keep showing the last results (cached). Share one toggle with the Analysis Dashboard to switch everything on/off together.
Outputs (4)
- Keypoints (Point): The identified points of inflection (steep to flat)
- Master Keylines (Curve): The specific horizontal terrain contours passing through the Keypoints
- Info (Text): Component information and methodology
- Dashboard Data (Text): Unified JSON payload containing legend and key analysis metrics for the Analysis Dashboard
Method, assumptions and simplifications
The same notes appear in the component's Info output.
Method
- Each stream curve is used as a polyline (curves are converted at 0.1 tolerance); streams with fewer than 4 vertices are skipped. Streams drawn uphill (start lower than end) are reversed first, so slopes are measured downstream.
- The slope of each segment is (Z start - Z end) / horizontal length, positive downhill.
- Slopes are smoothed with a moving average over ±Smoothing segments (default 2).
- The keypoint is the vertex where the smoothed slope drops most from one segment to the next (largest steep-to-flat change). One keypoint per stream; if the smoothed slope never decreases downstream, no keypoint is returned for that stream (remark).
- The terrain is cut by a horizontal plane at the keypoint level; the contour closest to the keypoint is the Master Keyline if it lies within 5 model units.
Assumptions
- Stream curves are 3D and lie on the terrain, as from Hydro-DEM.
- Model units are metres (the 5 unit search distance).
Simplifications and limits
- The keypoint is the largest single drop in slope, not a true inflection (sign change of curvature); one per stream curve.
- The keyline is the whole contour at that level, not trimmed to the valley and shoulders.
Workflow
- Hydro-DEM streams + the same terrain mesh -> Streams and Terrain; Master Keylines -> offset for keyline ploughing patterns.
References
- Yeomans P.A. (1958), The Challenge of Landscape: the development and practice of keyline.