[Closed] Strange problem using deleteKnot
Hello world.
I’m currently experiencing a weird problem using deleteKnot function in mxs.
I have a spline (using one curve only) that has a lot of knots (3310 in my example), and my current tool uses deleteKnot function to delete the segments by the end (until I reached a specific length).
Everything worked flawlessly until I started working on huge lines, and so with a huge knots count, as I’m using normalize_spline.
For a reason I don’t understand, deleteKnot starts to throw exception when specifying a big value of i, but it’s not a constant issue. Sometimes when i > 2980 it won’t work, sometimes it’ll be > 3000, sometimes less.
numknots $
3310
deleteKnot $ 1 2000
OK
deleteKnot $ 1 3000
-- Runtime error: spline knot index out of range: 3000
deleteKnot $ 1 2990
OK
deleteKnot $ 1 2991
-- Runtime error: spline knot index out of range: 2991
Do you people have the same behavior ?
Glad to hear you solved the problem, I forgot about the deleteKnot function. There’s also the deleteSpline function as well. Too bad there isn’t a built in deleteSegment function.