I have a piece of program that accepts a Mesh and a plane and projects the 3D Mesh to the plane. However, the program only works well when the 3D Mesh is not "folded" ACCORDING to the given plane.
By "folded" here I mean that at least two 3D faces/edges on the 3D Mesh project into two intersecting or overlapping 2D faces/edges on the target plane.
Here is a picture of a 3D Mesh for illustration.
For example in the picture, if I give as input the 3D Mesh depicted with the XY (horizontal) plane, the program works well. However, I would like to generate an exception, if the 3D mesh above is given with the XZ or YZ (the two vertical) planes. How can I algorithmically detect that the 3D Mesh is "folded" given a projection plane?
If surface face normals are consistently oriented in some direction than projected faces will have consistent normal directions if there is no 'folding'. In case of good oriented input mesh, just check do result faces normals all point to one plane side. If not, than first orient surface faces by choosing one starting face and spread it's orientation.