Well, i know the Obj file format just a little bit, just enough to know what does what. And i know no real programming language besides a bit Javascript from Unity. So all i can give is some food for thought. Most probably not of real use
That said, when you have four edges, and you end with seven vertices, then there could be something wrong with the indexing i guess. Obj can reuse vertices. That`s where it is different from let`s say X, which writes its own vertices for every face. Another thing is seven less four makes three, and that`s a tri. Maybe that`s another hint, one tri too much somewhere?
What is also interesting is that you write tris out of a obj file that is made of quads. The vertices/face index is already quadrified. One line one face. So from my point of being a noob all there is left is to read the faces index and its corresponding vertices position as they are written in the Obj file. But i guess it`s not so easy because at one point you have to convert it to the truespace internal mesh handing, which works with tris, right? Well, was worth a thought ...
Another thought, Blender has a proper working Obj Im- and Exporter. And it is open source. Maybe you could have a look at how they handle things there?
And last but not least, as you already have mentioned, maybe it is not your importer, but a problem at trueSpace end?




