write#
- write(filename, append=False, absolute=True, **data)#
Write as .obj file.
This is a low-level function used by
Meshinstances. See the notes below for usage instructions.- Parameters:
Notes
Data to be stored in the file is passed via keyword arguments:
>>> mesh.write('output-file.obj', tag=value, ...)
This assumes that
valuecan be interpreted as a 2-dimensional array. The contents of each row are written to a line that starts with the given tag (keyword).Generically we want to store a list of points (used as vertices) and as list of faces. Assuming that points is array_like and faces is a nested list of integers, this can be achieved by
>>> write('file.obj', v=points, f=faces)
Specifying faces
Each entry of a face (a vertex definition) can be a single integer or a 3-tuple of integers. Tuple entries are interpreted as v/vt/vn triples, missing entries have to be specified as
Nonevalues. Indices used in vertex definitions can be absolute (i.e., non-negative, 0-based) or relative (i.e., negative). Absolute and relative indices may not be mixed.