Closed jimmyland closed 6 years ago
Thanks. I've attempted to contact the author, Phil Schneider, for his opinion.
Alternatively I could do a PR that exposes the error scale factor as a parameter? (and that line would then become iterationError = error * iterationErrorScaleFactor;
?)
The good news is that Philip Schneider recently responded, so I'm hoping he'll look at the code soon and figure out what's the most sensible.
Pinged Philip.
Philip replied: "The suggested change is probably OK." So I've checked it in, and pointed the interested user at this issue for more details.
e.g. if units are such that user's
error
threshold is less than 1, the function will never try to re-parameterize. Based on the usage example (where error is 4.0), I think the intent would be preserved if you just setiterationError = error * 4.0;
bad code is here: https://github.com/erich666/GraphicsGems/blob/4d1d0a0e4f27f72e2930d369fa7132a253468bcf/gems/FitCurves.c#L113 (and iterationError is used at line 146)