GetNgonAndFacesEnumerable bug

When run for the first time on a mesh, GetNgonAndFacesEnumerable returns the a list of Faces and MeshNGons concatenated (faces which are used by the ngons therefore appear twice). Every next time it returns just the MeshNgons (with faces casted to MeshNgons, each face appears only once).
I think it might have to do something with the way the ngons are handled by the Duplicate function, as writing my own deep copy function seems to fix the issue.

Hi @MateuszZwierzycki,

This seems to produce the same result:

import Rhino
import rhinoscriptsyntax as rs

def TestGetNgonAndFacesEnumerable(count, mesh):
    if mesh:
        print "Pass", count
        for ngon in mesh.GetNgonAndFacesEnumerable():
            print ngon
mesh_id = rs.GetObject("Select mesh", rs.filter.mesh)
if (mesh_id):
    mesh = rs.coercemesh(mesh_id)
    for i in range(3):
        TestGetNgonAndFacesEnumerable(i, mesh)

Perhaps we need more information and a simple example?

– Dale