Number of Ngons vs mesh faces conflict

I wrote a script back in 2021 that converts Breps / polysurfaces into ascii data. This has now ceased to function. The script simply takes a brep/polysurface, checks if the faces are planar, meshes it and creates ngons. This step was necessary as previously brep faces that could be quad mesh faces were being meshed as two coincident triangles. From the looks of it, something has since been updated both in the most recent update of Rhino 7 and 8 that has resulted in a conflict in the number of mesh faces and ngons. A simple example: create a rectangle, extrude it to create a solid. If I mesh it, the mesh results in six faces. If I use “mesh.Ngons.AddPlanarNgons” and check the number of ngons, it is five. Previously in a simple case such as the example, the number of mesh faces and ngons would have matched or at worst, the mesh would have contained coincident triangles that were merged when the ngons were created. Can any of the developers confirm this behaviour or explain why the number would differ?

Hi @jouni.valli,

Is there a model you can share that demonstrates what you are observing? If you hsve sample script code that isn’t working how you want, we’re happy to look at that too.


– Dale

Hey @dale, sorry for the delay in response. Finally got the time to debug it a little more. The issue stemmed from the document tolerance in the end: somehow my colleague had received an external file with a document tolerance in the e-8 range. The script currently uses the document tolerance by default which ended up in the issue where a brep as previously described would be meshed with 6 faces, but then only have 5 ngons. Once I modified the document tolerance to 0.001, it all worked normally. Apologies for the oversight.

1 Like