3
$\begingroup$

I'm trying to build a hanging wires.

I have a bunch of planes.
I convert faces of these planes into points and then I want to connect closest points to each other with a curve line.

The issue is, that in some cases it makes second wire where it already exists.
As far as I understand the issues is in the Index of Nearest Node and in the way i sample indexies position.
I basically need to tell geometry nodes to ignore the plane, if there is already a wire connected to this plane, but so far have no idea how to make it.

Please help :(

UPD:
To make my question more clear to understand, I made this. There are 4 planes, dinstance between each plane is 10 meters. Now, when I try to create cables, between these planes, I get a double wire in one place, and missing wire in another. I basically need the 4th cable go where the blue line on the screenshot is.


enter image description here


enter image description here

$\endgroup$
3
  • $\begingroup$ The first problem here is that your GN object is inside of a collection that it references. This creates a loop: the collection depends on GN which depends on the collection which depends on the GN etc. Without understanding yet your complete node structure, moving your GN object to "Lamp" collection solves the problem in the file you've provided. $\endgroup$
    – Nathan
    Nov 19, 2023 at 21:57
  • $\begingroup$ Hi @Nathan! Thank you for your reply! The solution you are talking about in your comment didn't really solve my issue =( I added a little update to my post to make the problem i have more clear to understand. $\endgroup$
    – retr0
    Nov 20, 2023 at 8:26
  • $\begingroup$ @retr0: you are right, my solution wasn't right $\endgroup$
    – Chris
    Nov 20, 2023 at 14:42

1 Answer 1

2
$\begingroup$

To connect a point to all other points with a maximum distance you can use the following algorithm:

Update: faster method:

  1. Create a line for every point.
  2. for every point, duplicate the lines created, now every point has a group of lines.
  3. for every line:
    1. if its index in group is less than or equal ($\le$) its group index:
      1. delete the line.
    2. else:
      1. set its start point position to the point of index equal to the line's group index.
      2. set its end point position to the point of index equal to the line's index in group.
      3. if the line length is greater than the max distance:
        1. delete it.


Older Method:

  1. For every point serially:
    1. Remove it from the list.
    2. For all points in the list:
      1. if the distance to the removed point is $\le$ the maximum distance:
        1. Create a line between the removed point and the current point.

algorithm node tree

result 1

result 2

In your node tree:

$\small\text{Blender 4.0}$


You can also define a minimum distance by adding an extra distance check:

$\endgroup$
7
  • $\begingroup$ hey! thank you for your suggestion! Unfortunately I need to keem them as planes, cuz i use these planes for some other options of my node setup (i attached only problematic part of the geo node tree to this post). $\endgroup$
    – retr0
    Nov 20, 2023 at 14:47
  • $\begingroup$ @retr0 I edited my answer, but the new method has a high performance cost. $\endgroup$
    – Hulifier
    Nov 20, 2023 at 21:05
  • $\begingroup$ thank you for the update! I tried it and it works, but the problem is still here. If i put 4 planes in a square there is still 1 cable missing =( gyazo.com/276bfacf0d6c2addfc4fc5be8452fa28 $\endgroup$
    – retr0
    Nov 21, 2023 at 7:53
  • $\begingroup$ maybe there is an option to use raycast node with limited ray lenght? So it connects a wire to any face which ray hits? I tried to make such setup but no success $\endgroup$
    – retr0
    Nov 21, 2023 at 8:10
  • $\begingroup$ @retr0 so what you want is to a plane to connect to all planes that are far away by a maximum of 10 meters? $\endgroup$
    – Hulifier
    Nov 21, 2023 at 12:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .