[vtk-developers] Class design for spline visualizations
majcjc at gmail.com
Mon May 18 22:45:36 EDT 2015
Hi Dr. Thompson
Thanks! I'll look into that and implement the test asap.
On Mon, May 18, 2015 at 10:36 PM, David Thompson <david.thompson at kitware.com
> Hi Lin,
> Sorry for the slow reply.
> > Is there any dataset for precomputed Bezier interpolation? I'm currently
> comparing the result with my manual calculating. In this way I can not test
> many examples and it's quite low efficient.
> I've pushed a merge request to the project that adds a couple simple test
> cases. I'll add some more over the next few days. You can run the test by
> building VTK with the VTK_WRAP_PYTHON option turned ON and then running:
> If you uncomment the lines below the "For debugging, ..." message in
> PatchInterpolation.py, running the test will create some files (named
> bezier-circle.vtk and bezier-line.vtk) that you can load into ParaView.
> 1. As I mentioned earlier, it would be great to do image-based testing. A
> good exercise would be to modify the Python test into an image test version.
> 2. Another good exercise would be to generate control points for other
> conic sections such as hyperbolas, parabolas, and the more generate case of
> ellipses. I recommend "The NURBS Book" by Les Piegl; the circle quadrant
> example in the Python test is from pp. 26--32 of the book. It would be
> really nice to have a utility that would create control points given a few
> shape parameters. For example:
> ctrlPts, prange = ellipse(major_radius=2, minor_radius=1)
> ctrlPts, prange = hyperbola(semi_major_axis=2/3, eccentricity=1)
> Once we have the 1-, 2-, and 3-d Bezier interpolation tested, we can work
> on converting B-splines into Bézier patches and testing that.
> > On Mon, Apr 27, 2015 at 1:46 PM, David Thompson <
> david.thompson at kitware.com> wrote:
> > 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:
> > and see if you can add an image-based test of the patch interpolation.
> > David
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtk-developers