79597211

Date: 2025-04-28 20:07:15
Score: 1
Natty:
Report link

axis aligned solution 3D: maximum of chessboard distance transform

diagonal solution 3D: maximum of taxicab distance transform

largest inner sphere: maximum of Euclidean distance transform

*SciPy ndimage has them all^

Rotated cube:

Using the following facts:

  1. The largest sphere that fits inside a cube has radius L/2.

  2. The largest cube that fits inside a sphere has length r/sqrt(3).

  3. Thresholding the distance transform of a cube returns a cube

The center of the cube must lie at least r/sqrt(3) away from any boundary. Thresholding the Euclidean distance transform EDT at this value will retain at most Volume(shrunk largest cube) = ([1-1/sqrt(3)]N)^3 = 0.0755..N^3. Updating the threshold new_max = (previous_max + current_max)/sqrt(3) and recompute the EDT. Iterate until convergence.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Vincent