I've been struggling to generate a exact copy of the MeshStructure.FaceEdgeArray. For some reason I can't find the proper triangulation algorithm when picking an index from the EdgePointArray when there are multiple matches for the same vertex.
For instance, when you look into the the body01.bs and group its FaceEdgeArray by faces (by using the MeshStructure.FaceLengthArray), you'll see something like this between faces 77 and 79:
[378, 235, 369, 375]
[380, 351, 382, 365]
[371, 381, 363, 384]
This is what my script generates right now at the same face positions:
[378, 235, 369, 371]
[380, 351, 382, 365]
[375, 381, 363, 384]
Both 375 and 371 (in blue) point to the same vertex in the end, but at different positions in the EdgePointArray. This happens everywhere in the array, its quite common.
When looking at the original bodies, it seems that the algorithm sometimes will pick the first or the second index, but I could not figure out what's the criteria for it.
I've tried different things, but if I change something to fix one in particular I'll get others swapped somewhere else.
In the end it doesn't really matter if they are swapped or not as they will always point to the same vertices regardless. But I really wanted to get a perfect optimization algo for this.
Does anyone have the smallest clue that could help with this?