pyFM.mesh.file_utils.write_obj_texture

pyFM.mesh.file_utils.write_obj_texture(filepath, vertices, faces, uv=None, mtl_file='material.mtl', texture_im='texture_1.jpg', mtl_name=None, precision=6, vertex_normals=None, verbose=False)

Writes a .obj file with texture, with a simpler interface than write_obj.

This function writes mtl files and copy textures if necessary

Parameters:
  • filepath (str) – path to the .obj file to write

  • vertices (np.ndarray) – (n,3) coordinates of vertices

  • faces (np.ndarray) – (m,3) faces defined by vertex indices

  • uv (np.ndarray, optional) – (n,2) UV coordinates of each vertex

  • mtl_file (str, optional) – name or path of the .mtl file. If just a name, a default material will be created.

  • texture_im (str, optional) – name or path of the .jpg file defining texture

  • mtl_name (str, optional) – name of the material in the .mtl file

  • precision (int, optional) – number of significant digits to write for each float

  • vertex_normals (np.ndarray, optional) – (n,3) array of vertex normals

  • verbose (bool, optional) – whether to print information