function renderHatches(m) {
d3.select(m)
.select("path.lines")
.remove();
const poly = polygons(m.projection);
const lines = [];
for (let y = 0; y < width; y += step) {
let A = intersections(poly, y);
for (let i = 0; i < A.length - 1; i += 2) {
if (A[i + 1] - A[i] > 1 * step)
lines.push({
x1: A[i] + step * 0.75,
x2: A[i + 1] - step * 0.75,
y1: y,
y2: y
});
}
}
d3.select(m)
.append("path")
.attr("d", lines.map(d => `M${[d.x1, d.y1]}L${[d.x2, d.y2]}`).join(""))
.classed("lines", true)
.attr("stroke", "brown");
}