refactor: rivers generation

This commit is contained in:
max 2022-07-21 00:23:37 +03:00
parent c1e7d6f54a
commit 3215b6f0d2
18 changed files with 739 additions and 704 deletions

View file

@ -1,3 +1,5 @@
import {pick} from "utils/functionUtils";
export function drawRivers(pack: IPack) {
rivers.selectAll("*").remove();
@ -12,7 +14,7 @@ export function drawRivers(pack: IPack) {
points = undefined;
}
const meanderedPoints = addMeandering(pack, cells, points);
const meanderedPoints = addMeandering(pick(pack.cells, "fl", "conf", "h", "p"), cells, points);
const path = getRiverPath(meanderedPoints, widthFactor, sourceWidth);
return `<path id="river${i}" d="${path}"/>`;
});