Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Convert Wedge UV Coordinates to PyTorch3D faces_uv? #397

Open
blacksino opened this issue Sep 23, 2024 · 1 comment
Open

How to Convert Wedge UV Coordinates to PyTorch3D faces_uv? #397

blacksino opened this issue Sep 23, 2024 · 1 comment

Comments

@blacksino
Copy link

Hi everyone,

I am working with PyMeshLab and reading a mesh that includes wedge texture coordinates, which gives me the UV coordinates for each vertex of a face in the shape of (F x 3) x 2. I need to convert this into the format required by PyTorch3D, where the faces_uv stores indices relative to the verts_uv. This means that instead of storing actual UV coordinates for each face, I need to store indices pointing to the unique UV coordinates (verts_uv).

The conversion process involves deduplication of the UV coordinates and creating an index lookup, but this deduplication can be quite slow for large meshes.

I have tried using np.unique, but I’m looking for a more efficient way to perform this operation.
Any help would be appreciated. Thanks!

@jmespadero
Copy link
Contributor

jmespadero commented Nov 11, 2024

Have you tried the compute_texcoord_transfer_wedge_to_vertex filter?
It should do what you weed, including splitting vertices with not coherent Wedge coordinates, quite fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants