Implementation for Remeshing.