Hi there!
In your case that might be a solution. It remove point if the angle is more than a threshold and as 2 neighbours (border in your case).
int nn = neighbourcount(0,@ptnum);
@dot;
if(nn == 2)
{
int Lp[] = neighbours(0, @ptnum);
vector pos1 = point(0,"P",Lp[0]);
vector pos2 = point(0,"P",Lp[1]);
pos1 = normalize(pos1-@P);
pos2 = normalize(pos2-@P);
float dot = dot(pos1,pos2);
@dot = dot;
if(abs(dot)>0.995) //0.995 is the angle threshold
{
removepoint(0,@ptnum);
}
}
I hope it will do the trick for you,
Gab.