Add custom stopping criteria function to the rectcross