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

Brachio Plots the file always mirrored #3

Open
Trampf opened this issue Apr 11, 2020 · 2 comments
Open

Brachio Plots the file always mirrored #3

Trampf opened this issue Apr 11, 2020 · 2 comments

Comments

@Trampf
Copy link

Trampf commented Apr 11, 2020

When I try to plot words it always plots them mirrored.

The same if I mirror it beforehand in Inkskape.

Any ideas?

@Findus23
Copy link
Owner

Hi,

Hm, as said before my script just extracts the coordinates listed in the SVG file. But I think I remember that my outputs were mirrored too and I never got around to fixing it before I stopped working on it.
Maybe BrachioGraph is mirroring the files internally or (more likely) I have a different corner defined as (0,0).

The same if I mirror it beforehand in Inkskape.

This is because if you mirror in Inkscape it won't change the paths.
transform="matrix(-1,0,0,1,127.48464,0)">

If you have the following image consisting of one group of two lines

<svg xmlns="http://www.w3.org/2000/svg" width="210mm" height="297mm" viewBox="0 0 210 297">
  <g fill="none" stroke="#000" stroke-width="9.665">
    <path d="m 35.814116,18.505152 1.069078,38.486812 25.123335,-1.069078"/>
    <path d="m 74.639005,17.903582 1.069078,38.486811 25.123327,-1.069078"/>
  </g>
</svg>

and then you mirror the group in Inkscape, it does not modify the paths of the lines (my script only reads the m 35.814116,18.505152 1.069078,38.486812 25.123335,-1.069078), but just applies a transformation matrix to the whole group.

<svg xmlns="http://www.w3.org/2000/svg" width="210mm" height="297mm" viewBox="0 0 210 297">
  <g transform="matrix(-1,0,0,1,132.02034,0)" fill="none" stroke="#000" stroke-width="9.665">
    <path d="m 35.814116,18.505152 1.069078,38.486812 25.123335,-1.069078"/>
    <path d="m 74.639005,17.903582 1.069078,38.486811 25.123327,-1.069078"/>
  </g>
</svg>

So I think you can avoid this by ungrouping all elements in inkscape or running the file through svgo (for example with this amazing website: https://jakearchibald.github.io/svgomg/)

@Findus23
Copy link
Owner

Findus23 commented May 3, 2020

See also evildmp/BrachioGraph#84 for someone mentioning the same.

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