Friday, March 8, 2013

Friday: If anyone has a general overlap algorithm, let me know

The idea being that given a shape and a tessellated grid, which grid elements contain the shape.  The only two algorithms I can think of are to do a monte carlo thing (randomly select points contained within the shape, and determine the unique set of grid elements those points fall in) or to do a tree search (define a center and a bounding box of the shape, and determine the unique set of points that contain the center and the bounding box corners.  If the corners are outside the center element, find the midpoint of the box corners, and repeat the search.  Continue bisecting until you no longer find unique elements.).  The tree search is faster for small regions, but are these really the only two methods?  It seems like the computer graphics people would have solved this by now.

"GET ME TWO UNITS OF O NEGATIVE BLOOD!" "Doctor, this is a bear." "DAMN IT, I'M NOT LOSING ANOTHER PATIENT TODAY!"

No comments:

Post a Comment