Given 2 or 3 trapezoids (orange). At least one side of each trapezoid is adjacent to another trapezoid, forming a simple polygon.
Rectangles represented as a list of four points, starting from the left top most corner and going clockwise, e.g
[
{x: 0, y: 0},
{x: 50, y: 0},
{x: 75, y: 30},
{x: 60, y: 30}
]
The task is to make a single polygon (green) that would be represented as a list of points:
[
{x: 0, y: 0},
{x: 50, y: 0},
{x: 75, y: 30},
{x: 60, y: 30},
{x: 60, y: 170}
…
{x: 0, y: 0}
]