Welding Meshes

@Michael_Pryor continuing here our discussion on meshes

With same data and same script
Here the result in Rhino 5

Here the result in Rhino 6, so it failed I am obliged to use a special script to do the job

here the script and mesh. 20180819_test_weld.gh (1.3 MB)

@Petras_Vestartas I try to use your component from you plugin Ngon and it tooks 2.3 minutes !!

1 Like

Damn it R6, you win again!

Yes R6 brings solutions and new problems. @dale, mesh vertices welding works well in Rhino 6 can you tell us what rhinocommon method to use to have the same result?
Thanks

In the component when you add radius these methods are performed:

        mesh.HealNakedEdges(radius);
        mesh.Vertices.CombineIdentical(true, true);
        mesh.Vertices.CullUnused();
        mesh.Weld(3.14159265358979);
        mesh.FaceNormals.ComputeFaceNormals();
        mesh.Normals.ComputeNormals();

        if (mesh.SolidOrientation() == -1)
            mesh.Flip(true, true, true);

        mesh.Compact();

If there is faster method let me know, I can change this.
You can also check method by method which one is slowing down the welding.

Before I used rtree search for welding, but as Michael mention closest distance has its own issues even if it is fast it may result in invalid meshes. Heal naked edges use edge graph to merge adjacent vertices.
This was the topic in this forum (the last comment of @menno I believe it is what heal naked edges is):

Maybe @dale can give a faster suggestion for welding.

Thanks @Petras_Vestartas for the answer HealNakedEdges is the only one I never used and didn’t know. I suspect it is slow. I need to do some test… Your rtree method is fastest on this mesh. I have also to test the exact speed of Rhino weld.