-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Robustness problems in path simplification #268
Comments
In addition to the corner-handling robustness as mentioned above, there is another issue that deserves attention. In the looped Bézier segment toward the bottom of the figure, |
Above analysis is not correct, it is not the case that The internal |
This is essentially a continuation of #264 but with concrete failing test cases. Thanks to @rachael-wang for providing the test code and data. I've put the code in a gist; the easiest way to run it is to place it in the examples/ directory.
Running this command on the attached test data produces the following SVG (blue is input, red is output):
As discussed in #264, the problem is partly that
fit_to_bezpath_opt
is being called with path data containing corners, and it is intended to be used for reasonably smooth input paths. One solution is to implement an additional layer to segment the input by corners and optimize each smooth subrange separately.Another issue, though, is that this test case triggers robustness issues. For example, changing the accuracy parameter from 0.18 to 0.3 in the code trips a panic corresponding to no real roots of the quartic equation. At the minimum, this code should be changed to report a lack of solution so it can be recovered, rather than panicking.
219561.txt
The text was updated successfully, but these errors were encountered: