Given a set of triangles which form a closed, non-overlapping 3D-object, when the object is convex, the order at which the triangles are drawn doesn't matter, provided that only triangles which face the 'camera' are drawn.
When the object is partially concave however, at certain angles two or more triangles that face the camera will overlap. In this case, the order in which the triangles are drawn does matter.
For all of the few simple concave objects that I looked at, there is at least one order in which the object is correctly drawn at (almost) all angles.
Take a doughnut for example: The triangles that face the whole of the doughnut will have lower indices in a array of triangles and be drawn first. The triangles that face away from the center of the doughnut will have higher indices and be drawn last. Within the inner triangles there is also an order.
This image shows the order at which the triangles should be drawn. White is drawn first, black is drawn last.
Lower order triangles can still be covered by higher order ones at extreme angles (the darker segments will be drawn over the lighter ones), but only by a small margin as shown here:
This heart shape is another example. The white rectangles are too large and could be drawn in the wrong order. Dissecting them would solve this problem.
Are there any known studies done on this subject?
Is there an algorithm that sorts triangles of a 3D-object so that most cases of overlapping triangles are drawn in the right order at any angle (without resorting the triangles)?