Hi,
I have a question on how to set the voxel size and other parameters (half width, background value, ...) for a problem.
As an example I took a sphere with R=5. I tried to calculate the first and second principal curvatures.
To generate the sphere I use the code from openvdb/unittest/TestMeanCurvature.cc:
openvdb::FloatGrid::Ptr sphere_grid = openvdb::FloatGrid::create(/*backgroundValue=*/0.75);
sphere_grid->setTransform(openvdb::math::Transform::createLinearTransform(/*voxelsize=*/0.075));
const openvdb::Coord dim(160,160,160);
const openvdb::Vec3f center(6.0f, 6.0f, 6.0f);
const float radius=5.0f;
unittest_util::makeSphere<openvdb::FloatGrid>(dim, center, radius, *sphere_grid, unittest_util::SPHERE_DENSE_NARROW_BAND);
First I calulated the curvature values with a voxel size = 0.25 (background value=0.75)
Everything fine, the curvature values are correct around 0.2.
Then I tried to run the same code with a smaller voxel size (voxel size = 0.15, background value=0.75) and suddenly the curvature values become nan-s.
Can
someone explain me what is happening here? Is there some rule of thumb
how to set the above parameters (voxel size, background value, half
width length). Is there a lower limit for the voxelsize?
I saw that
the curvature is calculated on a 19 point stencil so I guess the half
width has to be least 3 voxels but I couldn't find out why the code
crash for smaller voxel sizes. I also tried to increase the domain so we
are far from the boundary but that doesn't matter.
(The figures are just the middle sections of the curvature FloatGrid.)
Kind Regards,
Peter