Is there a way to convert a path to a string [save it to a file, read it] and convert it back to a path? Something like this:
path p,q;
p := (0,0)..(1cm,1cm)..(3/2cm, -1cm);
write "q := " & pathToString(p) & ";" to "somepath.mp";
write EOF to "somepath.mp";
input "somepath.mp";
draw q;
It's certainly possible to write a function which would reconstruct a path from all the precontrols, postcontrols and stuff, but maybe there's an easier way or a ready solution?
string S[]; path P[]; S[1] := "(0,0)..(1cm,1cm)..(3/2cm, -1cm)"; P[1] := scantokens(S[1]); draw P[1];or something along these lines? Is it too cumbersome to write it like that? – Jan 23 '21 at 21:24