I was checking the Transform Dialogue Box in Inkscape. I wanted to check the option Preserved under 'Preferences->Behavior->Transform->Store Transformation' as it would keep the original shape always the same and all transformations would be recorded in the transformation data.
The problem I have is that after changing the option whenever I create a new shape it is created with a scaling factor of px to mm. It always includes a transformation data of this scaling. The document I have uses the unit of px when I check it with a text editor. I get the same results with both v1.0.1 and 1.1-beta.
I have found that the issue was in the Document properties. When I changed the user units per px the issue has gone.
My new problem is that, when the document unit is mm and the option Preserver is selected whenever I draw a shape, in XML it is expressed as;
* The shape parameters are the px values for the specified mm values.
* There is a transform converting px values to mm.
Is it the supposed thing to happen? Is it possible to define the object directly in mm from the interface? If you want an example file for this I can send it.
Thanks for your reply. As far as I understand your file has a unit scale of 3.77953. This one cancels the pixel to mm conversion and no transformation is recorded in the file. However this scales all the values seen in the interface by 3.77953.
I was working on it but apparently the values are always expressed as pixels in the shape definition and scaled to match the mm values. Therefore it seems that if I want the scale of 1:1 I need to accept that there will be a transformation. It does not seem possible to me to see width and height values of 100 if I create a rectangle of 100 mm x 100 mm in a document using the unit of mm. It will firstly create the shape with the pixel values and then apply a transformation to match 100 mm.
Thank you both for your suggestions. What Aero suggested works for me and I had already opened the link Tyler Durden shared on one of my tabs and I would give it a detailed read when I have sufficient time.
This is incorrect SVG behavior. I tracked this all the way back to v0.92. Versions before this could also have this issue. It entirely defeats the purpose of the Preserved transform behavior. If the behavior is indeed correct then the Optimized transform behavior is wrong. Take your pick.
I am sure I will get into a furball fight concerning this.
In Inkscape, the "Preserved" and "Optimized" transform behaviors determine how transformations (like scaling, rotating, and translating) are stored and applied to objects. Here's a breakdown of each:
Preserved Transform Behavior Purpose: Keeps the original shape data unchanged and records all transformations in the transformation matrix.
Effect: The transformations are applied dynamically, meaning the shape's original coordinates remain the same, but a transformation matrix is used to display the transformed shape.
Use Case: Useful when you want to maintain the original shape data for further editing or when precise transformations need to be preserved for future adjustments.
Optimized Transform Behavior Purpose: Applies transformations directly to the shape's coordinates, effectively "baking" the transformations into the shape data.
Effect: The shape's coordinates are updated to reflect the transformations, and no transformation matrix is used.
Use Case: Ideal for simplifying the SVG file and making it more compatible with other software that might not handle transformation matrices well.
In summary, "Preserved" keeps the original shape data intact and uses a transformation matrix, while "Optimiz
LOL - this is being applied to any tool used. The behavior is literally converting the path data to pixel units (defeating the purpose of preserved transform) then applying a transform scale to convert it back to mm. Visually it is correct, However, because of the math involved and accumulated rounding errors introduced, it "might" cause profile issues in software such as Autodesk Fusion.
Now compare the behavior when you use optimised transform behavior. The path data is correct, logical and displays correctly.
Unfortunately, Fusion doesn't use the units in the viewbox to determine the unit scalar. It slaps on a 96 dpi scalar on it. Which too ends up wrong.
Hello everyone,
I was checking the Transform Dialogue Box in Inkscape. I wanted to check the option Preserved under 'Preferences->Behavior->Transform->Store Transformation' as it would keep the original shape always the same and all transformations would be recorded in the transformation data.
The problem I have is that after changing the option whenever I create a new shape it is created with a scaling factor of px to mm. It always includes a transformation data of this scaling. The document I have uses the unit of px when I check it with a text editor. I get the same results with both v1.0.1 and 1.1-beta.
Please share an example Inkscape svg file.
I have found that the issue was in the Document properties. When I changed the user units per px the issue has gone.
My new problem is that, when the document unit is mm and the option Preserver is selected whenever I draw a shape, in XML it is expressed as;
* The shape parameters are the px values for the specified mm values.
* There is a transform converting px values to mm.
Is it the supposed thing to happen? Is it possible to define the object directly in mm from the interface? If you want an example file for this I can send it.
Yes, thank you.
The file is attached. The document unit is set to mm as below:
When I draw a rectangle it is created like this. This happens when I use store transformation option of Preserved
Thank you,
Please test with the attached file.
Thanks for your reply. As far as I understand your file has a unit scale of 3.77953. This one cancels the pixel to mm conversion and no transformation is recorded in the file. However this scales all the values seen in the interface by 3.77953.
I was working on it but apparently the values are always expressed as pixels in the shape definition and scaled to match the mm values. Therefore it seems that if I want the scale of 1:1 I need to accept that there will be a transformation. It does not seem possible to me to see width and height values of 100 if I create a rectangle of 100 mm x 100 mm in a document using the unit of mm. It will firstly create the shape with the pixel values and then apply a transformation to match 100 mm.
You could edit the units.xml file in order to achieve what you want.
The factor is changed from 1.00 to 3.779527559055119
I hope Aero's suggestion solves the issue.
In the meantime, here is some background on units handling in Inkscape: https://wiki.inkscape.org/wiki/index.php/Units_In_Inkscape
Thank you both for your suggestions. What Aero suggested works for me and I had already opened the link Tyler Durden shared on one of my tabs and I would give it a detailed read when I have sufficient time.
Filed a bug report: https://gitlab.com/inkscape/inbox/-/issues/11473
This is incorrect SVG behavior. I tracked this all the way back to v0.92. Versions before this could also have this issue. It entirely defeats the purpose of the Preserved transform behavior. If the behavior is indeed correct then the Optimized transform behavior is wrong. Take your pick.
I am sure I will get into a furball fight concerning this.
In Inkscape, the "Preserved" and "Optimized" transform behaviors determine how transformations (like scaling, rotating, and translating) are stored and applied to objects. Here's a breakdown of each:
Preserved Transform Behavior
Purpose: Keeps the original shape data unchanged and records all transformations in the transformation matrix.
Effect: The transformations are applied dynamically, meaning the shape's original coordinates remain the same, but a transformation matrix is used to display the transformed shape.
Use Case: Useful when you want to maintain the original shape data for further editing or when precise transformations need to be preserved for future adjustments.
Optimized Transform Behavior
Purpose: Applies transformations directly to the shape's coordinates, effectively "baking" the transformations into the shape data.
Effect: The shape's coordinates are updated to reflect the transformations, and no transformation matrix is used.
Use Case: Ideal for simplifying the SVG file and making it more compatible with other software that might not handle transformation matrices well.
In summary, "Preserved" keeps the original shape data intact and uses a transformation matrix, while "Optimiz
LOL - this is being applied to any tool used. The behavior is literally converting the path data to pixel units (defeating the purpose of preserved transform) then applying a transform scale to convert it back to mm. Visually it is correct, However, because of the math involved and accumulated rounding errors introduced, it "might" cause profile issues in software such as Autodesk Fusion.
Now compare the behavior when you use optimised transform behavior. The path data is correct, logical and displays correctly.
Unfortunately, Fusion doesn't use the units in the viewbox to determine the unit scalar. It slaps on a 96 dpi scalar on it. Which too ends up wrong.
The SVG Tower of Babel strikes again.