Parametric attractor pattern not limited to grid centers

Hi, I am trying to think of an approach that will enable me to create an attractor-based square pattern, but one which will not be constrained only to the center points of a grid, but will also be able to connect adjacent grids into one square, thus having a varied-size pattern. I’m attaching a sketch of what I have in mind. any ideas on how to approach this? a certain plug-in maybe?

Hmmmm…