Closed vytis closed 4 years ago
Thanks for the feedback, this is very useful. I see how this could be confusing.
On several occasions I did use the ability to do (relative) scale
with units in factors, especially when using script
or writing plugins. This allows me to use arbitrary units when generating geometries (for example a regular grid whose cells have unit width and height) and subsequently scale it to a predictable physical size (the unit-cell grid, when scaled with scale 1cm 1cm
, would then have 1cm-sized cells, irrespective of the number of cell). This (admittedly advanced) use-case leads me to reject (1) and, thus, (2).
Having a separate scaleto
command (for the lack of a better name) would definitely make sense, and would be easy to implement. I further think than it should default to the keep proportion behaviour since its the most common use-case, with an option to tight fit. Would that make sense to you? Any proposal for the command name?
Makes sense, I didn't think of this use case.
So as I understand the --to
parameter would be dropped and scaleto
would then be the same as what scale --to
is now? I don't have any preference on the naming to be honest...
Yes, scaleto
would be the same as scale --to --keep-proportions
, with an option to not keep proportions.
Further commit d2be51fbea6de3bf1a14abf4b9c592aa50614837 to default to keeping proportions.
I am trying out
vpype
and hit a problem early on. At first I thought it's a bug:vpype read foo.svg scale 10cm 10cm write scaled.svg
However I should have actually used
--to
to achieve what I want:vpype read foo.svg scale --to 10cm 10cm write scaled.svg
The resulting file initially was huge as the factor that it was scaled with is actually centimetres converted to px:
There could be few things that would have helped me to see what goes wrong:
scale
would error out when passed size with units.scale
would default toscale --to
when passed size with units.