In the current code for sampling a grid of SDF values, there is a rounding error in the computation of the regularly spaced 3D coordinates of the grid.
To exemplify my point, for N=256 (default), the (x,y,z)=(1,1,1) edge of the bounding box instead has coordinates
This error does not only affect coordinates on the cube's boundaries, but the whole volume.
I propose to properly carry integer division, which now yields:
>>> samples[-1, :]
tensor([1., 1., 1., 0.])
Despite the error in 3D coordinates being small, I have found this fix to improve 3D reconstruction metrics quite a bit (~5% on my task).
In the current code for sampling a grid of SDF values, there is a rounding error in the computation of the regularly spaced 3D coordinates of the grid. To exemplify my point, for
N=256
(default), the (x,y,z)=(1,1,1) edge of the bounding box instead has coordinatesThis error does not only affect coordinates on the cube's boundaries, but the whole volume. I propose to properly carry integer division, which now yields:
Despite the error in 3D coordinates being small, I have found this fix to improve 3D reconstruction metrics quite a bit (~5% on my task).