Curve.Reverse() Keeps failing?

I cant wrap my head around why Curve.Reverse would ever fail. It seems like an operation that can always be successful with this algorithm:

reverse the list of control points.
reverse the list of knots.
remap the list of knots such that knot[i] = knot[0] - knot[i].
remap the domain (however that is implemented).

The curve that I am trying to reverse .IsValid == true.
The curve that I am trying to reverse can be reversed in rhino with the flip command.
The curve that I am trying to reverse can be reversed in grasshopper with the flip curve node.

Any tips on how to flip a curve in rhino common would be immensely helpful :slight_smile:

I found the issue. It seems that reverse curve can fail if the Curve is a BrepEdge. I think that it would be great if this and any other failure case was added to the docs.

Best,
Nick

1 Like