1

I would like to distribute a specific number of instances (say, a torus) on a mesh (say, a plane), using geometry nodes. This answer got me close, as you can see:

enter image description here

enter image description here

However, when I increase the number of instances they do not distribute randomly, but rather from the bottom up:

enter image description here

Can someone a) help me understand why this is, and b) how I can fix it to make them randomly distribute?

Thanks

teeeeee
  • 442
  • 1
  • 11

2 Answers2

3

The indices of points spawned by "Distribute Points on Faces" are not random - there is a clear correlation between faces and point indices. I didn't investigate the source, but it seems:

  • the algorithm estimates how many points need to be spawned per face, to distribute the points evenly across the entire surface (I do the same thing below),
  • then the algorithm goes through face by face (I think actually through the triangulated faces), spawning the calculated number of points on each face (or with calculated probability), similarly to what I do [here],(https://blender.stackexchange.com/a/221597/60486)
  • finally it seems the algorithm does a second pass if not enough points were spawned?

Not sure, maybe something completely different happens.

The solution is to either implement your own "Distribute Points on Faces", which I think isn't that hard, or use the dedicated node, but then shuffle the indices, which I do below:

Markus von Broady
  • 36,563
  • 3
  • 30
  • 99
1

Am I missing something?

enter image description here

..and point indices seem to be randomly distributed too, for further segmentation of the space.

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
  • ..OK, this doesn't address the more general case – Robin Betts Oct 07 '23 at 09:15
  • Hi Robin, thanks for this. I wasn't aware of the "Points" node. I am using Blender version 3.1.2, and it looks like maybe "Points" was introduced later than this? I think your answer solves my problem - but I'm not sure what you mean that it doesn't solve the general case? – teeeeee Oct 09 '23 at 10:00
  • Hi, @teeeeee the wizard's solution can be used to randomly distribute n points across any set of faces.. mine will only work evenly on a square plane.. it needs tweaking even for a rectangle, so his answer is much stronger. In fact I think I should delete this one. – Robin Betts Oct 09 '23 at 10:29
  • Ah, I see. As long as the limitations are pointed out, I think keep it here (I found it usefu, as someone who is starting to learn Geo Nodes, so maybe others will). I will accept the other answer. Thanks again. – teeeeee Oct 09 '23 at 10:47