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

Update io.py to add no_basic_shapes option #247

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

vmario89
Copy link

@vmario89 vmario89 commented Apr 4, 2021

Added option in write_svg to write svg:path instead of svg:line, svg:polyline and svg:polygon. You need to set no_basic_shapes to True to write svg:path elements. Else the default behaviour writing basic elements is kept

Description

to be completed

Checklist

  • feature/fix implemented
  • code formatting ok (black and isort)
  • mypy vpype vpype_cli tests returns no error
  • tests added/updated and pytest succeeds
  • documentation added/updated
    • command docstring and option/argument help
    • README.md updated (Feature Overview)
    • CHANGELOG.md updated
    • RTD doc updated and building with no error (make clean && make html in docs/)

Added option in write_svg to write svg:path instead of svg:line, svg:polyline and svg:polygon. You need to set no_basic_shapes to True to write svg:path elements. Else the default behaviour writing basic elements is kept
Copy link
Owner

@abey79 abey79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! There are a few change that would be needed before it can merged, though:

  • The essence of this feature is to reduce inkscape loading time. This should be benchmarked, but I think a single, monolithic <path> with multiple M commands would be faster than multiple <path> commands
  • See my comments in the code.
  • Optionally, this PR would include an update to the write command to expose the single_path parameter. I can also deal with that in a separate PR too.
  • Tests should be added and obviously linting should be fixed.

vpype/io.py Outdated Show resolved Hide resolved
vpype/io.py Outdated Show resolved Hide resolved
vpype/io.py Show resolved Hide resolved
vpype/io.py Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 8, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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