[vtk-developers] Triangular patch interpolation

David Thompson david.thompson at kitware.com
Mon Aug 17 13:04:49 EDT 2015


Hi Lin,

> I have some questions about the test.
> 1. About simplicial interpolation. Should I test some simple cases (hard coded simple shape) or some shapes like the motorcycle?

Those are 2 different types of tests. (There are many; see http://stackoverflow.com/questions/437897/what-are-unit-testing-and-integration-testing-and-what-other-types-of-testing-s for some lists of test types). The first test (simple hard-coded shape) is a unit test and the second (test of both the reader, spline-to-patch class, and patch interpolation) is an integration test.

Both are important, but since you already have an integration test for the motorcycle, I think a good set of unit tests for simplicial interpolation would be enough.

> If it is the latter one, how to convert the rectangular patch to simpicial patch?
> 
> 2. About point inversion. How to test it for the simpicial patch? I only implemented the point inversion for NURBS patch.

If you didn't implement it, you can't test it. :-) However, if you know what you want the test to look like, you can write the test before you implement inversion and just leave it commented out with a note. Many people think this is how development should be done in the first place, since it forces you to consider how people will use what you write.

> 3. About derivative computation. Should I just test them numerically? For example, given a shape and a parametric coordinate, test the result of our implementation with ground truth.

Again, since you are using the derivatives in code that is part of an integration, I think unit testing (as you suggest) is enough. 

	David


More information about the vtk-developers mailing list