function meshback(num)
%  Call back routines for mesh generation functions

if num==1
%  CALLBACK for RMVTRI.m

d = (x-xin).^2+(y-yin).^2;
[d,lnod]=sort(d);
nod1 = lnod(1:10);


ele3 = -1;
for i = 1:10
 l1 =[find(meshele(:,2)==nod1(i))',...
 find( meshele(:,3)==nod1(i) )' ,find(meshele(:,4)==nod1(i) )' ];
 for el = 1:length(l1)

   if interior(xin,yin,...
   meshnod(meshele(l1(el),2:4),2) , meshnod(meshele(l1(el),2:4),3) )
      ele3 = l1(el);
      break     % fall out of loop of triangles sharing one of 10 nodes
   end
 end
 if ele3>0 
   break        % fall out of loop of  10 closest nodes
 end

end

hold on
fill(x(meshele(ele3,2:4)),y(meshele(ele3,2:4)),'g')
figure(gcf)

%disp([ l1(l2(l3)), ele , meshele(l1(l2(l3)),:)])
l = find(meshele(:,1)~=ele3 );
meshele=meshele(l,:);
meshele(:,1) = [1:length(l)]';

sound(sou)

%  END CALLBACK for RMVTRI.m
end
