1
$\begingroup$

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

$\endgroup$

2 Answers 2

3
$\begingroup$

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:

$\endgroup$
1
$\begingroup$

Am I missing something?

enter image description here

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

$\endgroup$
4
  • $\begingroup$ ..OK, this doesn't address the more general case $\endgroup$
    – Robin Betts
    Oct 7, 2023 at 9:15
  • $\begingroup$ 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? $\endgroup$
    – teeeeee
    Oct 9, 2023 at 10:00
  • $\begingroup$ 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. $\endgroup$
    – Robin Betts
    Oct 9, 2023 at 10:29
  • $\begingroup$ 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. $\endgroup$
    – teeeeee
    Oct 9, 2023 at 10:47

You must log in to answer this question.

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