I'm actually envisioning two polygons, not rectangles, I apologize.
Note that Xs points are arbitrary. The user can draw these points however he/she wants.
So, the output for this example would be two polygons:
P1 = {X1, X2, X3, X4, X5, C, D, A}
P2 = {X1, B, X5, X4, X3, X2}
I'm just...