¿Cómo es que durante el "dibujar" cada Punto devuelve "indefinido" en lugar de una coordenada? ¿No es posible llenar una matriz durante la configuración?
let a = []; var scl = 10; class Point { constructor(i, j) { this.x = i; this.y = j; } } function setup() { createCanvas(600, 600); for(x = 0; x < width; x += scl) { a[x] = []; for(y = 0; y < height; y += scl) { let p = new Point(x, y); a[x][y] = p; } } } function draw() { background(0); a.forEach( p => { rect(px, py, scl); }); }a es una matriz bidimensional, necesita bucles anidados:
function draw() { background(0); a.forEach(row => row.forEach(p => rect(px, py, scl))); }