by Wizard » Mon Dec 05, 2011 10:05 am
My first thought is to pick three points at random (or just the first three) to form a triangle. Then check the fourth point, if it is within the bounds of the triangle ignore it. If it is outside the bounds of the triangle, insert it between the two points it is closest to, then check those two points for a concave angle. If the point has become concave thanks to the addition of the new point, remove it. Then repeat for every other point. Does that make sense?
Note that this has an O(nm) where n is the number of points total and m is the number of points in the cloud, so a worst case run of O(n^2) so you're looking at a slow algorithm for significantly large number of points. There might be a better way but I can't think of it right now.