def dc(b_box1, b_box2, return_type=Types.BOOL): obj1, obj2 = PredicateLibrary.create_polygons(b_box1, b_box2) return TypeConverter.return_correct_type(obj1.disjoint(obj2), return_type)
def inFrontOf(b_box1, b_box2, return_type=Types.BOOL): return TypeConverter.return_correct_type(b_box1.min.y > b_box2.max.y, return_type)
def ntppi(b_box1, b_box2, return_type=Types.BOOL): obj1, obj2 = PredicateLibrary.create_polygons(b_box1, b_box2) return TypeConverter.return_correct_type( obj2.within(obj1) and not obj1.equals(obj2), return_type)
def behind(b_box1, b_box2, return_type=Types.BOOL): return TypeConverter.return_correct_type(b_box1.max.y < b_box2.min.y, return_type)
def below(b_box1, b_box2, return_type=Types.BOOL): return TypeConverter.return_correct_type(b_box1.max.z < b_box2.min.z, return_type)
def rightOf(b_box1, b_box2, return_type=Types.BOOL): return TypeConverter.return_correct_type(b_box1.min.x > b_box2.max.x, return_type)
def onTable(b_box1, b_box2, return_type=Types.BOOL): return TypeConverter.return_correct_type( abs(b_box1.min.z - b_box2.min.z) < 5, return_type)
def po(b_box1, b_box2, return_type=Types.BOOL): obj1, obj2 = PredicateLibrary.create_polygons(b_box1, b_box2) return TypeConverter.return_correct_type( obj1.intersects(obj2) and not obj1.within(obj2) and not obj2.within(obj1), return_type)