Add mesh element flipping functionality