I guess one can apply this function to any 2D meshes. If so, I recommend to move this function to more appropriate namespace or class. it's not needed to do it in this pr.