mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
fix: drawCoastline - remove redundant off-canvas points
This commit is contained in:
parent
ffea4d15cb
commit
cc3c06f595
3 changed files with 8 additions and 22 deletions
|
|
@ -9,7 +9,7 @@ export function drawCoastline(vertices: IGraphVertices, features: TPackFeatures)
|
|||
const waterMask = defs.select("#water");
|
||||
|
||||
const lineGen = d3.line().curve(d3.curveBasisClosed);
|
||||
const SIMPLIFICATION_TOLERANCE = 0.5; // px
|
||||
const SIMPLIFICATION_TOLERANCE = 0.3; // px
|
||||
|
||||
// map edge rectangle
|
||||
debug
|
||||
|
|
@ -31,18 +31,6 @@ export function drawCoastline(vertices: IGraphVertices, features: TPackFeatures)
|
|||
const simplifiedPoints = simplify(filteredPoints, SIMPLIFICATION_TOLERANCE);
|
||||
const path = round(lineGen(simplifiedPoints)!);
|
||||
|
||||
points.forEach(([x, y]) => {
|
||||
debug.append("circle").attr("cx", x).attr("cy", y).attr("r", 0.3).attr("fill", "red");
|
||||
});
|
||||
|
||||
filteredPoints.forEach(([x, y]) => {
|
||||
debug.append("circle").attr("cx", x).attr("cy", y).attr("r", 0.3).attr("fill", "blue");
|
||||
});
|
||||
|
||||
simplifiedPoints.forEach(([x, y]) => {
|
||||
debug.append("circle").attr("cx", x).attr("cy", y).attr("r", 0.3).attr("fill", "green");
|
||||
});
|
||||
|
||||
if (feature.type === "lake") {
|
||||
landMask
|
||||
.append("path")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue