UnrollSrf creates lots of control points on Curve

so I have a polysurface with a curve on it like so:

The curve has few control points and is clean:

After I use UnrollSrf and have the curve follow along the geometry the curve becomes ugly with lots of control points, even though the input surface is planar

SimplifyCrv doesn’t fix it. What’s going on here? Why is this happening and how do I avoid this from happening?

(I know I can fix this easily by just drawing a new curve on top of it, but this is happening in a plug-in of mine which uses the same code as UnrollSrf and causes other problems further along so I’d like to find out what causes this)

220809 UnrollSrf with curve.3dm (163.8 KB)

Hello - Yeah… it does seem like maybe in the special case of planar input the process could be simplified to avoid refitting - I’ll ask.
@siemen - looking at this a little more - if the base surface is a planar surface (PlanarSrf from the border of the surface you have ) and the polyline is on that surface, it stays simple on unrolling.

Maybe I don’t understand, but if you take the border of the surface and do planarsrf, doesn’t that mean that the original surface already was planar? What exactly is the difference between the old planar surface and the new planar surface?

Hello- the surface is planar, or near enough for the border to make a planar surface, but the the way it is structured makes for some slight deviations from a pure rectangular UV - the V direction isos are ever so slightly not straight - now, I do not know about what goes on under the hood in unrolling, but I can see that Rhino cannot extract a plane from that surface and presumably unrolling does the refitting in that case.