ddg.conversion.obj.halfedge module

ddg.conversion.obj.halfedge.hds_to_obj(surface, filename='obj_file.obj', co_attr='co')[source]
Converts a ddg.halfedge.Surface to an obj file.
If ‘vn’ and/or ‘vt’ are given as halfedge attributes, they will be
written in the obj file format.
The vertices need to have an attribute storing the coordinates.
Results in obj file with given v and faces of the form f 1 2 3
or given v,vt and faces of the form f 1/1 2/1 3/1
or given v,vn and faces of the form f 1//1 2//1 3//1
or given v,vt,vn and faces of the form f 1/1/2 2/1/2 3/1/2.
Vertices will be ordered by indices and vt and vn coordinates in increasing order.
Parameters:
surface: ddg.halfedge.Surface

halfedge data structure to be converted

filenamestr (default=’obj_file.obj’)

Name for the resulting obj file a file path can be specified here default is ‘obj_file’ which will be saved in the cwd

co_attrstr (default=’co’)

string of the vertx attribute that stores the coordinates

Notes

  • Indexing in obj files starts at 1.