refactoring mesh_offset_edges.py