 cd pcafaces/ 
svnpath 
cd ~/MAT/      
load tosca   
 cd ~/svn/ 
cd GMDS/data/
load michael0
surface.X=tosca1.X'; 
surface.Y=tosca1.Y'; 
surface.Z=tosca1.Z';
 surface.TRIV=tosca1.TRIV;

cd ~/pcafaces 
pcapath


fastmarch(surface.TRIV, surface.X, surface.Y, surface.Z);

f = fastmarchmex('init', int32(surface.TRIV-1), double(surface.X(:)), double(surface.Y(:)), double(surface.Z(:)));

%  for k=1:10,

size(surface.X)
length(surface.X)
    source = repmat(Inf, [size(surface.X) 1]);
    source(round(rand*(length(surface.X)-1)+1),1) = 0;
    d = fastmarchmex('march', f, double(source));
    %d = fastmarchmex('march', f, double([k]));
    d(d>=9999999) = Inf;
%      trisurf(surface.TRIV, surface.X, surface.Y, surface.Z, d(:,end)); axis image;
%      drawnow;
%  end

fastmarchmex('deinit', f);

d


















>>  comp1-> emp1 = 0x20a4000; item1 = 0x20a4000 
 comp1-> emp1 = 0x7fc94c8237a0; item1 = 0x7fc94c8237a0 





crash
 comp1-> emp1 = 0x4d8545c0; item1 = 0x4d8545c0 





 comp1-> emp1 = 0x13a0930; item1 = 0x13a0930 


 comp1-> emp1 = 0x22e6cb0; item1 = 0x22e6cb0 



crash
 comp1-> emp1 = 0xe851a700; item1 = 0xe851a700 





 comp1-> emp1 = 0x1ff1b80; item1 = 0x1ff1b80 

 comp1-> emp1 = 0x1a87720; item1 = 0x1a87720 

 comp1-> emp1 = 0x20d5490; item1 = 0x20d5490 h






crash

 comp1-> emp1 = 0xe2835cf0; item1 = 0xe2835cf0 






 comp1-> emp1 = 0x324b6f0; item1 = 0x324b6f0 
