octileDistanceTo

Octile3D distance: the exact minimum cost from this voxel to other on a uniform-cost Moore-26 movement grid with orthogonal step cost 1, face-diagonal cost √2, and body- diagonal cost √3. The natural admissible heuristic for A* on such a grid.

Given sorted absolute deltas dMin ≤ dMid ≤ dMax, the optimal path uses:

  • dMin body-diagonal steps (all three axes change),

  • dMid - dMin face-diagonal steps (two axes change),

  • dMax - dMid orthogonal steps (one axis changes).

octile3D = dMin * √3 + (dMid - dMin) * √2 + (dMax - dMid) * 1