pyFM.mesh.file_utils.write_obj¶
- pyFM.mesh.file_utils.write_obj(filepath, vertices, faces=None, uv=None, fvt=None, fnt=None, vertex_normals=None, mtl_path=None, mtl_name='material_0', precision=None)¶
Writes a .obj file with texture.
If material is used, the .mtl file will be copied to the same directory as the .obj file.
- Parameters:
filepath (str) – path to the .obj file to write
vertices (np.ndarray) – (n,3) array of vertices coordinates
faces (np.ndarray, optional) – (m,3) array of indices of face vertices
uv (np.ndarray, optional) – (n,2) array of uv coordinates
fvt (np.ndarray, optional) – (m,3) array of indices of face to vertex texture indices
fnt (np.ndarray, optional) – (m,3) array of indices of face to texture normal indices
vertex_normals (np.ndarray, optional) – (n,3) array of vertex normals
mtl_path (str, optional) – path to the .mtl file defining the material
mtl_name (str, optional) – name of the material in the .mtl file
precision (int, optional) – number of significant digits to write for each float