svg`<svg width="${w}" height="${h}">
<rect width="${w}" height="${h}" fill="none" stroke="blue" />
<g transform="translate(${(w - h) / 2}, 0)">
${(() => {
const count = 5
const squares = []
squareRecusion(0, 0, h, count, squares, count)
return squares.map(s => {
const hs = s.size / 2
const p = new Polygon(PVector(-hs, -hs), PVector(hs, -hs), PVector(-hs, hs))
const p2 = new Polygon(PVector(-hs + hatchesMargin, -hs + hatchesMargin), PVector(hs - 2.5 * hatchesMargin, -hs + hatchesMargin), PVector(-hs + hatchesMargin, hs - 2.5 * hatchesMargin))
const hatches = p2.getHatches(0, hatchesSpacing, 0, true)
const color = random() < .2 ? 'red' : 'black'
return `<g transform="translate(${s.x + hs}, ${s.y + hs}) rotate(${randInt(4) * 90})" >
<path
stroke="${color}"
fill="none"
d="${pathFromPolygon(p)}"
/>
<path
stroke="${color}"
fill="none"
d="${pathFromPolygon(p2)}"
/>
<path
stroke="${color}"
fill="none"
d="${pathFromHatches(hatches)}"
/>
</g>`
}).join('\n')
})()}
</g>
</svg>`