Inconsistent mesh validity test between Rh6 and Rh7

Dear McNeel team,
It seems that the mesh validation method in Rh7 is more strict than in Rh5 and Rh6, thus leading to disappearing meshes.
Please see the attached GH file with an internalized mesh opening perfectly fine in previous versions, but marked as invalid in Rh7 (default settings everywhere, file in mm) with the following log:
“ON_Mesh.m_F[11914] has degenerate float precision vertex locations.”

Do you have a suggestion to avoid this issue? In our case it happens randomly when using Mesh.Transform, I suppose it’s related to precision / rounding in the test.

Best regards,

Invalid (268.6 KB)

I also had the same issue with Cockroach plugin in C++ when computing normally not the most clean meshes using Poisson Surface Reconstruction, in Rhino 6 it works most of the time, while in Rhino 7 most of the time fails.

The workaround I have, is to rebuild mesh faces. And skip ones that have coincident vertices because mesh faces are usually very small from Poisson, adding to tolerance issue you were referring to.

As a solution I use this code:



                ON_Mesh meshRebuilt(mesh.FaceCount(), mesh.VertexCount(), false,  false);

               for(int i = 0; i < mesh.VertexCount(); i++)
                    meshRebuilt.SetVertex(i,mesh.Vertex(i) );

               for(int i = 0; i < mesh.FaceCount(); i++){
                   auto f = mesh.m_F[i];
                   int a =[0];
                   int b =[1];
                   int c =[2];
                   if (a != b && a != c && b != c)  
                         meshRebuilt.SetTriangle(i, a, b, c);

                        meshObj= context.m_doc.AddMeshObject(meshRebuilt);
                        objRef = CRhinoObjRef(meshObj);
                        RhinoApp().Print(L"Mesh Added End \n");
                     } else{
                        context.m_doc.ReplaceObject( objRef, meshRebuilt );
                        RhinoApp().Print(L"Mesh Replaced End \n");

Hey @t.schwartz,

Nice to hear from you.

Rhino 7 is a bit more strict on meshes. In this case, the fix should be pretty simple (attached). (271.1 KB)

– Dale

Dear Petras & Dale, thanks a lot for your prompt replies. Culling degenerate faces seems to work!
Have both a nice evening, T.