Move the debug helper functions to the test file for now.
Return only the "valid" intersections, by backtracing, like in paperjs