I am trying to smooth the meshes together on the place yellow marked. I tried dividing vectors (no smooth overflow), and I tried kangaroo (in larger script it is to heavy).
Why don’t they touch to begin with? What are they and how are they made? There is not going to be any automatic solution for that unless you can define and predict a rule in the logic of the design.
Or do you mean to just collide one into the other?
It uses a point to create an attraction between the two meshes closest to it and moves vertices of corresponding faces along the face normal - you can extend the logic to curves or other attractors
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 am trying to avoid kangaroo because it takes a lot of calculation time.
I looked at my own work again, but still doing something wrong. I now use crvs to get intersecting points and limit the range of moving points by the distances of the intersecting crvs.
Do you might know what I am doing wrong?
I was could not understand the sculted_tower_update.ghx
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’?
No, I found it funny. I made a joke back, and jokes mean nothing and are only made because they are funny.
This is what I want. I want the neighboring meshes [blue] come to each other [as in red]. The rest of the mesh stays in position.
Based on how close the mesh vertices are to the other mesh, I want it magnetize to the other. I divided the vector by 2, so they will not cross each other. And moved only along the z-axis.
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?
Pull them less?
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.
Also, thanks for the sketch you provided - your geometries in it are depicted a lot smoother than the meshes you’re using in the file - so the question is do you have to use those meshes only?
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!
Great thank you! I know tried to use more points and more meshes. This script is very handy for me.
What I know tried is to let the vector movement depend on the z-axis towards the attractor points. However, I get some bumps by that and not everything is connecting well due to my implementation.
How could I make it more ‘controleable’ and let it made itself as fluent as in your example but then in the context of ‘more points and meshes?’ I cannot find a different way of what I am doing now.
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.
A mesh is created for every neighbor close by the ‘target mesh’ within the loop.
As a student I am already very impressed by what you helped me with giving me something to learn from So, again, thank you.
I am now trying collecting all new_mi’s vectors and new_mj’s vectors together and take then the average of every ‘group’ vectors per point per mesh to deform them.