I have a number of rectangles overlapping (side by side is counted as overlap). represented by the following data structure:
rect = [{x, y, width, height, rectNumber}, {...}, ...];
My question is what is the logic (or pseudo-code) to convert my rectangles datas to the vertices forming the outlines of the final rectilinear polygon. I'm saying outlines with an s because my final shape can have holes so inner-outlines.
The following example shows the overlapping rectangles and the result wanted with the vertices in green and the outlines in red.
I've found this post ( Finding common outline of multiple polygons) but didn't really understood everything also my question is I think a tiny bit different.
Thanks in advance,