Skip to main content
edited body
Source Link
jst kiko
  • 703
  • 7
  • 19

But still this is as far as I know this is the best way to sort a field using only geometry nodes and no programming. So as stated in the question I wanted to connect two random sets of point based on their distance from an empty (picture 1). But the same approach should work for sorting any field.

Now for the interesting nodes, the "sort list" node takes the count (len of field), any unsorted field and a resolution count. And itIt outputs a debug geometry, the sorted list and a list of ids (index of each value for unsorted field, look at the next few pictures).

The main idea is placing the original field on a line, and then merge a "sorted" (i.e. normal mesh line) by distance to the field vertices. Lastly it returningreturns the vertex positions as a sorted field. (Excuse my poor drawing, but it shows the idea of how the node works):

So next problem, Blender nodes have no loop function, but they do have field math and field logic. And we know that all "single pass" nested loops (with no exit logic) can be translated into a single loop of n^2 iterations:
enter image description here

But still this is as far as I know this is the best way to sort a field using only geometry nodes and no programming. So as stated in the question I wanted to connect two random sets of point based on their distance from an empty (picture 1). But the same approach should work for sorting any field.

Now for the interesting nodes, the "sort list" node takes the count (len of field), any unsorted field and a resolution count. And it outputs a debug geometry, the sorted list and a list of ids (index of each value for unsorted field, look at the next few pictures).

The main idea is placing the original field on a line, and then merge a "sorted" (i.e. normal mesh line) by distance to the field vertices. Lastly it returning the vertex positions as a sorted field. (Excuse my poor drawing, but it shows the idea of how the node works):

So next problem, Blender nodes have no loop function, but they do have field math and field logic. And we know that all nested loops (with no exit logic) can be translated into a single loop of n^2 iterations:
enter image description here

But still this is as far as I know the best way to sort a field using only geometry nodes and no programming. So as stated in the question I wanted to connect two random sets of point based on their distance from an empty (picture 1). But the same approach should work for sorting any field.

Now for the interesting nodes, the "sort list" node takes the count (len of field), any unsorted field and a resolution count. It outputs a debug geometry, the sorted list and a list of ids (index of each value for unsorted field, look at the next few pictures).

The main idea is placing the original field on a line, and then merge a "sorted" (i.e. normal mesh line) by distance to the field vertices. Lastly it returns the vertex positions as a sorted field. (Excuse my poor drawing, but it shows the idea of how the node works):

So next problem, Blender nodes have no loop function, but they do have field math and field logic. And we know that all "single pass" nested loops (with no exit logic) can be translated into a single loop of n^2 iterations:
enter image description here

added 41 characters in body
Source Link
jst kiko
  • 703
  • 7
  • 19

enter image description hereenter image description here

enter image description here

enter image description here

deleted 1 character in body
Source Link
jst kiko
  • 703
  • 7
  • 19

Next problem we have no if statements in blender, but with compare functions we can get a Field of 0 and 1 which we can use as a multiplayermultiplier of some other field and achieve the same result:

Next problem we have no if statements in blender, but with compare functions we can get a Field of 0 and 1 which we can use as a multiplayer of some other field and achieve the same result:

Next problem we have no if statements in blender, but with compare functions we can get a Field of 0 and 1 which we can use as a multiplier of some other field and achieve the same result:

Source Link
jst kiko
  • 703
  • 7
  • 19
Loading