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

Divide a circle into four arcs for more precision #269

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

hyrodium
Copy link
Contributor

@hyrodium hyrodium commented Sep 5, 2023

This PR fixes #268.

  • The number of control points still depends on the radius of the circle. For example, circle(Point(0,0), 500) consists of eight Beziser segments. (Before this PR, it was six segments)
    • This is because Cairo divides the target arcs into Bezier segments based on some atol.
    • I think the best way is adding atol and rtol to Luxor.circle as keyword arguments and approximate the target circle in this package. But I'm not sure that kind of flexibility is desired.
  • Some other functions such as pie and arc2r still have the precision issue.
  • Checking the precision of the circle would be complicated, so I have not added tests for this change.

@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (5e81f15) 73.16% compared to head (8584fba) 73.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #269      +/-   ##
==========================================
+ Coverage   73.16%   73.17%   +0.01%     
==========================================
  Files          34       34              
  Lines        6753     6756       +3     
==========================================
+ Hits         4941     4944       +3     
  Misses       1812     1812              
Files Changed Coverage Δ
src/curves.jl 96.24% <100.00%> (+0.02%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cormullion cormullion merged commit d7c261e into JuliaGraphics:master Sep 6, 2023
12 checks passed
@hyrodium
Copy link
Contributor Author

hyrodium commented Sep 6, 2023

Thank you for the merge!

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.

Small circles does not have enough precision
2 participants