@staticmethod
def calc_faces(size_x, size_z):
    """Return the faces for a horizontal grid of ``size_x`` by ``size_z``
		cells.

		Faces are triangular, so each is composed by 3 vertices. Consequently,
		each returned face is a length-3 sequence of the vertex indices.

		:param size_x: number of cells along the X axis
		:type size_x: positive int
		:param size_z: number of cells along the Z axis
		:type size_z: positive int
		:return: faces for a heightfield trimesh based in a horizontal grid of
			``size_x`` by ``size_z`` cells
		:rtype: list of 3-tuple of ints

		>>> HeightfieldTrimesh.calc_faces(2, 4)
		[(0, 1, 4), (1, 5, 4), (1, 6, 5), (1, 2, 6), (2, 3, 6), (3, 7, 6)]

		"""
    indices = []
    for x in range(size_x):
        indices_x = []
        for z in range(size_z):
            indices_x.insert(z, size_z * x + z)
        indices.insert(x, indices_x)
    faces = []
    for x in range(size_x - 1):
        for z in range(size_z - 1):
            zero = indices[x][z]
            one = indices[x][z + 1]
            two = indices[x + 1][z]
            three = indices[x + 1][z + 1]
            face_type = zero
            if size_z % 2 == 0:
                face_type += 1
            if face_type % 2 == 0:
                face1 = zero, three, two
                face2 = zero, one, three
            else:
                face1 = zero, one, two
                face2 = one, three, two
            faces.append(face1)
            faces.append(face2)
    return faces
