I need to pack n rectangles (n<10) of different size into a simple polygon. I am aware of two possible solutions:
Bin packing rectangles into a rectangle. Then the problem becomes finding a rectangle in the polygon that is reasonably large. It doesn't need to be the largest rectangle, but it should be large enough to be a good approximation of the polygon for packing those small rectangles. Is any algorithm that could do this?
Using a constraint solver. The only JavaScript constraint solver I know is Cassowary. However, it is a linear one, and it seems to me that constraining a point inside a simple polygon is not a linear constraint.
Any ideas?