flakeDesign function
A snowflake design, seeded: pairs of side branches along each arm, optional hexagonal plate and forked tips.
Implementation
FlakeDesign flakeDesign(Rng r) {
final n = r.intRange(1, 3);
final branches = <(double, double)>[];
for (var i = 0; i < n; i++) {
branches.add((
0.38 + (0.4 * (i + r.range(0.2, 0.8))) / n,
r.range(0.24, 0.36) * (1.0 - i * 0.15),
));
}
return FlakeDesign(
branches: branches,
plate: r.chance(0.45),
fork: r.chance(0.45),
);
}