Sine around a curve

Thank you. However, it seems it is not working for closed curves.
image