[vtk-developers] Class design for spline visualizations

David Thompson david.thompson at kitware.com
Mon Apr 27 13:46:57 EDT 2015


Hi Lin,

> ... I changed the method to compute binomial coefficient from vtkMath::Binomial to vtkMath::Factorial using our memoization improvement and tried to merge from Lin.Ma/filter-bezier to Spline/filter-bezier.

Great! I can see that you were able to merge to the branch.

> What do you think is the proper thing to do next?

Right now, it looks like TestPatchInterpolation is modifying the array holding control point coordinates. I think it would be a good idea to write the interpolated points to a separate array and then make the test verify that Bernstein polynomial is being computed properly.

There are 2 ways to verify things: value tests and image tests.

1. Value testing. Interpolate a few different r values on a few different sets of control points and compare the resulting point coordinates to values you know are good. The comparison must allow for small differences due to the differences in floating-point arithmetic implementations on different platforms.

2. Image testing. Plot the interpolated points and compare the rendering of the interpolated points to one you have verified is correct. While not as accurate as value testing, it can often be easier to debug a failing test with a rendered image. VTK provides utilities for comparing images (also allowing for small differences due to floating-point math, OpenGL implementations, and so on). The image baselines that get compared to your test's rendering are stored outside of the git repository to keep the repository from getting bloated. Instead, the MD5 sum of the baseline images are stored in the git repository and the images are stored separately on Kitware's servers, which can be queried to find a file with a given MD5 sum.

Please take a look at this documentation on adding test data and baseline images to VTK:

  https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/dev/git/data.md

and see if you can add an image-based test of the patch interpolation.

	David


More information about the vtk-developers mailing list