Klowner/inkscape-applytransforms

Apply - to what?

Closed this issue · 8 comments

I thought this addon will help me to flatten transformations but i was wrong. It just exchanges one or few transformations add to object into one matrix transformation. I have two apps which i need to import created SVG and they totally don't understand matrix transformation thing. Really don't understand what this addon was for from the very start.

If you can provide any useful info about how you would like this potential issue to be resolved, or can provide example files and expected results, feel free to reopen the ticket.

I really don't know what to do to resolve this. I know (atleast now I know) that all modern SVG editors exchange one or many transforms into one matrix transform. It can be efficient as gives shorted file. But it appeared that not every app (not native SVG editor) can be unable to support this. One of example is Schneider TGML editor. There is no way to force them to add such thing, they openly said SVG is only partially supported.
Still applytransform name is a little confusion - it doesn't apply, it creates one big matrix transform.
Such addon as applytransform should in my opinion ... just remove all transforms by modify object into the final stage (recalculate it's points, vertices, coords into fixed values). Don't know if this is even possible.

Could you provide me with an example SVG that you're trying to remove all matrix transforms from?

I didn't check for response here because was sure there won't be any.
The function to attach files is not working on my end so i can only put a svg code into.
After analyzing applytransform.py code i see You are using functions from simpletransform.py. It clearifies transforms from polygones for example but for rects, and ellipses it leaves me with matrices. How beautiful matrix is and may be, some tools are don't understand matrices at all.
It would be hard to remove matrices from rects because it uses X,Y and width and height and there is no rotate thing in attributes (or maybe there is but i don't know). Rotate is acceptable though.

I can't attach anything here, and can't paste code as well. Probably older firefox prevents this. Just draw in inkspace some rect, rotate it, move it and flip. Inkscape will generate matrix for all three transforms which Your addon leaves intact.

I didn't check for response here because was sure there won't be any.

... so you just filed a ticket to complain?

No, You have asked me to give more details in april and I responded after 3 months. I check such portals from time to time. If I expected response i would answered earlier.
For now, i work on files produced by Illustrator CS6 (my friend has to save files for me). Somehow CS6 exporting from AI format is applying transformations permanently. No translate, rotate, scale or matrix. Just plain SVG.
As i mentioned, applytransforms gaves good results for polylines and polygones, but transformed rect or ellipse it can flat only to matrix transformations (which one is the worst i can get). This is probably due to what simpletransform.py can offer. There is computeBBox method although, which seems to manage rect somehow differently than by matrices but don't know if it is suitable to reduce transformations.

What do You mean about "ticket to complain"? Is there some other page I can fill such ticket?

One more question - inkscape is saving points definition of polygones in format:
points="X1,Y1 X2,Y2 X3,Y3" ... and so on.
Your addon is parsing polygones points considering such notation as reliable.
But when optimized svg in inkscape is choosen as a file format then inkscape removes all commas from points definition - each number in points="" is separated only with space. I don't know if this meets SVG standard or not, but when addon meets such defined polygones it just removes them from drawing.