I am trying to study a 3D model, in which I have such details. (concretly, I need to unbed them to export a plate)

In my model I have a list of 3D points, that define the contours of each face. But there is no "convention" regarding order in which information is given. The order in which the surfaces are given is random, the same as it is clockwise or not. What I could do now is :
- Identify the 2 internal faces
- Then find the "formule" to transform 3D lines to a plan
But I see that depending on the direction in Which I receive the points, it generates some symetry problems :
On the end I think I understood why (but couldn't find a way how to solve it :
To determinate the x/y axises, I do the following :
- Determinate 2 points common to my 2 faces.
- I choose one of them.
- Then I define the point next/before that common point.
- If equal to second common point, this is Y axis, if not, it is X axis.
But in case 2, my axis "Z" is on the rear of the detail, so I have symetry issues.
I think if I could find the axis is front or behind the plane (x,y), I just would need to change direction of "x", but how can I determinate that?

Well, just found how to solve, was much easier than expected...
The problem was I never knew which detail goes to the left side or to the right side. I already tried scalar to determine the side, but this didn't answer to 1st question, but didn't expect that scalar was the answer :
Whatever if my "common point" is on bottom or on the top(it is just a rotation of the plate), I just need to : (let's say common point is the one in the bottom corner)
As I always take the bottom corner as center of axes, I have all X/Y coordinates from that point. Then just need to join the 2 pieces together.