On Dec 24, 2015 03:21, "Papoj Thamjaroenporn" <pt2277@...3110...> wrote:
By connected I mean, say I feed in a Circle into Path, and then convert
Path to pwd2 type. Now, if I convert this back using path_from_piecewise, I get PathVector. But I prefer to get a Path back and I know that the input curves share final point and the next initial point. Is there a way to convert such PathVector to Path?
If there is always only one path, just use pv[0].
If there can be multiple paths, but the final point of each path coincides with the initial point of the next path, then IIRC you can iterate over the pathvector and call append() with each path in turn:
Path result(pv[0].initialPoint()); for (unsigned i = 0; i < pv.size(); ++i) { result.append(pv[i]); }
You can also turn on stitching for the result path if the points do not exactly coincide. This has to be done before any append operation, of course. Stitching will add line segments so that the path remains continuous.
result.setStitching(true);
Best regards, Krzysztof