You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement __contains__ for BoundingBox containing either a point, or another BoundingBox. This means that users could then write:
if point in box: or if little_box in big_box.
Alternatives
It is possible for users to accomplish this currently but requires some clever coding to avoid becoming difficult to read:
defin_box(point, box):
formin_p, p, max_pinzip(box.lower_left, point, box.upper_right):
ifp<min_por>max_p:
returnFalsereturnTrue
Compatibility
This would be an enhancement, and would not alter the behavior of the existing API.
There is a risk though that users will misinterpret the results. A point in the bounding box of a volume may be in the volume, but not necessarily. A user could misuse this information and create problems for themselves. Also a small volume's bounding box can be completely contained in another volume's bounding box, and be completely outside that other volume.
The text was updated successfully, but these errors were encountered:
Description
Implement
__contains__
forBoundingBox
containing either a point, or anotherBoundingBox
. This means that users could then write:if point in box:
orif little_box in big_box
.Alternatives
It is possible for users to accomplish this currently but requires some clever coding to avoid becoming difficult to read:
Compatibility
This would be an enhancement, and would not alter the behavior of the existing API.
There is a risk though that users will misinterpret the results. A point in the bounding box of a volume may be in the volume, but not necessarily. A user could misuse this information and create problems for themselves. Also a small volume's bounding box can be completely contained in another volume's bounding box, and be completely outside that other volume.
The text was updated successfully, but these errors were encountered: