manifold
manifold copied to clipboard
suggestion: fuzzing
Perhaps we can use https://llvm.org/docs/LibFuzzer.html to test the library? Generate a number of primitive objects, perform random translation/scaling/rotation and boolean operations for them. There are a few things we can test for:
- Memory usage.
- Should not crash.
- Compare with other libraries like CGAL? Not sure about if this is possible.
That sounds pretty cool, but in my experience, I don't think random transforms will be enough. The ugly edges cases have more to do with colinear/coplanar intersections and large, complex holes in individual faces. That's why I build the Menger Sponge test cases. I'm also working on an SDF implementation which will allow us to create random shapes more easily that will be guaranteed manifold and non-overlapping. Still, this framework sounds useful.
A code coverage report at the very least would be very beneficial!
The fuzzer will just give us an array of bytes, we will transform that into operations for geometric objects, so in principle we can favor generating colinear/coplanar/complex holes in addition to random transforms. Perhaps I can try to write a prototype for this later.
feel that we really need this for the triangulator, will look into this later.