Issue #1 new

some methods for BoundingBox

Anonymous created an issue

I usually use my own Rect type for doing page layout analysis. I've been trying planar.BoundingBox instead. It would be helpful if BoundingBox could include a few additional methods:

    def x_overlaps(self, other):
    return (self.min_point.x < other.max_point.x) and (other.min_point.x < self.max_point.x)

def y_overlaps(self, other):
    return (self.min_point.y < other.max_point.y) and (other.min_point.y < self.max_point.y)

def overlaps(self, other):
    return (self.x_overlaps(other) and self.y_overlaps(other))

def contains (other):
    return (self.contains_point(other.min_point) and self.contains_point(other.max_point))

Comments (0)

  1. Log in to comment