They are many ways,
you can look at that
you can generate rectangles then pack them with OpenNest.
Too perfect !!
generate pattern with minimum distance.gh (9.6 KB)
You can generate your own code with your constrains… Kangaroo could surely also be used.