Parametrize a mesh to a texture space, using xatlas. Args: vertices (np.array): Vertices of the mesh. Shape (V, 3). faces (np.array): Faces of the mesh. Shape (F, 3).
(vertices: np.array, faces: np.array)
| 257 | |
| 258 | |
| 259 | def parametrize_mesh(vertices: np.array, faces: np.array): |
| 260 | """ |
| 261 | Parametrize a mesh to a texture space, using xatlas. |
| 262 | |
| 263 | Args: |
| 264 | vertices (np.array): Vertices of the mesh. Shape (V, 3). |
| 265 | faces (np.array): Faces of the mesh. Shape (F, 3). |
| 266 | """ |
| 267 | |
| 268 | vmapping, indices, uvs = xatlas.parametrize(vertices, faces) |
| 269 | |
| 270 | vertices = vertices[vmapping] |
| 271 | faces = indices |
| 272 | |
| 273 | return vertices, faces, uvs |
| 274 | |
| 275 | |
| 276 | def bake_texture( |