Don’t have time to look into it right this minute but you could ‘sandwich’ the meshes to a curve passing in between them to account for such range along the curve versus the search radius of the single point.
maybe you can borrow from this other solution if you’re staying away from kangaroo:
I apologize, I was being funny - stupid word choice, sandwich or hugging or kissing - I simply meant pulling them towards each other.
I haven’t come back to see your script yet but as Michael pointed out in his earlier response with more clarity in your screenshot or explained logic perhaps it makes it easier for one to grasp what you’re after.
Can you show a more accurate picture/sketch of what you mean by ‘making the meshes kiss/hug’?
I tried something like this before, but I cannot get it smooth. I am just a student, so I have to study how to do it, but I tried it for some couple of months in between other stuff. I cannot find a way.
It just looks like happy (close, but not what I want to achieve). I want to let it transition smoothly.
Transition smoothly and not touch or do you want the objects to touch?
I want the objects touch one another.
Pull them less?
Pull them less does not work either because the ‘z-moving points’ neighbors’ does not go with them while moving.
Though if they must touch or be super close then find the SmoothMesh component and smooth the resulting meshes with it, or smooth with weaverbird.
When smoothing it smooths everything, so other ‘connections’ with itself will disappear.
…so the question is do you have to use those meshes only?
No, I am going to use several meshes.
I want to let ‘close neighboring parts of meshes’ attract to each other so they touch each other and form a one transitional ‘surface-form.’ Doing this depending on the distance between the ‘close neighboring parts of meshes.’
Did I explain it good enough?
Trying to do it with the component ‘pull points’ instead of ‘project points’ will give also a happy
The naked vertices complicate this as you’ve already seen - the point where the meshes ‘kiss’ involves enough naked vertices in the vicinity, which then forces you to also grab those points, which defeats the purpose of keeping the rest of the mesh unaltered - then if you choose to leave the naked vertices in place you end up with a forced kiss ( ) - switching to surfaces (mesh them later) or to denser (subdivided) meshes might give you smoother results - that hoopsnake work-around starts to look interesting though
The script first evaluates the meshes that aren’t already touching.
Then it looks for pairs that need to be kissing and moves the vertices of closest regions of both meshes closer together. Feel free to check it out below!
I almost studied all of it and already learning much of it. I am very happy with it because I now learning of how to work with meshes in Python.
I tried it also with three separated meshes, and understand by that it is meant for ‘two meshes.’
I am going to see how I can ‘expand it.’ I was thinking of using ‘anemone’ to loop, but first I am going to try to see if I can make it work with more than two meshes.
I haven’t tested it beyond your example, but it might already work for more than two meshes. It just evaluates the kissing for mesh pairs, but it loops every mesh. You might have to play with the sliders for it to work though.