Copy UV coordinates from a reference mesh.
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).
### Proposed new feature or change
In many mesh processing workflows, UV coordinates are not preserved (e.g. mesh simplification). UV coordinates are required for many downstream tasks. One way to propagate UV coordinates through mesh processing workflows is by copying them from the original mesh. Here is an outline:
1. Mesh A is processed to mesh B. Mesh A contains UV coordinates (and textures), but mesh B does not have them.
2. Call `meshB.InterpolateTextureCoordinatesFrom(meshA)`. This does:
- Create a ray casting scene with mesh A.
- For each vertex in mesh B, find nearest point in mesh A.
- Assign UV coordinates of nearest point in mesh A to the vertex in mesh B.
- Optionally, copy over any textures from mesh B to mesh A.
### References
_No response_
### Additional information
It may be necessary to convert from per-triangle UVs to per-vertex UVs (or vice versa). The following code shows an example of how to make that conversion: https://github.com/isl-org/Open3D/blob/main/cpp/open3d/visualization/rendering/filament/TriangleMeshBuffers.cpp#L614
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.