5
$\begingroup$

I made a traffic system with Geometry Nodes as you can see below. (Thanks to the How to make Traffic Systems in Blender video by Bbbn19 on YouTube)

The problem is that clipping occurs and that I can't find a way to set a minimum distance in between the points/ cars.

I have seen a suggestion to use the Distribute Points on Face node and the Poisson Disk function within it, but I'm not able to make it work.

Another person on Youtube suggested:

If you use integers instead of floats with the random number generation and then multiply the numbers appropriately you should be able to give the cars a minimum spacing. I think that should be a simple solution.

Does anyone know how to solve this?

$\endgroup$
1
  • $\begingroup$ I'd use a 1D voronoi texture, check for distance to the center of 2nd cell and see if it's not too small, and go from there... $\endgroup$ Oct 3, 2022 at 11:07

1 Answer 1

8
$\begingroup$

In your concrete case, you would only have to define a minimum distance between the individual points.

To do this, simply add the math node Snap after the node Random Value and define the distance there.

enter image description here

There would be still another possibility:

enter image description here

Here I create random values, at between a minimum distance and maximum distance. I accumulate these values with Accumulate Field and thus generate the required sample points.


If you also want to animate the cars, you might be interested in the following answer:
Geometry node - Rotating instance along a curve with animation


(Blender 3.2+)

$\endgroup$
4
  • $\begingroup$ Thanks a lot for that already Quellenform! :-) About your second solution: I would like to be able to determine the maximum number of the random value node by the curve length node and that doesn't seem to be possible here. When I change the 'count' in the curve to points node, this changes the total length of the traffic jam. When I change the 'min distance' value in the Random Value node: this also changes the total length of the traffic jam. Is there a way by any chance to avoid the double points in your first solution as a possible solution to these issues? $\endgroup$ Oct 3, 2022 at 13:24
  • $\begingroup$ @PieterLeon Yes, of course, you can do that too. I have just updated the answer. $\endgroup$
    – quellenform
    Oct 3, 2022 at 13:45
  • 1
    $\begingroup$ Hah, that's awesome! You made my day again Stephan. :-) A coffee is coming your way! $\endgroup$ Oct 3, 2022 at 17:37
  • $\begingroup$ @PieterLeon Thank you for your support! That makes helping twice as much fun! $\endgroup$
    – quellenform
    Oct 3, 2022 at 19:00

You must log in to answer this question.

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