UVAtlas icon indicating copy to clipboard operation
UVAtlas copied to clipboard

Why the number of vertices is increased?

Open Armen-J opened this issue 3 years ago • 4 comments

When running the ".\uvatlastool.exe -wf average.obj", the number of vertices in the resulting file is increased. How can I keep it the exact same?

Armen-J avatar Nov 29 '21 22:11 Armen-J

If you are getting additional vertices it's coming from the Clean needed to break bow-ties. If the model contains non-convex surfaces, it can get stuck in an infinite loop.

walbourn avatar Nov 30 '21 01:11 walbourn

But another thing is that in the new .obj file even the coordinates of previous vertices are changed! And there is no way to figure out the mapping! Let's say in the original file there are 1000 vertices and in the file created by uvatlastool there are 1050, is there any way to map between the original 1000 and their corresponding vertices in the new file?

Armen-J avatar Nov 30 '21 15:11 Armen-J

The remapping information is available via the API. Sounds like I might need to add a new uvatlastool option to write out that remapping as a text file as well.

walbourn avatar Nov 30 '21 21:11 walbourn

That would be great! Could you direct me to the file and function that provides the remapping?

Armen-J avatar Nov 30 '21 21:11 Armen-J

Added in this commit https://github.com/microsoft/UVAtlas/commit/4a16541b500b136694d96296ae0b01500eb0ac3f a new -m option that writes out a text file of the form:

newIndex,oldIndex

That tells you for each index in the output mesh, what vertex in the original mesh did it come from.

walbourn avatar Nov 05 '22 19:11 walbourn