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

Add SVG export to schematic-/board editors #656

Merged
merged 3 commits into from Feb 13, 2020
Merged

Add SVG export to schematic-/board editors #656

merged 3 commits into from Feb 13, 2020

Conversation

ubruhin
Copy link
Member

@ubruhin ubruhin commented Jan 20, 2020

Allows to export schematics and boards as SVG files.

Unfortunately it adds the dependency to qt5-svg (probably only relevant on Linux), thus I'm not sure if this should be postponed to the next major release...

Fixes #345, although it does not provide *.png export yet. But with graphics software it's easy to convert the *.svg to *.png with desired resolution.

@dbrgn
Copy link
Member

@dbrgn dbrgn commented Jan 21, 2020

Nice!

Some things I noticed:

  • The yellow rectangles for a symbol appear above the text. The text is still readable due to alpha transparency of the symbol rectangle, but the text is grey instead of black and it cannot be selected without moving the symbol rectangle to the bottom. Not a big issue, but maybe it can be solved easily?

2020-01-21-112413_779x414_scrot

  • The "grab crosses" are exported in the SVG:

2020-01-21-112319_675x513_scrot

2020-01-21-112657_387x306_scrot

That's probably unnecessary?

  • In the board export, there are a lot of empty groups:
<g fill="none" stroke="#000000" stroke-opacity="1" stroke-width="1" stroke-linecap="square" stroke-linejoin="bevel" transform="matrix(0,3.52778,3.52778,0,684.774,392.282)"
font-family="Sans Serif" font-size="31.75" font-weight="400" font-style="normal"
>
</g>

They probably increase the file size considerably. (My export is 1.4 MiB.)

@ubruhin
Copy link
Member Author

@ubruhin ubruhin commented Jan 22, 2020

The yellow rectangles for a symbol appear above the text.

In the board export, there are a lot of empty groups:

These things are handled by Qt (I just render the QGraphicsScene into an SVG), thus I don't know how to fix that easily. I think it's not worth the effort to investigate these issues...

The "grab crosses" are exported in the SVG:

Yeah that's a limitation of the current concept. The SVG export just uses the layer stack of the schematic editor, and since the crosses are visible there, they are also visible in the SVG. I think we should completely separate the whole QGraphicsScene/Item stuff from the data structure (see also #67), then it would be much easier to use different rendering settings for the different exports. But that's a heavy task, it will take some time to do that refactoring. Afterwards we can make the SVG export (and many other features) much more powerful.

@ubruhin ubruhin marked this pull request as ready for review Feb 8, 2020
@ubruhin
Copy link
Member Author

@ubruhin ubruhin commented Feb 8, 2020

I added the qt5-svg package to the Docker containers used on CI, now CI succeeds and this PR is ready so far.

Probably I'll still include this change in the 0.1.4 release since installing qt5-svg shouldn't be an issue for packagers...

@ubruhin ubruhin added this to the 0.1.4 milestone Feb 8, 2020
@ubruhin ubruhin merged commit bb1359c into master Feb 13, 2020
11 checks passed
@ubruhin ubruhin deleted the add-svg-export branch Feb 13, 2020
ubruhin added a commit that referenced this issue Apr 22, 2020
Add SVG export to schematic-/board editors
(cherry picked from commit bb1359c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants