function renderHatches(data, step, color) {
const poly = polygons(projection, data);
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.5,
x2: A[i + 1] - step * 0.5,
y1: y,
y2: y
});
}
}
return `<path d=${lines
.map((d) => `M${[d.x1, d.y1]}L${[d.x2, d.y2]}`)
.join("")} stroke=${color} stroke-opacity=0.5 ></path>`;
}