Mesh ngon order

As I’ve understood it, ngon.BoundaryVertexIndexList() returned an ordered list.
But I get an intersecting polyline from this mesh (originally generated in sketchup).

Is there anyway to get a loop from the ngon?



210218 mesh ngon (12.6 KB)

Hey @jonm,

The ngon list seems a bit hosed. If you bake the mesh and then run DeleteMeshNgons followed by AddNgonsToMesh, everthing looks good.

– Dale

Hi @jonm,

The implementation for ngon.BoundaryVertexIndexList() is wrong.

Try using MeshNgonList.NgonBoundaryVertexList() instead, I just made it work better. The ngons that are made in the sketchup importer are good, they just don’t have the m_vi list ordered. The m_vi list does not necessarily contain only boundary vertexes either, it can contain interior vertexes. See ON_MeshNgon::m_vi