MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / save_obj

Function save_obj

util/vis.py:161–170  ·  view source on GitHub ↗
(v, f, file_name='output.obj')

Source from the content-addressed store, hash-verified

159
160
161def save_obj(v, f, file_name='output.obj'):
162 obj_file = open(file_name, 'w')
163 for i in range(len(v)):
164 obj_file.write('v ' + str(v[i][0]) + ' ' + str(v[i][1]) + ' ' +
165 str(v[i][2]) + '\n')
166 for i in range(len(f)):
167 obj_file.write('f ' + str(f[i][0] + 1) + '/' + str(f[i][0] + 1) + ' ' +
168 str(f[i][1] + 1) + '/' + str(f[i][1] + 1) + ' ' +
169 str(f[i][2] + 1) + '/' + str(f[i][2] + 1) + '\n')
170 obj_file.close()
171
172
173def perspective_projection(vertices, cam_param):

Callers 2

save_meshes_as_objsFunction · 0.85
inferenceMethod · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected