def intersect(self, box):
        """
        Return a box containing the area self and box have in common. Box will have zero volume
         if there is no common area.
         
        :param box: The intersecting box
        :type box: pymclevel.box.BoundingBox
        :return: A box of the resulting intersection of the two boxes
        :rtype: pymclevel.box.BoundingBox 
        """
        if (self.minx > box.maxx or self.maxx < box.minx or
                    self.miny > box.maxy or self.maxy < box.miny or
                    self.minz > box.maxz or self.maxz < box.minz):
            # Zero size intersection.
            return BoundingBox()

        origin = Vector(
            max(self.minx, box.minx),
            max(self.miny, box.miny),
            max(self.minz, box.minz),
        )
        maximum = Vector(
            min(self.maxx, box.maxx),
            min(self.maxy, box.maxy),
            min(self.maxz, box.maxz),
        )

        # print "Intersect of {0} and {1}: {2}".format(self, box, newbox)
        return BoundingBox(origin, maximum - origin)

        Return a box containing the area self and box have in common. Box will have zero volume
         if there is no common area.
         
        :param box: The intersecting box
        :type box: pymclevel.box.BoundingBox
        :return: A box of the resulting intersection of the two boxes
        :rtype: pymclevel.box.BoundingBox 
        
pymclevel/box.py