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

Implicit linesimplify in read should apply only on curved parts #31

Closed
abey79 opened this issue Apr 29, 2020 · 0 comments · Fixed by #88
Closed

Implicit linesimplify in read should apply only on curved parts #31

abey79 opened this issue Apr 29, 2020 · 0 comments · Fixed by #88

Comments

@abey79
Copy link
Owner

abey79 commented Apr 29, 2020

Currently it applies on everything, potentially messing with polylines.

Shapely's simplify() must be applied on a line-by-line bases! (see #34)

cc @nbremer

@abey79 abey79 mentioned this issue Nov 19, 2020
17 tasks
abey79 added a commit that referenced this issue Nov 24, 2020
- test_files now ignore svg prefixed with _
- read: now simplify is OFF by default
- read: now can enable multiprocessing
- read_multilayer_svg works
- simplify is now only applied on curved element (not polylines, etc.) fixes #31
- mypy added to project
abey79 added a commit that referenced this issue Nov 25, 2020
SVG read operation have been massively improved by replacing svgpathtools with svgelements and rewriting the parsing operations. Thanks a lot to @tatarize for his support in the process.

`read` command:
* Execution time drastically reduced in most cases.
* Improved robustness to various aspects of the SVG spec.
* Now geometries are cropped to the SVG dimension (can be disabled with `--no-crop`).
* Line simplification is no longer implicit and must be enabled with `--simplify`
* Line simplification is now applied only on curved elements (circle, arc, bezier, etc.) and element-by-element. Polygon/polylines are not affect by the simplification (use the `linesimplify` command if this is needed)
* Multiprocessed SVG parsing is now optionally available (`--parallel`). It should be only enabled for SVG with many curvy elements and when using `--simplify`. Other situation show no improvements.
* Proper support for SVG with missing or percentage width/height. Use the `--display-size` and `--display-landscape` options to specify the default size (corresponding to 100% width/height).
* Fixed error on with 0-radius arc elements

`write` command:
* Removed the rarely used `--single-path` option.
* Now uses <line>, <polyline> and <polygon> instead of <path>, which improves read time a lot if these SVG are reused in vpype.

Minor fixes:
* mypy added to pyproject.toml
* Added test for non-duplicate consecutive points
* Fixed test_file_* which wouldn't actually fail on error
* added many test SVG files
* test SVG files prefixed with _ are now ignored

Fixes #21 #31 #53 #71 #77 #87 #94
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 a pull request may close this issue.

1 participant