I guess you first need a solid method for determining the white end point B of a white start point A and store it in a way that you can find and couple it with the start point (e.g.[[A, B], …, [X, Y]]), whenever you need the information.
You seem to have a system in place for determining the start and end points, so maybe a start point A could look for its closest end point B in a close group of end points or something similar? Can a given start point have an end point as target that has already been visited?
If you have the relation of the start and end points figured out, you can launch your particle AB
in this general direction in order to get to the end point. This direction or velocity ->AB would be best represented by a normalised vector from a start point A to the end point B. Each point pair now has a directional vector.
However, this means that your particle AB now would travel in a straight line from start point A to end point B, which you don’t want since you want to keep in on the mesh and maybe introduce some other rules?
Let’s say your particle AB generally moves by getting its current position iteratively incremented by its velocity. Currently the particle moves step by step in a straight line until it reaches the end point B.
To keep in on the mesh, at each iteration, you simply move your current particle position by the velocity vector. Since this point probably won’t be on the mesh anymore, you simply look for its closest mesh point, which will be your next particle position.
At this point it is up to you to introduce other rules in order to achieve your desired trail. Your particle could cohere to neighbouring particles, only be able to travel down, or follow a vector field.
Here’s a simple Python example that is easily extensible:
mesh_particle_01.gh (34.3 KB)
You can simply introduce other manipulations to the velocity vector of the particle before finding the mesh point and updating the current position at each step.
You can for instance introduce your vector field and at each iteration look for the closest field vector to the current position and velocity. The normalised average vector between both will be your new direction, which follows the flow field and aims for the end point.
If you solved all of this on a particle level, you can extend the script with a particle system class that handles multiple particles and interactions between these particles (if desired).