obj Package¶
parser¶
Handlers for reading/writing from/into OBJ format Surfaces are defined in this module.
- class tvb.adapters.uploaders.obj.parser.ObjParser[source]¶
Bases:
objectThis class reads geometry from a simple wavefront obj file.
self.vertices,self.tex_coords,self.normalsare lists of vectors represented as tuplesself.facesis a list of faces. A face is a list of vertex info. Vertex info is a tuple vertex_index, tex_index, normal_index.
- class tvb.adapters.uploaders.obj.parser.ObjWriter(obj_file)[source]¶
Bases:
object- write(vertices, faces, normals=None, comment='')[source]¶
- Parameters:
normals (vertices:, :param) – are lists of vectors or ndarrays of shape (n,3)
faces – A face is a list of 3 vertex indices.
Normal indices not supported. Texture uv’s not supported. This method does not yet validate the input, so send valid data.