A
A
Arris2017-07-15 20:28:42
inkscape
Arris, 2017-07-15 20:28:42

Inkscape: saving data in a weird way. How to parse and why does inscape do this?

This is a question for inkscape gurus and inkscape hackers.
Using straight lines , draw 2 polygons on the sheet, one inside the other. Select both, then say Path->Difference . We get a polygon "with a hole".
We save the file, look at its structure (insignificant tags and attributes are omitted):

<path d="M 145 493.07617 L 145 630.93359 L 275.71484 630.93359 L 275.71484 493.07617 L 151.42773 493.07617 L 145 493.07617 z M 162.85742 520.21875 L 256.42773 520.21875 L 256.42773 606.64844 L 162.85742 606.64844 L 162.85742 520.21875 z ">

Some kind of crap ... not up to standard .
We shift our strange polygon by one pixel and immediately move it back. Again, save and look at the code:
<path d="m 145,493.07617 0,137.85742 130.71484,0 0,-137.85742 -124.28711,0 -6.42773,0 z m 17.85742,27.14258 93.57031,0 0,86.42969 -93.57031,0 0,-86.42969 z">

And now everything looks the way it should look. It can already be parsed.
But why is this happening? How to make inkscape always generate correct path code?
PS Save format - Inkscape SVG or plain SVG does not affect anything.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question