mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor: rivers generation
This commit is contained in:
parent
c1e7d6f54a
commit
3215b6f0d2
18 changed files with 739 additions and 704 deletions
|
|
@ -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}"/>`;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue