First, take a look through the Beginner's FAQ, particularly the guidelines suggesting that, before posting, you first try to determine what the problem is yourself. Just staring at 100s of lines of code doesn't qualify! 
has probably something to do with the vertex ordering or indices of my mesh but I checked everything over and over again
For a program to produce the results you want, both the data and the code need to be correct.
From your post, it appears you're not sure how to debug your program. I suggest you learn how to Follow The Data. I.e., rather than post all your code (I didn't look at it because you need to do some work first), do some testing to determine at least the general area (a few lines of code, or at most a routine) where you know the problem occurs.
Choose a point in your code somewhere and look at the data you import - actually examine the data you use at run-time. Are the values what you expect? If so, examine your code to determine where it uses that data incorrectly. If the data at that point is incorrect, the problem occurs somewhere in your code earlier in the process. Pick another location earlier in the process and repeat the examination.
At some point you will find a location where the data you're reading from file is incorrect (fix the file), or correct data is sent to a routine, but the routine does not produce the data you expect.
Then, if you don't understand why the code doesn't produces the correct results with good data, you'll be able to post something more like: "I've verified the data [at a specified point] is correct, but the XXX routine [here's 12 lines of code] doesn't produce [this type of] data, which I expect the code to do."
Help others help you by providing information about the problem that you've already determined.