# Traffic along a curve in Geo Nodes without clipping (overlapping)

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.

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?

• 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... Oct 3, 2022 at 11:07

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.

There would be still another possibility:

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+)

• 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? Oct 3, 2022 at 13:24
• @PieterLeon Yes, of course, you can do that too. I have just updated the answer. Oct 3, 2022 at 13:45
• Hah, that's awesome! You made my day again Stephan. :-) A coffee is coming your way! Oct 3, 2022 at 17:37
• @PieterLeon Thank you for your support! That makes helping twice as much fun! Oct 3, 2022 at 19:00