Skip to content

Commit

Permalink
Add usage example for add_uv_mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
mworchel committed Oct 10, 2021
1 parent ebdb99a commit 6d7e981
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d7e981

Please sign in to comment.