For now, the only thing I could think about is to split into cluster
Is there a better algorithm for this?
Have you faced this question before?
If so I'm interested to hear your words
float prev = chinput(C, I - 1); float next = chinput(C, I + 1); V = (prev <= V) && (next <= V);
float h = @height; vector i = set(@ix, @iy, @iz); vector is[] = array(i + {1,0,0}, i - {1,0,0}, i + {0,1,0}, i - {0,1,0}); // orthogonal neighbors vector is2[] = array(i + {1,1,0}, i + {1,-1,0}, i + {-1,1,0}, i + {-1,-1,0}); // diagonal neighbors append(is, is2); int ismax = 1; foreach(vector ni; is) { float nh = volumeindex(0, "height", ni); if (nh > h){ ismax = 0; break; } } if (ismax) { int pt = addpoint(0, v@P); vector P = v@P + set(0, h, 0); setpointattrib(0, "P", pt, P); } removeprim(0, @primnum, 1);