Skip to main content
4 of 11
Refined answer, updated blend file
quellenform
  • 39.6k
  • 10
  • 56
  • 149

To be honest, I'm now a little stunned myself at how complicated the answer seemed at first, and how simple the solution is in the end.

Here we go:

  1. First create your points with Distribute Points on Faces.

    How could I get the distance of a point to its nearest point - Step 1

  2. Then use the node Convex Hull to connect the points with a hull. This step is helpful because it gives us a triangulated mesh to work with further.

    How could I get the distance of a point to its nearest point - Step 2

  3. Using the nodes Extrude Mesh, Split Edges and Separate Geometry you get the isolated edges of this mesh.

    How could I get the distance of a point to its nearest point - Step 3

  4. Then reduce the scale of each edge by half.

    How could I get the distance of a point to its nearest point - Step 4

  5. Now that the edges are reduced in proportion to their length, you can reliably find the nearest point with the node Geometry Proximity. If you then calculate the direction vector between your originally created points and the position results of Geometry Proximity, you will know in which direction the shortest vector points.

    How could I get the distance of a point to its nearest point - Step 5

  6. In the last step you only have to correct the length. Since you have shortened the edges by 50% before, you simply scale the direction vector by $4$, which is exactly the point you were looking for (Apart from a few minor rounding errors).

    How could I get the distance of a point to its nearest point - Step

The final result is this (Each previously created point is here connected to the nearest point):

How could I get the distance of a point to its nearest point - Result

...and with animated Seed/Density it looks like this:

How could I get the distance of a point to its nearest point - Animation

Here is an overview of the node group:

How could I get the distance of a point to its nearest point - Node Group

Here is the blend file (I have included an additional view for debugging):

quellenform
  • 39.6k
  • 10
  • 56
  • 149