8000 Fix errors in paths containing elliptical arcs by nvictus · Pull Request #9 · nvictus/svgpath2mpl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix errors in paths containing elliptical arcs #9

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

Merged
merged 4 commits into from
Apr 26, 2021
Merged

Fix errors in paths containing elliptical arcs #9

merged 4 commits into from
Apr 26, 2021

Conversation

nvictus
Copy link
Owner
@nvictus nvictus commented Apr 20, 2021

This fixes a couple mistakes in appending arc paths generated using matplotlib:

  1. Covers a couple missing edge cases (start == end and a 0 radius)
  2. Matplotlib assigns a MOVETO command to the beginning of the arc path. We now change it into a LINETO to behave properly within the context of another path.
  3. Depending on the angle of rotation used to generate the initial circular arc, we have to reverse the path generated to make sure the arc gets drawn from our desired start to the desired end.

(2) and (3) were causing problems in many scenarios involving arcs connected to other paths, but did not show up when arcs were drawn in isolation.

Addresses #8

@nvictus nvictus changed the title Fix errors in path creation for elliptical arcs Fix errors in paths containing elliptical arcs Apr 20, 2021
@jjmontesl
Copy link

Yeah! Works wonders.

I'm using your lib to render SVG and fonts, and this fixes the problems I've seen so far. Thank you very much!

image

@nvictus nvictus merged commit 3dd4952 into master Apr 26, 2021
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
0