ConvexHull does not always act like I think it should; in some cases it will “cut a corner” and return one less point than expected. In the attached example, it returns only 3 corners of a set of 4 points describing a rectangle.
Am I not understanding what ConvexHull is doing, or is this a bug?
Hmmm, that’s pretty non-intuitive and restrictive. The ref page for ConvexHull just says “find the hull surrounding all points”. Seems like if it needs sorted points, it should do the sorting internally. Or at least the requirements for the input data should be clearly specified.
And why does it work correctly when one of the points is moved slightly, without changing the order?
I discovered the problem when feeding ConvexHull the output from Contour, so it breaks with the way Contour orders its X/Y data. Again, non-intuitive.