Open stevengj opened 4 years ago
I've added a tarball with ~200 tests to https://github.com/NanoComp/meep/issues/864
The tests come from a paper/research group that focuses on point-in-polygon methods. We can selectively choose from those.
(Don't make the C shape too rounded, since rounded shapes are very special in that subsequent edges are nearly parallel.)
It should be sufficient for now to implement tests for a handful of hard-coded points. We can always add additional test cases later as issues arise.
It would also be reasonable to use the 200 tabulated tests you mentioned for the 2d point-in-polygon subroutine, but we still need separate tests for polyhedra.
Would be nice to add some more prism tests. There are some tests that are easier to implement if you use a fixed object (or a set of fixed objects), as a supplement to the random "fuzz testing" in the
test-prism.c
code.To start with, we could use some canonical non-convex test object (including some non right-angles), e.g. a C-like shape. Then you could precompute some things like the volume, the intersection of a box with the object, the normal vector at a few points, the result of point-in-prism at a few points (near boundaries and corners), and test against these.