# Criteria for checking for extremely short edges in a mesh

I have a mesh which I imported using a Python/C++ script. I checked the mesh for extremely short edges. The criteria I am using is:

Extremely short edge is < 5 x max_range/10^7.22 = 0.000070 where max_range in X,Y,Z for my mesh = 231.7099 m.

My check reports 24 extremely short edges but Rhino’s Mesh Wizard reports 19.

What criteria is Rhino using? It seems to be different from what I found by looking in various Rhino documents.

My other checks all match Rhino:
Number of naked edges
Number of non-manifold edges
Number of duplicate faces & vertices
Number of degenerate faces
Number of intersecting faces (this was fun to code and get right)
Number of disjoint meshes
Number of faces & vertices
Faces with very small area

The only outstanding issue is extremely short edges.

I wrote my code because importing my large meshes (16M - 100M faces) and checking them was taking so long, up to 22 minutes. Now I can import and check the largest in just 25 sec (yes this includes checking for the intersection of 100,000,000 faces which is 10^16 compares before optimization). This is about 50X faster than the Mesh Wizard.

My script has made working with Rhino much more fun. Once I get everything working properly and fully documented, I will post it for your review. Perhaps you will find some easy ways to speed up the Mesh Wizard checking 10X to 50X times.

But for now I would really like to get the criteria Rhino is using for checking extremely short edges so that I can match the Mesh Wizard checking results in order to create good meshes that Rhino likes.

Regards,
Terry.

1 Like

Look at `rhinoSdkMesh.h` in our C++ SDK. There is a class in there called `RhinoCheckMeshOutput`. I can see some of the lines in that class read

``````  // If m_bCheckForExtremelyShortEdges is true then the function will look for topological edges where the distance between the endpoints is less than m_DistanceToCheck.
// m_totalExtremelyShortEdgeCt will contain the total extremely short edge count for all meshes.
bool m_bCheckForExtremelyShortEdges; // Default is true.
double m_DistanceToCheck; // Default is 1.0e-12
int m_totalExtremelyShortEdgeCt;
``````