Area division using Rectangles

Hi, i am trying to realize a script where:

  • using an area with holes (using area boundaries)
    -The area coordiante system can be with any orientation

I would like to divide the area in the less amount of rectangle as possible.
Since i would like to create the rectangles with an adaptive generic model, i was thinking of only create the points for this adaptive GM. Unfortunately i am not so talented with Dynamo.
Do someone knows how to realize this kind of script?
Thank you and sorry for the bad english.

There are several examples of optimizing paneling to reduce waste with generative design that you can look into. Check the generative design primer, Dynamo blog, Autodesk University, and other such examples.