a first poly element internal snapping algorithm