jacquesr Posted April 20, 2016 Share Posted April 20, 2016 Hi, I need to implement a check that can determine if a bounding box is completely inside a set of bounding boxes. See my attached graphic for a better understanding of the situation. I am thinking of consuming the A to B paths on each axis of the original bounding box using the axes limits of the containing bounding boxes. Then, for each axis, I would store those in an array, sort them by starting point, find if there are overlaps, eliminate them, find gaps (could probably happen if outer bounding boxes are not adjacent to each other) and if none are there, look if the total length is the length of the object bounding box. If this is the truth for every axis, then I can be sure that the item is completely inside the valid area. The only thing I am worried about is that this can become quiet slow. Since this is usually an edge case, I would first go through all container bounding boxes and see if the object is completely inside one of them. Only if that is not true, I need to do the more complex check. Any ideas on different, maybe faster algorithms? Regards Jacques Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.