I used the convexHull algorithm to find the contour for some... irregular shape. It is not good enough though...
Quite possibly because I can't guarantee that the shape I have is convex...
I have a set of rectangles, and I would like to be able to get all points on the outside of the contour - but not throw any of the contour points out.
The convex hull algorithm works great - but it works like the example on the right, so I lose some information on the contours.
I want something that works closer to the version on the left, preserving the outside corners, and only eliminating the points inside...
Is there such an algorithm ?
Or, is there any way to break a shape (polygon) like this into convex shapes, so the convex hull algorithm can process it properly ?
From link to link, I have been trying to figure out how to set up some sort of algorithm, like Hertel-Mehlhorn Algorithm - but I don't know what use intersecting lines would do in this situation...
Thank you for any suggestion.