This code sample demonstrates how to check if a box and a disc (in 3d, a sphere) intersects each other. The code works for 2d and 3d, and beyond, without any modifications.
The actual test is the function box_intersect_disc, the rest of the script is just to provide a visual demonstration of the test.