write

m3sh.obj.write(filename, *, f=None, **data)[source]

Write to file.

Face data is expected as a nested list. 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 with a None value.

Parameters:
  • filename (str) – Name of output file.

  • f (list) – Face definitions.

  • **data – Keyword arguments.

Data blocks to be stored in the file are passed via keyword arguments:

>>> mesh.write('output-file.obj', line_tag=data_block)

This assumes that data_block can be interpreted as a 2-dimensional array. The contents of each row are written to a line that starts with the given tag.