Skip to main content
Refined Answer
Source Link
quellenform
  • 37.9k
  • 10
  • 55
  • 142

Blender 3.6+

This answer is technically the same solution as shown here:
How could I get the distance of a point to its nearest point?

With Blender version 3.6 a new node is available that makes this task a lot easier: Index of Nearest.

The node Index of Nearest simply returns the index of the nearest point, which makes it just as easy to query its position with Sample Index. Then you just need to instantiate lines, and move their endpoints to the position of the nearest point:

enter image description here


(Blender 3.6+)

Blender 3.1+

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

If you use the node Distribute Points on Faces, you can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

But if you use the node Distribute Points on Faces to create only the points, there is also a convenient alternative: The node Voronoi Texture.

If you only need randomly distributed points that you want to connect, it is sometimes easier to create a triangulated mesh directly instead of turning points into a triangulated mesh.

Here's an example of how that can work:

Selectively join points using geometry nodes - Voronoi Texture

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:


(Blender 3.1+)

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

If you use the node Distribute Points on Faces, you can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

But if you use the node Distribute Points on Faces to create only the points, there is also a convenient alternative: The node Voronoi Texture.

If you only need randomly distributed points that you want to connect, it is sometimes easier to create a triangulated mesh directly instead of turning points into a triangulated mesh.

Here's an example of how that can work:

Selectively join points using geometry nodes - Voronoi Texture

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:

Blender 3.6+

This answer is technically the same solution as shown here:
How could I get the distance of a point to its nearest point?

With Blender version 3.6 a new node is available that makes this task a lot easier: Index of Nearest.

The node Index of Nearest simply returns the index of the nearest point, which makes it just as easy to query its position with Sample Index. Then you just need to instantiate lines, and move their endpoints to the position of the nearest point:

enter image description here


(Blender 3.6+)

Blender 3.1+

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

If you use the node Distribute Points on Faces, you can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

But if you use the node Distribute Points on Faces to create only the points, there is also a convenient alternative: The node Voronoi Texture.

If you only need randomly distributed points that you want to connect, it is sometimes easier to create a triangulated mesh directly instead of turning points into a triangulated mesh.

Here's an example of how that can work:

Selectively join points using geometry nodes - Voronoi Texture

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:


(Blender 3.1+)

added 20 characters in body
Source Link
quellenform
  • 37.9k
  • 10
  • 55
  • 142

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

If you use the node Distribute Points on Faces, you can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

But if you use the node Distribute Points on Faces to create only the points, there is also ana convenient alternative: The node Voronoi Texture.

If you only need randomly distributed points that you want to connect, it is sometimes easier to create a triangulated mesh directly instead of turning points into a triangulated mesh.

Here's an example of how that can work:

Selectively join points using geometry nodes - Voronoi Texture

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

If you use the node Distribute Points on Faces, you can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

But if you use the node Distribute Points on Faces to create only the points, there is also an alternative: The node Voronoi Texture.

If you only need randomly distributed points that you want to connect, it is easier to create a triangulated mesh directly instead of turning points into a triangulated mesh.

Here's an example of how that can work:

Selectively join points using geometry nodes - Voronoi Texture

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

If you use the node Distribute Points on Faces, you can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

But if you use the node Distribute Points on Faces to create only the points, there is also a convenient alternative: The node Voronoi Texture.

If you only need randomly distributed points that you want to connect, it is sometimes easier to create a triangulated mesh directly instead of turning points into a triangulated mesh.

Here's an example of how that can work:

Selectively join points using geometry nodes - Voronoi Texture

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:

Refined answer
Source Link
quellenform
  • 37.9k
  • 10
  • 55
  • 142

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

YouIf you use the node Distribute Points on Faces, you can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

But if you use the node Distribute Points on Faces to create only the points, there is also an alternative: The node Voronoi Texture.

If you only need randomly distributed points that you want to connect, it is easier to create a triangulated mesh directly instead of turning points into a triangulated mesh.

Here's an example of how that can work:

Selectively join points using geometry nodes - Voronoi Texture

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

You can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:

The desired result can be achieved with the technique The shortest edge trick.

All you have to do is to convert your randomly generated points into a triangulated mesh and apply the following principle:

Selectively join points using geometry nodes - Nodes

If you use the node Distribute Points on Faces, you can achieve the triangulated mesh you need in this way, for example:

Selectively join points using geometry nodes - Triangulated Mesh

But if you use the node Distribute Points on Faces to create only the points, there is also an alternative: The node Voronoi Texture.

If you only need randomly distributed points that you want to connect, it is easier to create a triangulated mesh directly instead of turning points into a triangulated mesh.

Here's an example of how that can work:

Selectively join points using geometry nodes - Voronoi Texture

Once such a mesh is available, and this is actually the more complicated part in this case, it is easy to find out the shortest distance.

The procedure in this case would be as follows:

  1. Create your points on a grid

    Selectively join points using geometry nodes - Screen 1

  2. Create the triangulated mesh

    Selectively join points using geometry nodes - Screen 2

  3. Shorten the edges by a certain factor

    Selectively join points using geometry nodes - Screen 3

  4. Find the nearest edge and instantiate your lines there.

    Selectively join points using geometry nodes - Screen 4

Here is the blend file:

Source Link
quellenform
  • 37.9k
  • 10
  • 55
  • 142
Loading