spikeLook function

SpikeLook spikeLook(
  1. Rng r
)

The random look of one spike: notches on its edges, strata across it.

Implementation

SpikeLook spikeLook(Rng r) {
  final notches = <SpikeNotch>[];
  final strata = <double>[];
  for (var i = 0, n = r.intRange(3, 5); i < n; i++) {
    notches.add(SpikeNotch(
      u: r.range(0.1, 0.8),
      side: r.sign(),
      d: r.range(0.8, 1.8),
    ));
  }
  for (var i = 0, n = r.intRange(2, 4); i < n; i++) {
    strata.add(r.range(0.12, 0.8));
  }
  return SpikeLook(
    notches: notches,
    strata: strata,
    slope: r.range(-0.25, 0.25),
    seed: r.intRange(1, 9999),
  );
}