abey79 / vpype

The Swiss-Army-knife command-line tool for plotter vector graphics.
https://vpype.readthedocs.io/
MIT License
687 stars 61 forks source link

Question about units #252

Open vmario89 opened 3 years ago

vmario89 commented 3 years ago

Hey, using vpype i was wondering what units are supported. For different commands and parameter sets we can use things like tolerances, margins, etc. - but what units are allowed to use?

it looks like

abey79 commented 3 years ago

Hey, the supported units are here: https://github.com/abey79/vpype/blob/cca750b42575c8c513eb4b05fb917e071819b016/vpype/utils.py#L33

Feel free to open a PR with more units, it should be a matter of just adding to the dictionary.

As for "%", I'm not sure how it could be used. The input SVG's (if any) DOM is completely lost in vpype's pipeline (except for the layer management), so it cannot be used as in SVG. It could be relative to the current page size (if any is defined, which is not necessarily the case), but it would be tricky to attempt (% tolerance should be % of width or height?) and probably useless for the user.