Closed jay-sridharan closed 8 months ago
@jay-sridharan,
My first guess is that your knot values are too small: https://github.com/msteinbeck/tinyspline/blob/master/src/tinyspline.h#L156 Maybe the knot supplied to the evaluation function is not the knot eventually used for evaluation: https://github.com/msteinbeck/tinyspline/blob/master/src/tinyspline.c#L1222
Yes, it looks like this was the issue! Thank you for the help - I just reduced the max knots and made the epsilon smaller.
Hello again!
I came across a pretty interesting issue where I am seeing artifacts around the center of a seven point spline. The fifth-degree spline is formulated with seven control points. The details can be seen in the example scripts I've attached, but here is the symptom:
The x-axis on the plots are "time" - the spline is evaluated at each successive value every 1ms.
Anyway, the spline is moving along smoothly and then around
u = 0.5
, there is a discontinuity. This plot was generated using the artifact.c example. Here is the same data in table form:Note the repeated values (-189.171385)
I constructed the same spline with python (see artifact.py) and get smooth results
You can see that the issue is only in the range where u is between 0.499909 and 0.500098, but otherwise all values match!
Here are the two scripts I used to find this issue:
artifact.c
artifact.py
I tried debugging myself, but got a bit lost when it came to the DeBoor algorithm. Hoping you can spot this relatively quickly! Thanks again for the great library!
Jay