def flip(self, axis=0, preserve_centroid=False):
        '''
        Flip the mesh across the given axis: 0 for x, 1 for y, 2 for z.

        When `preserve_centroid` is True, translate after flipping to
        preserve the location of the centroid.

        '''
        self.v[:, axis] *= -1

        if preserve_centroid:
            self.v[:, axis] -= 2 * self.centroid[0]

        self.flip_faces()