C# reverse a curve using a guide curve

Hi everyone,

I’m wondering how to make a function in c# component similar to grasshopper component “flip curve”.
Gh flip curve is really handy, it can ensure my input curves are following the same direction.
In rhinocommon, however, I only find a “reverse” function without an optional guide curve in curve structure.

Does anyone know how to implement flip curve by a guide curve in c#?
Or it’s easier to load gh component library in C#, and directly make use of flip curve gh function?

Regards,
Shaun

Hi Shaun - see Curve.DoDirectionsMatch()
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Curve_DoDirectionsMatch.htm

-Pascal

Thank you Pascal!