Problem in exporting PQ Torus mesh as an obj file

You can try this. It looks like it will give you an idea what you should be doing. Haven’t ran the code but it looks ok at a glance.

Maybe look at this also,

Best thing to do is start with a simple object with known vertices so you can figure out what your doing.

Basically create something simple in blender and export it as obj so you can open up the file in a text editor and compare it to what your are doing. Make adjustments to your script and soon your can write any size obj you want.

Edit: Crap, guess it would help to include the format stuff…
https://www.cs.cmu.edu/~mbz/personal/graphics/obj.html