Script to fill void with different sized squares

Similar things have been done before. I remember @laurent_delrieu doing some. Perhaps check the links in the quoted post below and see if anything is useful?