Placing a Rectangle Inside an Irregular Polygon

I think you can use Minkowski difference, it is in Clipper plugin

You’ll have to place your rectangle centered on 0 on XY plane (or other if you specify)
Then plug this rectangle to A and your polygon to B.
It will output 2 curves. The second curves is the maximum polygon to place the rectangle inside your polygon. WIth that you could find the optimum position

rectangle inside (12.5 KB)