Connect Vertex to 6 closest Vertecis

Hello everyone! How are you?

I am doing a project but I am really bad at programming. I want to add a lot of verticies in my project and automatically make each vertex connect to the 6 closest vertices to it. Is it possible to do it with scripting? Or maybe there is an addon for this?

Thanks!

This is definitely possible, but it will take a few steps.This is a good place to start:

i wouldn’t bother trying to create a lambda sort yourself, it’s slow and pointless when blender gives you a kdtree. regardless, if you are ‘really bad at programming’ as you have claimed, you’re going to have a bit of an uphill climb no matter which solution you decide to try. you might do a few basic python tutorials and get your confidence level up a bit before tackling something more complicated

Hi Bruno,

You might want to explore Sverchok addon. It can do this kind of thing but be warned there is a learning curve to this as it’s quite a powerful addon. It’s a similar feature to what I used on my test here: Sverchok KDTree Testing

https://sverchok.readthedocs.io/en/latest/nodes/analyzers/kd_tree.html

Cheers and stay safe!

Omg using Sverchok it was really easy doing it! I just added a KDTree Closest Edges Node and it was almost good to go.

Thank you so much!

1 Like

Hi Bruno,

You are welcome. Good to hear it worked. Sverchok is very powerful and is also fun to play with! Happy blending!