From 6d7e9815bf80d283bfa68f20ebd9e1dd02419785 Mon Sep 17 00:00:00 2001 From: Markus Worchel Date: Sun, 10 Oct 2021 13:09:00 +0200 Subject: [PATCH] Add usage example for `add_uv_mesh` --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 05f640b..3ea3f6d 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,23 @@ vmapping1, indices1, uvs1 = atlas[0] vmapping2, indices2, uvs2 = atlas[1] ``` +### Repack multiple parametrized meshes into one atlas + +```python +vertices1, indices1, uvs1 = load_mesh_with_uvs("input1.obj") +vertices2, indices2, uvs2 = load_mesh_with_uvs("input2.obj") + +atlas = xatlas.Atlas() + +atlas.add_uv_mesh(uvs1, indices1) +atlas.add_uv_mesh(uvs2, indices2) + +atlas.generate() + +vmapping1, indices1, uvs1 = atlas[0] +vmapping2, indices2, uvs2 = atlas[1] +``` + ### Query the atlas ```python