Skip to content

Commit 6d7e981

Browse files
committed
Add usage example for add_uv_mesh
1 parent ebdb99a commit 6d7e981

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ vmapping1, indices1, uvs1 = atlas[0]
6060
vmapping2, indices2, uvs2 = atlas[1]
6161
```
6262

63+
### Repack multiple parametrized meshes into one atlas
64+
65+
```python
66+
vertices1, indices1, uvs1 = load_mesh_with_uvs("input1.obj")
67+
vertices2, indices2, uvs2 = load_mesh_with_uvs("input2.obj")
68+
69+
atlas = xatlas.Atlas()
70+
71+
atlas.add_uv_mesh(uvs1, indices1)
72+
atlas.add_uv_mesh(uvs2, indices2)
73+
74+
atlas.generate()
75+
76+
vmapping1, indices1, uvs1 = atlas[0]
77+
vmapping2, indices2, uvs2 = atlas[1]
78+
```
79+
6380
### Query the atlas
6481

6582
```python

0 commit comments

Comments
 (0)