Added a function to clip a curve after a certain length.