I’d like to add the equivalent of the shrinkwrap modifier to my GN control. I’d like to use the Raycast node as a base for this because I’d like to project my computed mesh onto the reference mesh. (I experimented with the GeometryProximity node and it gives a lot of stretching on concave parts of my reference mesh - Raycast is much more even).
I’m having some trouble because my computed mesh is sometimes inside and sometimes outside the reference mesh. Most of the other posts I’ve read about this only consider the case where the mesh to be projected is entirely outside the reference mesh. Because my mesh is part inside and part outside, I’m trying to create a node network that checks for this and switches between two ray casts depending on the surface direction. But I’m having a lot of trouble getting something that does not have at least a few vertices moving to obviously wrong positions.
This is my best try so far. Is there some setup that will project my mesh to the nearest surface of the reference mesh?
Most of those links only handle the case where one mesh is entirely outside the other. I’m trying to come up with something that works when not only is the mesh sometimes dipping below the surface, but it’s wrapping a full 3D mesh.
Edit:
I’m starting to think that the issue may actually be that the normals of a small number verts on the mesh I want to shrink may actually be missing the model and so my over/under test is actually overshooting and hitting anther part of the model. I might need to use the geometry proximity node after all.