svg`<svg width="${w}" height="${h}">
<rect x="0" y="0" width="${w}" height="${h}" stroke="lightblue" fill="none"></rect>
${array(nx).map(i => {
const X = (w + 200) / (nx - 1) * i - 100
const step = h / ny
let y = 0
let x = X + simplex.noise3D(X/noiseScale, y, seed) * amp
const pts = array(ny).map(() => {
let py = y
y = y + step
let px = x
x = X + simplex.noise3D(x/noiseScale, y/noiseScale, seed) * amp
return {
x,
y,
path: `C ${px} ${py + step / 4}, ${x} ${y - step / 4}, ${x} ${y}`
}
})
if(pts.some(pt => pt.x < 0 || pt.x > w)) return ''
return `<path
stroke-width="1"
stroke="black"
fill="none"
d="M ${x} 0 ${pts.map(pt => pt.path).join(' ')}"
/>`
}).join('\n')}
</svg>`