plottertools / vpype-gcode

gcode extension for vpype
MIT License
36 stars 7 forks source link

Allow providing the output unit instead of the scale #3

Closed theomega closed 3 years ago

theomega commented 3 years ago

Fixes #1

theomega commented 3 years ago

So, one challenge with this PR and this is one thing I don't understand: G20 in gcode means that the units are in inches. Now the scale in the original code was 0.2645833333333333 This is according to the vype code the conversion for mm and not for inches. https://github.com/abey79/vpype/blob/master/vpype/utils.py#L36

>>> 1.0/(96.0 / 25.4)
0.2645833333333333

I don't completely understand this, why did this work previously. Any idea @tatarize ?

I'm plotting myself on a plotter, but in mm mode (G21), and I'm using exactly the same scale.

tatarize commented 3 years ago

ok, I can test this and add it in short order if it's good.