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

Line intersection loses lot of accuracy #910

Open
SkiFire13 opened this issue Jun 12, 2024 · 1 comment
Open

Line intersection loses lot of accuracy #910

SkiFire13 opened this issue Jun 12, 2024 · 1 comment

Comments

@SkiFire13
Copy link
Contributor

Reproduction: run cargo run show "M40000 40000 a 12 12 0 0 0 0 -24" on the main branch (8d6bb2d)

Result:
Screenshot at 24-06-12 ! 09-07-49

The problem seems to be that the conversion step from arc to quadratic bezier involves computing the control point as the intersection of two lines. However due to the (relatively) high coordinates this results in a non-negligible error that really messes up the curve when you zoom in.

In my usecase I have some svgs where the bottom right corner in this numeric range and the errors are pretty evident in that area.

@nical
Copy link
Owner

nical commented Jun 13, 2024

Thanks for filing this and providing a simple test case. I don't have a lot of time to spend on this these days so I don't promise a fix soon, but your analysis sounds right and it would be worth avoiding the intersection here.

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

No branches or pull requests

2 participants