4 point mesh face with collapsed edge - shading issue

Hi,

I have small issue with shading when I draw 4 point mesh face, where two points are on the same location.

What would be the way to either remove one point or unweld. Unweld command in rhino does the trick. but this one in rhinocommon does not help:

private void RunScript(Mesh x, object y, ref object A)
  {
    Mesh m = x.DuplicateMesh();
    m.Vertices.CombineIdentical(false, false);
    m.Unweld(0.00, true);
    m.Vertices.CombineIdentical(false, false);
    A = m;
  }

shading.gh (5.7 KB)

Hi @Petras_Vestartas, i can see a change if i add this at the end:

m.Normals.ComputeNormals(); 

_
c.

After that add:
m.UnifyNormals(false);
to see if this helps.

Sent from my phone so not tested yet.
Regards,
Terry.