Can anybody explain why a proportionally scaled object is not snapping back to its original position?
To make it more clear:
Disable all snapping options, except snap to Cusp node.
The corner of the green square has been placed such that it snaps to the corner of the red square.
The squares are 20x20mm and have no stroke.
Now hold the Ctrl-Key and take the upper right diagonal handle of the green square and drag the size of the green square to size it proportionally. If you pass by the lower left corner of the red square it will snap to the corner. That's what is expected.
Now, when having the green square somewhat smaller release the Ctrl-Key.
Then, hold the Ctrl-Key again and try to do the same again.
Now it will not snap anymore to the red corner. (Well, sometimes it does, sometimes not)
Why is this? I guess that because of numerical rounding errors?
If I do not use the Ctrl-Key and let the width/height ratio change, it of course will somehow snap to the red corner. And if I then look up the height and width in the XML-Editor (Shift+Ctrl+X), the size of the rectangle is e.g. width=20mm, height=20.00000762939453
Can this be avoided in order to get snapping as expected?
Actually, I would like to use it for proportional scaling (with respect to the rotation center) & snapping, i.e. with holding Shift+Ctrl-Key.
Snapping: Imprecision after proportional scaling
Snapping: Imprecision after proportional scaling
Win7/64, Inkscape 0.92.2
Re: Snapping: Imprecision after proportional scaling
Sounds that you already got the answer for your first question.
Like if you pull a guide line to the node in the red corner either horizontally or vertically, the green node would snap to it -meaning you can preserve either the exact height or the width of the green object.
The difference is not visible nor legible in the 3 digit input fields, but in the svg codes the coordinate's are slightly different of an original and a down and upscaled duplicant.
"Scaleable" vector graphics with a 16 digit limit and whatnot. These are the merits where a cad program would also fail because the problem is conceptual more or less.
Like if you pull a guide line to the node in the red corner either horizontally or vertically, the green node would snap to it -meaning you can preserve either the exact height or the width of the green object.
The difference is not visible nor legible in the 3 digit input fields, but in the svg codes the coordinate's are slightly different of an original and a down and upscaled duplicant.
"Scaleable" vector graphics with a 16 digit limit and whatnot. These are the merits where a cad program would also fail because the problem is conceptual more or less.
Re: Snapping: Imprecision after proportional scaling
Right, I am aware with finite precision you always will have an issue.
I just noticed, for demonstrating random inaccuracy I do not even need Shift or Ctrl.
Just drag the top right corner of the green and deform it to a rectangle. Everytime you let it snap back to the red corner you will get different values for width and height e.g. from 19.9999942779541 to 20.00000381469727, sometimes I even get exactly 20 mm again.
I am just wondering, since the red corner has a fixed coordinate which does not change while deforming the green square. Why should I get everytime a different value for the width and height of the green square?
Let me ask another question: Is there maybe a setting which tells Inkscape to calculate with 16 digits but round to 8 digits. Or here maybe 6 digits and hence nevertheless snapping when using Ctrl+Shift for scaling?
My settings are
Menubar | Edit | Preferences | Input/Output | SVG
Numeric precision 16
Minimum exponent -8
Well, you can also create a guide with 45° through the red corner. However, you will have the same issue with varying numbers.
I just noticed, for demonstrating random inaccuracy I do not even need Shift or Ctrl.
Just drag the top right corner of the green and deform it to a rectangle. Everytime you let it snap back to the red corner you will get different values for width and height e.g. from 19.9999942779541 to 20.00000381469727, sometimes I even get exactly 20 mm again.
I am just wondering, since the red corner has a fixed coordinate which does not change while deforming the green square. Why should I get everytime a different value for the width and height of the green square?
Let me ask another question: Is there maybe a setting which tells Inkscape to calculate with 16 digits but round to 8 digits. Or here maybe 6 digits and hence nevertheless snapping when using Ctrl+Shift for scaling?
My settings are
Menubar | Edit | Preferences | Input/Output | SVG
Numeric precision 16
Minimum exponent -8
Well, you can also create a guide with 45° through the red corner. However, you will have the same issue with varying numbers.
Win7/64, Inkscape 0.92.2
Re: Snapping: Imprecision after proportional scaling
...looks like there is a quantisation of the "arbitrary" numbers of 1.907348e-6 which is 2^(-19). Whatever that means... and wherever it comes from...
Win7/64, Inkscape 0.92.2