Select an edge that connects two faces and then use the script below to verify the angle between the two face normals…Try to have face normals like in the example #1 and #2 in the picture above and you will see both puts 90 degrees.

You can compare the cross product of the face normals with the edge’s “actual” direction, with whether the edge is considered reversed in one of the faces.

# Assuming the faces are oriented the same way, the faces are not co-planar and
# the edge binds exactly two faces.
def concave?(edge)
faces = edge.faces
vector = faces[0].normal * faces[1].normal
vector.samedirection?(edge.line[1]) == edge.reversed_in?(faces[0])
end

If the faces are correctly oriented any shared edge must be considered reversed in one of the faces but no the other, compared to the faces’ winding order. You can also check the “reversity” in relation the the second face, but then you must also swap the two faces when calculating the cross product (which reverses the product vector). What is the first and second face makes no difference, as long as it is internally consistent in the method.

In a real implementation you should also confirm there is only 2 faces bound by the edge, they are correctly oriented (the “reversity” of the edge differs between them) and the faces aren’t co-planar (the cross product of the normals bot being zero length).

The cross product of the two normals is the vector that is perpendicular to both of them (unless in the special case when they are parallel, then it is a zero length vector with no direction). What direction it has depends on the order of the multiplication, as cross multiplication is non-commutative. If A and B are swapped the cross product will be reversed.

Then there is the winding order of the faces, which is what defines the front and back side. Of we just reverse the faces convex becomes concave and vice versa. How the edge’s own direction relates to the winding order can be compared to how it relates to the normal cross product, to check if the edge is convex or concave.