{
let x = width / 2;
let y = height / 2;
let r = Math.min(width, height) / 2;
let a = 0.2;
let dr = r / 6.5;
const circles = [];
while (r > 0) {
circles.push({x, y, r, a});
const t = Math.random() * 2 * Math.PI;
const s = Math.sqrt(Math.random() * dr * dr / 4);
x += Math.cos(t) * s;
y += Math.sin(t) * s;
r -= dr;
a = -a;
}
return html`<svg width=${width} height=${height}>
${Array.from({length: n}, (_, i) => {
return svg`<path d="
M${d3.pairs(circles, (
{x: x1, y: y1, r: r1, a: a1},
{x: x2, y: y2, r: r2, a: a2}
) => `
${point(x1, y1, r1, a1 + (i * 2) / n * Math.PI)}
L${point(x2, y2, r2, a2 + (i * 2) / n * Math.PI)}
`).join("L")}
L${d3.pairs(circles, (
{x: x1, y: y1, r: r1, a: a1},
{x: x2, y: y2, r: r2, a: a2}
) => `
${point(x2, y2, r2, a2 + (i * 2 + 1) / n * Math.PI)}
L${point(x1, y1, r1, a1 + (i * 2 + 1) / n * Math.PI)}
`).reverse().join("L")}
Z
"></path>`;
})}
</svg>`;
}