def is_at_position(x, y, z, pos, tolerance, apply_offsets): if apply_offsets: x = x + pos.XOffset y = y + pos.YOffset if z is not None: z = z + pos.ZOffset if ((pos.X is None or utility.is_close(pos.X, x, abs_tol=tolerance)) and (pos.Y is None or utility.is_close(pos.Y, y, abs_tol=tolerance)) and (z is None or pos.Z is None or utility.is_close(pos.Z, z, abs_tol=tolerance))): return True return False
def test_isclose(self): self.assertTrue(utility.is_close(113.33847, 113.34, 0.005)) self.assertTrue(utility.is_close(119.9145519, 119.91, 0.005))