Skip to content
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

More fixes for strokes #326

Merged
merged 1 commit into from
Dec 7, 2023
Merged

More fixes for strokes #326

merged 1 commit into from
Dec 7, 2023

Conversation

raphlinus
Copy link
Contributor

Fixes a couple of non-working cases: stroke of an empty path, and a tricky co-linear case where the numerical robustness of the quadratic solve becomes poor.

Fixes a couple of non-working cases: stroke of an empty path, and a tricky co-linear case where the numerical robustness of the quadratic solve becomes poor.
@@ -502,7 +505,7 @@ impl StrokeCtx {
let c2 = p[3] - 3.0 * p[2] + 3.0 * p[1] - p[0];
let roots = solve_quadratic(c0, c1, c2);
// discard cusps right at endpoints
const EPSILON: f64 = 1e-12;
const EPSILON: f64 = 1e-6;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's worth spending some time rationalizing all the accuracy parameters sometime (saying why they are the value they are, or if they are arbitrary).

@raphlinus raphlinus merged commit af6f71e into main Dec 7, 2023
14 checks passed
@raphlinus raphlinus deleted the more_stroke_fix branch December 7, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants