# How to make Geometry Proximity to consider Volume of Target

I have geometry node setup with proximity node for plane, and when distance is zero between cube and plane then points of plane to go from position 1 to position 2. Attached is a node setup and output. Here i would like to consider cube volume for distance calculation. When plane points are inside cube then distance is zero and so plane points go correctly from position 1 to position 2. Last image is the expected result.

Third Image: It is considering faces of cube for distance calculation rather than volume of cube which is problem where distance changing based on faces of cube.

Fourthimage : If original plane points are inside cube then consider distance is zero and plane points goes from position 01 to position 02.This is expected result.

Finally how to make points are inside or outside calculation to drive mix node?

Problem

Expected

To know what's "inside" of a mesh, we need to check the normals of that mesh:

I compare the nearest normal with the (normalized) vector toward the nearest position. If these two vectors are going in the same direction, as revealed by the sign of their dot product, then the sampled vertex lies inside the target. Otherwise, it does not.

We can group this up, and then mix from proximity to 0 on the basis of its output to make sure that our vertices inside the target return a distance of 0:

Note that the very concept of "inside" requires that we target a manifold mesh, and that the direction of its normals matter.

• Perfect & quick solution! Commented Aug 18, 2023 at 10:00

Maybe multiplying a Raycast after the Map Range will help you:

I'm new to blender and still learning geometry nodes in the blender and after seeing your question, I think it might be good to try it. I came much close to the solution, but I'll try and keep the correct one soon. Here's the answer from me for now. Here's the image of the 2 geometries before adding Geometry node :

And here's the picture of the Geometry node for the square