Obj export has lots of open edges

Hi,

I’m trying to do an Obj model exporter, I got one working based on this one, the problem is that the exported model has lots of open edges, I import the model in 3ds Max, put the STL Check modifier in the mesh and immediately get hundreds of open edges. I’m not too familiar with the Obj format, so I’d like to know if anyone knows how to prevent it.

Export as .fbx format

Turns out this is because Unity duplicates vertices that share the same space, but have different UV’s (i.e. they are within a seam). So i guess there are two ways around it, either check for repeated vertices and eliminate them while being exported, or export the model as is and make a script to clean the OBJ file. Which one would be more recommendable?