function [NodesMapping,NewFaces]=FacesRecoding(Faces)
%output
%NodesMapping-Mapping between old and new nodes
%NewFaces-new faces coding
%input 
%Faces-old faces coding

NbrFaces=length(Faces);
AllNodes=reshape(Faces',NbrFaces*3,1);
[NodesMapping,~,NewFaces]=unique(AllNodes);
NewFaces=reshape(NewFaces,3,NbrFaces)';

end