Question about Principal curvature lines on surfaces

hi,everyone~

When i tried to use this method (from David Rutten&Tom Jankowski Principal curvature lines on surfaces: need some advice please - Grasshopper) to produce principal curvature lines ,I found several lines have sharp turns. some angles between pre-vector and next-vector is nearly 90 degree ,which might cause this problems.


smooth%20principle%20curve
(Chinese means: principal curvature lines on normal nurbs surface)

`
maybe we can rotate this vectors in a slight angle to produce smooth principal curvature lines,just like this picture (following fig).so i set a point to test my thought. and i put following codes into yours,but it did work to specific curve. it cannot apply to several curves.

can anyone give me some advice?
thanks a lot!

If (Not IsNothing(PrevDir)) Then _
_ If (dir.IsParallelTo(PrevDir, 0.5 * Math.PI) < 0) Then _
_ dir.Reverse()

_ End If_
_ if (dir.IsPerpendicularTo(PrevDir,rAngle) then_
_ dir.rotate( fAngle ,crv.Normal)_
_ End If_
End If

PrincipalCurvatures.gh (41.9 KB)