I figured out how to estimate the 2D case. Slow, but this isn't the production device.
I don't like this code. I'll delete it and start over?