When I rotate and translate a group Inkscape applies a `rotate(angle, x, y)` transformation. I'm doing animation on this object and need to decompose this into a `rotate(angle)` and `translate(x,y)`. Does somebody happen to know the formula I can use to get the decomposed form?
If it were a matrix I'd know how, but I'm unfamiliar with this rotate form.
@inklinea That would indeed by nice, but it's not the case in Inkscape. If you rotate and move a group it will only add a `rotate` transform, using the `x,y` component to bundle in a transform. It's annoying, and I'd prefer a separate translate.
I just wanted to point out that rotate( angle,x,y) is not the same as rotate(angle) translate(x,y)
I had a go with the svg file open in a text editor and inkscape at the same time. It seems grouping and ungrouping removes the entire transform from the group and applies it to the elements inside.
The rules on how it is applied is not 100% clear, I think if an element inside the group already has a transform matrix, then the group transform is added to that, if not it seems to alter the path coordinates directly.
Called 'Apply Transformations' which can apply transformations to objects. I have it installed as part of the complete mightyscape extension set. ( fablab chemnitz > Modify existing paths > apply transformations )
Thanks for the references. "Apply Transform" is definitely something I want. I really want another feature that does the equivalent of move to 0,0, apply transforms, then move back to original position. I want the high-level transform to be pure.
For the rotate decompose I have the code to do it now. I don't need it done within Inkscape, as I put my files through a processing step before being used in my game. The key was that from the `rotate` statement I can now figure out what the equivalent rotate and translate would be.
Flatten sounds good as well. Layers are transforms end up messing with animations in many places. I've been manually resolving them in most cases, but I think simply removing them all would help at times.
When I rotate and translate a group Inkscape applies a `rotate(angle, x, y)` transformation. I'm doing animation on this object and need to decompose this into a `rotate(angle)` and `translate(x,y)`. Does somebody happen to know the formula I can use to get the decomposed form?
If it were a matrix I'd know how, but I'm unfamiliar with this rotate form.
The `rotate(angle, x, y)` should not contain any element of translate in it. They are unrelated.
Have a look at this spec on mdn.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#rotate
Have a look at https://www.w3.org/TR/SVG11/coords.html#TransformAttribute.
It gives the transformation matrices for all SVG transforms.
@inklinea That would indeed by nice, but it's not the case in Inkscape. If you rotate and move a group it will only add a `rotate` transform, using the `x,y` component to bundle in a transform. It's annoying, and I'd prefer a separate translate.
@Ede_123 Thank you.
I just wanted to point out that rotate( angle,x,y) is not the same as rotate(angle) translate(x,y)
I had a go with the svg file open in a text editor and inkscape at the same time. It seems grouping and ungrouping removes the entire transform from the group and applies it to the elements inside.
The rules on how it is applied is not 100% clear, I think if an element inside the group already has a transform matrix, then the group transform is added to that, if not it seems to alter the path coordinates directly.
Also there is an extension which I use to remove transforms at https://gitea.fablabchemnitz.de/MarioVoigt/mightyscape-1.X/src/branch/master/extensions/fablabchemnitz
Called 'Apply Transformations' which can apply transformations to objects. I have it installed as part of the complete mightyscape extension set. ( fablab chemnitz > Modify existing paths > apply transformations )
Or you want to use the nuclear option. ( which can affect strokes and fills ) https://www.raincloud.co.uk/svg/flatten/flatten.html
However I do not think there is a specific way to decompose in the way that you want.
Thanks for the references. "Apply Transform" is definitely something I want. I really want another feature that does the equivalent of move to 0,0, apply transforms, then move back to original position. I want the high-level transform to be pure.
For the rotate decompose I have the code to do it now. I don't need it done within Inkscape, as I put my files through a processing step before being used in my game. The key was that from the `rotate` statement I can now figure out what the equivalent rotate and translate would be.
Flatten sounds good as well. Layers are transforms end up messing with animations in many places. I've been manually resolving them in most cases, but I think simply removing them all would help at times.