UV Unwrapping - Experimental for PLY and STL models

, ,

Purely experimental and not necessarily accurate.

Using xatlas-web and xatlas-three in separate viewers, just to ease the comparison of the outcome provided by each viewer.

EDIT: xatlas-web seems to work in most if not all browsers while xatlas-three might only work properly in Firefox browser (other browsers should throw cross-origin error).

Check the viewers code and search for uvUnwrapper to see all applicable usage and read any comments.

UVs should only get created for models that don’t have vertex colors and if at least 1 texture is loaded together with the model. The viewers T button will allow switching the texture. Any complex model might take some time to create UVs.

Probably the easiest test could be done with some STL model and some random textures from three.js repository - maybe try slotted_disk.stl model for simplicity.

PLY Viewer - Standalone (r170).zip (35.1 KB)

Also consider trying the WebGPU Standalone version, which includes slightly different approach and has lots of bug fixes. It is also set to create UVs for mesh models with vertex colors. This viewer should work in most browsers.

Here are pictures showing the WebGPU Standalone viewer with Dolphins PLY and Slotted Disk STL models with applied UV texture (all example files from three.js repository)

I did just change some code and hope that it now looks more correct. The viewers attached at the beginning of this post might show Dolphins / Slotted Disk + UV a bit less correct.