Author Topic: Optimized SVG - polygon points  (Read 463 times)

July 18, 2019, 03:51:41 AM
Read 463 times

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
Hello,
how, according to standard, should polygon points pairs been defined - separated by comma or by space?
points="585.0068359,346.8818359 585.0068359,350.6582031 598.3803711,351.8193359
or points="585.0068359 346.8818359 585.0068359 350.6582031 598.3803711 351.8193359?

The first way (with comma as a separator beetween X and Y) works in inkscape or clean svg format.
The second way (each numer is separated with space) when optimized svg is choosen.
No comma breaks apply transformation plugin - it just removes all such polygons instead of flatten transformations on them.
  • 0.92.3
  • Win7x64

July 18, 2019, 07:13:34 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
This question is too much over my head to try and give you an answer.  But I would be interested to investigate.

Do I understand that you're using a particular extension?  If so, which one?

I don't see one called "Tranformation", that's pre-installed.  But there are appox 300 external extensions which can be installed.  If it's an external extension, it might be best to contact the author for that particular one.

Maybe this one?  https://github.com/juanfran/svgo-inkscape 

Or did you maybe just do Save As SVGO ?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 19, 2019, 04:34:35 AM
Reply #2

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
Normally coords in pair are separated with comma and pairs separated with space. I met this notation on every websites describe SVG standard. This notation is used in Inkscape in Inkscape SVG or Clean SVG formats. But when Optimized SVG is choosen then each number is spearated with space only. There is no comma in notation.
The addon i have mentioned is not builtin but was recommended here as a way to remove transformations from objects. It is named applytransforms (h**ps://github.com/Klowner/inkscape-applytransforms).
It just expects pairs of points with comma and without it it just removes such polygones.
If no comma notation meets the standard then the addon needs to be fixed. But if no comma is out of the standard then Inkscape needs to be fixed.

As a PS i can say that Optimized SVG file resembles most the file produced by Adobe AI CS6. I like the cleanliness of AI produced SVG. Except AI is still using comma to separated points. SVG file produced by Inkscape seems quite dirty. Especially folding.

As a second PS - still miss the full apply transform function in Inkscape.
  • 0.92.3
  • Win7x64

July 19, 2019, 08:46:55 AM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Oh ok, I understand now.  Well, I understand in a very general way, but not enough to respond to your concerns.

Don't the nodes of the polygons come in pairs though?  If I draw a polygon, and look in the XML Editor, the d attribute values use the comma and space routine.

Or does the extension look at the attributes with "sodipodi" in the name?  Those look like they might be coordinates?

Hhmm....  I don't suppose converting your polygons to paths would be a reasonable solution?

Well, we have one or 2 members who I think can probably....well, at least have more helpful comments than me.  I don't know when they will visit though.

But still, to discuss in detail, you should probably contact the author of the extension.  If something is wrong, they can fix it.  If it needs to be bumped up to developers, they can do that too.

(Note that Inkscape developers rarely participate in forums.  Here's more info on how to contact, fyi:  https://forum.inkscapecommunity.com)/index.php?topic=628.0)

Edit
Actually I'm going to move this to the Beyond the Basics board.  There will be a link on the board index page.
« Last Edit: July 19, 2019, 10:02:25 AM by brynn »
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 19, 2019, 09:29:17 AM
Reply #4

Krzysztof

  • Jr. Member

  • Offline
  • ***

  • 40
Yes, polygon points come as a pairs, i noticed this on begining. Inside each pair coords (two numbers) are separated with comma. Pairs are separated with space.
But if i save SVG in optimized format in Inkscape then comma is erased completely. Both pairs and number in each pair are separated with space only. I never met such notation in other places. I wonder if notation without comma still meets SVG standard.
  • 0.92.3
  • Win7x64

July 19, 2019, 10:07:33 AM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Thanks for taking the time to explain it to me.  However, I still can't help. 

You could wait and see if someone here has any comments.  Or you could directly contact the author of that extension.  Or developers.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

July 22, 2019, 05:34:01 AM
Reply #6

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln