Hacker News new | ask | show | jobs
by arghbleargh 3523 days ago
Isn't it simple enough to make three bounds checks to essentially do the same thing you did with the zero padding? You can even make it a function

    is_in_bounds(x, y, z)
1 comments

It's n-dimensional, not 3-dimensional.

Also, it's really slow and wasteful to be doing bounds-checking for each voxel of an image that is almost completely not a boundary, whereas you can't avoid checking if each voxel is lit. :-)