Closed kip-hart closed 3 years ago
Added the option to specify open vs closed overlap testing, per request in (#13). Default behavior remains unchanged if the closed flag is not set.
closed
If closed is set to false, there must be a non-zero amount of overlap between boxes for there to be an intersection. This is the default behavior.
If closed is set to true, two boxes can be touching for there to be an intersection.
For example:
from aabbtree import AABB from aabbtree import AABBTree tree = AABBTree() aabb1 = AABB([(0, 0)]) aabb2 = AABB([(-1, 0)]) tree.add(aabb1, 'box 1') tree.add(aabb2, 'box 2') # Open Boxes v = tree.overlap_values(aabb2) print(v) >>> ['box 2'] # Closed Boxes v = tree.overlap_values(aabb2, closed=True) print(v) >>> ['box 1', 'box 2']
Added the option to specify open vs closed overlap testing, per request in (#13). Default behavior remains unchanged if the
closed
flag is not set.If
closed
is set to false, there must be a non-zero amount of overlap between boxes for there to be an intersection. This is the default behavior.If
closed
is set to true, two boxes can be touching for there to be an intersection.For example: