# Mesh welding fruitless on seam

Hi there,

I’m running into a welding problem. But this may have to do with my understanding of what welding a mesh truly is and how it is done in GH. Here is what I read in the GH primer:

The process of taking two vertices that are in the same position and combining them into a single vertex is called welding […] The Weld component uses a threshold angle as input. Any two adjacent faces with an angle less than the threshold angle will be welded together, resulting in common vertices with a normal that is the average of the adjacent faces.

I manually created a mesh with two faces and a list of vertices containing two vertices which are duplicated in such a way that the two faces meet at vertices which are duplicates. Welding that mesh with a threshold of 180 degrees works fine, the duplicates are removed. See the image.

My problem is with a mesh created from a cylinder and the MeshSurface component. This components create duplicates at the seam of the cylinder. As a matter of fact, it behaves the same way when the input surface is a revolution surface (i.e. generated from a generatrix). For my final project I had to deconstruct that mesh and reconstruct it so that I get rid of the duplicates… Quite a long process but it works. Then I found the Welding component and thought it could solve my issue but it doesn’t. As you can see below (group 2), the original mesh from the cylinder has 24 vertices (including 4 which are duplicates) and the output from the Weld component is the same (same number of vertices and faces).
I thought it could be related to the component itself and I used the C# Weld method, however the result is the same.

``````  private void RunScript(Mesh M, out object a)
{
M.Weld(Math.PI);
a = M;
}
``````

Then I found the CombineIdentical method whose description reads: “Merges identical vertices.”

``````  private void RunScript(Mesh M, out object a)
{
bool b = M.Vertices.CombineIdentical(true, true);

a = M;
}
``````

However the result is the same.

So my I’m wondering what is wrong? Is it my understanding of what welding is? Or is there an issue with the component/C# methods?

MeshWelding_CynlidricalSurface.gh (22.4 KB)

Yep, seems broken. On Rhino 7 it works fine.

EDIT

@Gijs (I’m tagging you for general bugs, sorry… should I tag others? )

“Mesh Surface (Mesh UV)” component is behaving differently from 7 to 8.
On 7, the resulting mesh have the vertices at the seam correctly already coincident, as expected, and so .CombineIdentical method works fine.
On 8, the resulting mesh have not-aligned vertices at seam. .CombineIdentical won’t work because of that.

@Germain_SOSSOU , if you first do:
M.Vertices.Align(yourtolerancehere);
then .CombineIdentical will work.