For my application, I want to render models as polygonal surfaces in 3D space and have edges that are bent "outwards" to have a solid line and those who are bent "inwards" to have a dotted line. So if I look from the top of the edge if they "bend towards me" they are bending inwards, if they bend away from me, they bend outwards.
For this, I need to calculate the angle between two connected triangles. How can I calculate this angle? How can I define if it is bent outwards or inwards (looking from the top it would always bend downwards if the angle is >180 and inwards (so up) if the angle is <180, but how can I calculate this?