I've been working with growth solvers using nearpoints() with some initial setups demonstrated by the brilliant folks at Entagma. However I'm getting a little stumped when I try to weight the growth in a certain direction. In other words, I'd like like the solver to find nearest points only in the +x direction of the currently infected points. Pointers? Ideas? Thanks!
Solver code:
float radius = 0.075;
int nbrs = nearpoints(0, “infected”, @P, radius);
int cnt = 0;
float accum = 0;
foreach(int nbr; nbrs){
float infection = point(0, “infect”, nbr);
float dist = length(@P - point(0, “P”, nbr));
float weight = 1 - smooth(0, radius, dist);
accum += infection * @Cd.r;
vector nodepos = point(0, “P”, nbr);
v@dir = normalize(nodepos - @P);
cnt++;
}
f@infect = f@infect + accum/float(cnt);