abey79/vsketch

unify svg output codepaths

Opened this issue · 0 comments

Over in #344 we're talking about changing the way we save parameters into the generated SVG, and I discovered that there are currently (at least) two ways to save an svg: first, via the GUI by clicking the Like button, and second via the command line with vsk save.

Those two features use separate codepaths. The GUI uses DocumentSaverThread while the CLI uses _write_output, an inner function of the CLI's save function. Ultimately they both call vpype's write_svg method, but they arrive there by different paths.

@abey79 said: "I think all save methods (like, vsk save) should lead to the same result." I agree, so I wanted to open this issue to discuss how we get there. My opinion is that I think it should be a method SketchClass, or Vsketch if that makes more sense. The thread and the CLI should have minimal logic around saving, just calling the upstream method.

I'm happy to put in a PR for this, I just wanted to have a clear plan first.