-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Compounding In Most Writers. #125
Comments
For an extreme example, suppose you stitch 10000 times, each time you move +.333, +.333. It's not enough to move the needle a tenth of a millimeter so it should stitch 3 times in the same spot, then move over and down a tenth of a millimeter, and then stitch there three times. However, it actually stitches 10000 times in the same spot. It should have gone 30 millimeters, it went 0. |
while(stitches) {
x = stitches->stitch.xx * 10.0;
y - stitches->stitch.yy * 10.0;
dx = roundDouble(x - xx); //Or whatever rounding ops are needed.
dy = roundDouble(y - yy);
xx += dx;
yy += dy;
flags = stitches->stitch.flags;
blahEncode(b, (char)dx, (char)dy, flags); This mechanism would fix it. Do the conversion from global to local, find the change, do the rounding. Then implement xx, yy as the sum of the rounded values. You also don't need to keep converting from mm to tenths. |
See, inkstitch/inkstitch#231 for discussions of the bugs in the wild. With the exception of .dst it will affect most of the writers. Exp, Jef, Hus at a minimum. |
fixed in commit e5d5f1f |
This mechanism doesn't work. The error is introduced during the rounding of the dx, dy and that isn't tracked. The values of xx, yy, need to be the needle position given the summation of the actual dx, dy values given.
It needs to have the value of xx, yy the sum of the dx, dy values. And to round at the calculation of dx, dy.
The text was updated successfully, but these errors were encountered: