Issues Trying to replicate Surface Deform with Geo nodes

Making a Surface deform modifier with geometry nodes, I’ve gotten a pretty good result so far but I’m having some issues i don’t really know how to fix.

My node setup so far gives this result:

As you can see the Org mesh goes through the def mesh. i don’t understand why it’s happening. if anyone can tell me what I’m doing wrong it’d help tremendously!!

(I’m going to repost this question on blenderstackextange, if i get an answer there that works i will link it here)

TestFile:

Hello !

It would have been great to post a .blend as well so we can try things right away without having to rebuild the tree…
Anyway, I think the sample nearest interpolated might be better to sample the position rather than raycast… I’ll start with that…

Anyway I’m not 100% sure of what you’re doing so there might be other issues…

Have fun !

2 Likes

That produces this result

My thinking in using raycast is i want to be able to scale the original mesh however much i want and still get a desirable deformation, sort of like surface deform except without the “you need to rebind every time you make a mesh change” thing.

If i were to upload the file it would have to be externally because for some reason new users cant upload attachments ill add a google drive link in a minute

(Attached Link to original post)

Hello !

I quickly played with the file, sadly everything seems to work fine… I just managed to simplify it a bit :
MeshDeform1.blend (461.0 KB)

And the sample nearest surface should probably work better in any case…

It looks like that the issues is caused by the sample nearest not always picking the points we’re expecting which then makes the deformation looks wrong…

Having the cage closer to the deformed mesh should fix it.

Also keep in mind that surface deform and mesh deform are a bit different, it’s likely that you’ll get better result by deforming geo with a surface rather than a volume, even if that might work to some extent…
Probably Meshdeform is a bit more complex in a way that isn’t easy to recreate with GN…

Also keep in mind that probably even the surface deform modifier’s algorithm is a bit more complex and tries to account for corner cases , if you really want better results it might be worth trying to decipher the source code to see if there isn’t any gotchas there…

Good luck !

1 Like