**rectWidth; const height = squares**rectWidth; setDocDimensions(width, height); function filledRect(w, h, spacing) { const result = []; const numLines = Math.floor(h / spacing); for (let i = 0; i < numLines; i++) { const y = (i + 0.5)

**spacing - h / 2; const line = [ [-w / 2, y], [w / 2, y] ]; result.push(line); } return result; } for (let i = 0; i < squares; i++) { for (let j = 0; j < squares; j++) { if ((i % 2 === 0 && j % 2 === 0) || (i % 2 !== 0 && j % 2 !== 0)) { const rect1 = filledRect(rectWidth, rectWidth, spacing); bt.translate(rect1, [rectWidth**i, rectWidth * j]); bt.join(finalLines, rect1); } } } const finalLinesBounds = bt.bounds(finalLines); bt.translate( finalLines, [width / 2, height / 2], finalLinesBounds.cc ); drawLines(finalLines);

**rectWidth; const height = squares**rectWidth; setDocDimensions(width, height); function filledRect(w, h, spacing) { const result = []; const numLines = Math.floor(h / spacing); for (let i = 0; i < numLines; i++) { const y = (i + 0.5)

**spacing - h / 2; const line = [ [-w / 2, y], [w / 2, y] ]; result.push(line); } return result; } for (let i = 0; i < squares; i++) { for (let j = 0; j < squares; j++) { if ((i % 2 === 0 && j % 2 === 0) || (i % 2 !== 0 && j % 2 !== 0)) { const rect1 = filledRect(rectWidth, rectWidth, spacing); bt.translate(rect1, [rectWidth**i, rectWidth * j]); bt.join(finalLines, rect1); } } } const finalLinesBounds = bt.bounds(finalLines); bt.translate( finalLines, [width / 2, height / 2], finalLinesBounds.cc ); drawLines(finalLines);