MCPcopy Create free account
hub / github.com/microsoft/TRELLIS / parametrize_mesh

Function parametrize_mesh

trellis/utils/postprocessing_utils.py:259–273  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

257
258
259def 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
276def bake_texture(

Callers 1

to_glbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected