# Meshes weld triangulation

Hello,

in my project I need a mesh which has regularly subdivided exterior borders and a voronoi diagram structure inside. Then I have to weld the two meshes.

I would like to end with the output of my definition in a valid welded mesh. The problem is that the points of the borders don’t match with the voronoi boundaries points.

Is there a way for creating a triangulated mesh between the two as shown in the picture below?

ps. Definition uploaded hereMeshes-weld-triangulation.gh (17.1 KB)
.

Ciao Giacomo,
Meshes-weld-triangulation_re.gh (92.0 KB)
Have a look at attached definition, 2 methods with descriptions step by step.

1st method:

• creating the 2 polyline perimeters
• creating a list of all the vertexes that new mesh will need; the vertexes of the 2 perimeters (without duplicates)
• for each segment of perimeter A, finding the nearest point to the vertexes of perimeter B, and vice versa (used midpoint of segment); every segment will have a 3rd point, thus we have a triangle (endpoints+point)
• finding the index of every point and building up the mesh

2nd method:

• creating the 2 polyline perimeters
• creating a list of all the vertexes that new mesh will need, the vertexes of the 2 perimeters (without duplicates)
• do dealunay mesh with all the points
• “deleting” mesh faces that are outside external perimeter but inside internal perimeter

Theoretically 1st method could be faster than 2nd, but it is not deep-scripted so its not sure.
Maybe with large point lists the difference is noticeable.

Tell me if something is unclear, or if i missed your answer.
Cya.

1 Like

That creates Ngons.

Grazie Riccardo!

I spent some time looking at the solutions you proposed:

the 1st method seems to work better, it is exactly what I wanted to achieve
and it is very well explained. Thank you.

There is another thing I am thinking about: Voronoi diagram generates many short edges (see image below)

These edges could be eliminated and have a more simple mesh configuration.

So, what I am trying to do is weld de closer points using Cull Duplicates and a tolerance of proximity of about 6 mm. It works if you flatten the tree, but then I loose the tree structure and I am no longer able to get my closed polylines.

On the other hand, If you don’t flatten it will keep the old points in adjacent polylines’ branches.

Trying to weld the points once the mesh is done would collapse some faces, that is way I would like to perform the operation before.Average-points.gh (60.2 KB)

I have to figure out how to flatten and average closer points;
find index of eliminated points in the tree;
replace them with the averaged points.

Cull Duplicates has to outputs, I and V … but I don’t know how to use them.

Some suggestions?

Thanks in advance. Definition is here.

Average-points_re.gh (72.4 KB)

• make a full list of all the points
• cull duplicates by distance (as you did)
• for each vertex of the starting polylines, find its closest point in the culled list
• using the index to retrieve again the points from the list, and use them as vertex for the new polylines

Thank you very much Riccardo,

you really helped me and I also learned something!

Cheers!