This is a standard 1D array definition of triangulated geometry. As you know a triangle is made of 3 vertices. So, given an array of all the vertices in the mesh, you can define a triangle by the indices of its three vertices in the mesh vertex array.
Your first list is a flattened list of 3-uples defining triangles. Here's how to get the unflattened list :
tris_1d = (2, 1, 0, 2, 3, 1, 7, 5, 4, 7, 4, 6, 5, 7, 8, 0, 8, 2, 0, 5, 8, 2, 8, 9, 2, 9, 3, 9, 1, 3, 4, 1, 9, 6, 4, 9, 6, 9, 8, 6, 8, 7, 4, 0, 1, 5, 0, 4)
tris = [(tris_1d[i], tris_1d[i + 1], tris_1d[i + 2]) for i in range(0, len(tris_1d), 3)]
print(tris)
print(len(tris))
[(2, 1, 0), (2, 3, 1), (7, 5, 4), (7, 4, 6), (5, 7, 8), (0, 8, 2), (0, 5, 8), (2, 8, 9), (2, 9, 3), (9, 1, 3), (4, 1, 9), (6, 4, 9), (6, 9, 8), (6, 8, 7), (4, 0, 1), (5, 0, 4)]
16
So this is an array defining exactly 16 triangles.
The second list is a flattened 3-uple array of vertex coordinates.
verts_1d = (3.40561318397522, -0.5, 2.22044604925031e-16, 3.40561318397522, 0.5, -8.88178419700125e-16, 5.32907051820075e-15, -0.5, -2.22044604925031e-16, 5.32907051820075e-15, 0.5, -2.22044604925031e-16, 6.0, 0.5, 4.49360990524292, 6.0, -0.5, 4.49360990524292, 6.0, 0.5, 4.5, 6.0, -0.5, 4.5, 5.32907051820075e-15, -0.5, 4.5, 5.32907051820075e-15, 0.5, 4.5)
verts = [(verts_1d[i], verts_1d[i + 1], verts_1d[i + 2]) for i in range(0, len(verts_1d), 3)]
print(verts)
print(len(verts))
[(3.40561318397522, -0.5, 2.22044604925031e-16), (3.40561318397522, 0.5, -8.88178419700125e-16), (5.32907051820075e-15, -0.5, -2.22044604925031e-16), (5.32907051820075e-15, 0.5, -2.22044604925031e-16), (6.0, 0.5, 4.49360990524292), (6.0, -0.5, 4.49360990524292), (6.0, 0.5, 4.5), (6.0, -0.5, 4.5), (5.32907051820075e-15, -0.5, 4.5), (5.32907051820075e-15, 0.5, 4.5)]
10
Here are your 10 vertices. They are accessed from index 0 to 9.
tris_coords = [(verts[i], verts[j], verts[k]) for i, j, k in tris]
print(tris_coords)
[((5.32907051820075e-15, -0.5, -2.22044604925031e-16), ... , (3.40561318397522, 0.5, -8.88178419700125e-16))]
And a face can be considered vertical if it's normal z component is equal to 0.
I found a pretty straightforward way of getting a triangle normal there : https://blenderartists.org/t/getting-face-normals-from-python/309648/3
def vecsub(a, b):
return [a[0] - b[0], a[1] - b[1], a[2] - b[2]]
def veccross(x, y):
v = [0, 0, 0]
v[0] = x[1]*y[2] - x[2]*y[1]
v[1] = x[2]*y[0] - x[0]*y[2]
v[2] = x[0]*y[1] - x[1]*y[0]
return v
def normal(v0, v1, v2):
return veccross(vecsub(v0, v1),vecsub(v0, v2))
for i, (v0, v1, v2) in enumerate(tris_coords):
n_z = normal(v0, v1, v2)[2]
if n_z < 10e-6:
print(f"Triangle {i} is vertical")
Triangle 0 is vertical
Triangle 1 is vertical
Triangle 2 is vertical
Triangle 3 is vertical
Triangle 4 is vertical
Triangle 5 is vertical
Triangle 6 is vertical
Triangle 7 is vertical
Triangle 11 is vertical
Triangle 12 is vertical
Triangle 14 is vertical
Triangle 15 is vertical
Now you just have to find a way to calculate the area of a 3D triangle :)
BTW this would be easier if you tried to do it using Blender, even if headless from the command line. It has a bunch of builtin math modules to do theses calculations for you. Or even straight from the Blenderbim addon.
Cheers