finish the function for the previous commit and fix a bug causing by symmetry of edge offset for tetrahedral case