-
Hello, Is this library able to interpolate a closed spline curve ? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The library lacks the ability to set the periodic boundary condition f'(a) = f'(b) which we would need for a closed curve which is smooth at the point where it connects. However, with a small workaround it can still be achieved as a reasonable approximation, see
The correct way to do it:
As a workaround to periodic boundary condition we can let the spline go through the closed curve a few times. It's a bit of a hack but it works well. |
Beta Was this translation helpful? Give feedback.
The library lacks the ability to set the periodic boundary condition f'(a) = f'(b) which we would need for a closed curve which is smooth at the point where it connects. However, with a small workaround it can still be achieved as a reasonable approximation, see
examples/plot_parametric.cpp
. E.g. the below draws something resembling an inf sign:The correct way to do it:
T[i+1]=T[i]+distance(X[i],Y[i], X[i+1],Y[i+1])
.sx.set_points(T,X);
andsy.set_points(T,Y);
with periodic boundary conditions (which is not implemented)x=sx(t);
andy=sy(t);
and …