
Jasper van de Gronde wrote:
Aaron Spike wrote:
... So what can you do? Well, I haven't thought through this yet. But maybe you could make csp's inner lists a special list subclass that has a property for the closedness.
There are a number of tricky issues in SVG paths in general. Apart from the closedness issue you also have, for example, that: M 0,0 M 1,1 L 2,2 Is not the same as: M 1,1 L 2,2 In the sense that they can actually result in different things being displayed if markers are used. So in general it is indeed advisable to keep represent SVG paths exactly as they are given. (If I remember correctly something similar applies for M 0,0 L 1,1 z compared with M 0,0 L 1,1 L 0,0 z; let alone M 0,0 L 1,1 L 0,0.)
Indeed! And I'm quite sure cubicsuperpath.py will screw up in all these cases.
Or maybe you could add an optional parameter to formatPath (or a new function, if that is better API) that closes the path if the first and last points are coincident.
I'm not completely familiar with the specifics of this module, but closing a path if the first and last points are coincident is NOT a good idea. This is something that has finally been eliminated from Inkscape itself (if I remember correctly), and it is NOT a good idea to introduce this in the extensions.
I agree and that is why I suggested turning that bad (but sometimes expected) behavior on with an optional parameter or a different function all together.
Aaron Spike