Skip to content Skip to sidebar Skip to footer

Efficiently Group Overlapping Rectangles

Best way to group overlapping rectangles? I've tried using OpenCV but the grouprectangles method doesn't work as intended. I've thought about doing something like this: L = [every

Solution 1:

I'd look at pygame.Rect.collide methods for a response to your problem. Since rectangle overlapping detection is so common in games, I guess their implementation is quite good in terms of computational complexity.


Post a Comment for "Efficiently Group Overlapping Rectangles"