Operating System: Linux Ubuntu 22.04
Version / Commit SHA: OpenVDB 11.0.1
Other: gcc-10.5.0
Describe the bug
When loading a level set from a .vdb that has a transform that is not a simple linear scale, then creating a NanoGrid from it, it appears the voxel size for the resulting NanoGrid is not set correctly.
In my case I'm loading a VDB that contains a unit box with voxel size 0.1 and a Transform that rotates 45 degrees around the z-axis. I created this VDB using vdb_tool:
The x, y, x components of the voxel size returned by NanoGrid<T>::voxelSize() appear to be initialized not from the length of the transform axes, but by just taking their corresponding component from the rotated basis vectors (or something along those lines).
To Reproduce
The following small program reproduces this behavior:
Environment
Operating System: Linux Ubuntu 22.04 Version / Commit SHA: OpenVDB 11.0.1 Other: gcc-10.5.0
Describe the bug
When loading a level set from a .vdb that has a transform that is not a simple linear scale, then creating a NanoGrid from it, it appears the voxel size for the resulting NanoGrid is not set correctly.
In my case I'm loading a VDB that contains a unit box with voxel size 0.1 and a Transform that rotates 45 degrees around the z-axis. I created this VDB using
vdb_tool
:vdb_tool -platonic faces=6 scale=1 voxel=0.1 -transform rotate='(0,0,0.78539816339744830961566084581988)' vdb=0 -write box.rotated.vdb
The x, y, x components of the voxel size returned by
NanoGrid<T>::voxelSize()
appear to be initialized not from the length of the transform axes, but by just taking their corresponding component from the rotated basis vectors (or something along those lines).To Reproduce
The following small program reproduces this behavior:
When I build & run this program on the attached vdb file it prints:
Expected behavior
I would expect
NanoGrid<T>::voxelSize()
to return the same vector asFloatGrid::voxelSize()
for a NanoVDB grid created from an OpenVDB grid.