Specifically, this just establishes the data model and what I hope is a good initial state to explore actual meandering in subsequent sketches. The implementing PR includes diagrams of the data structures and smoothing approach.
(via the dat.gui control panel)
num_segmentshow many starting lines there are before smoothing takes place
wave_amplitudenumber of pixels above and below the centerline the sine wave used to place the points will swing.
wave_frequencythe number of sine-wave oscillations before the end point.
source_headingthe direction of flow for head of the river
smooth_curvestoggles on/off the algorithmic smoothing of the curve.
Note: If you max out the
num_segments you can see a clear depiction of the underlying sine-wave used for point generation. When the segment count is low, it is basically placing a point at the
y coordinate along that wave for discrete
x points (a sort of data-sampling effect).
- Wikipedia: Meandering