How to remove correctly one ngon from mesh?


#1

I tried to remove ngon from mesh:

        Rhino.RhinoApp.WriteLine(mesh.Ngons.Count.ToString());
        //mesh.Ngons.RemoveNgons(id);
        mesh.Ngons.RemoveAt(0);
        Rhino.RhinoApp.WriteLine(mesh.Ngons.Count.ToString());

I printed before number of ngons before removing and after.
I get the same number. Visually ngon is not present anymore. But it counter says differently.

How to remove ngon correctly?


(Dale Fugier) #2

What you are doing is correct. The MeshNgonList.Count property won’t shrink until the mesh is copied or added to the document as the ngon data structure is not removed from the list.

– Dale