Hacker News new | ask | show | jobs
by ur-whale 2119 days ago
Never mind, it was easy: just add the following code at line 45 of demo.py:

    # Output .ply geometry for each face detected
    ocnt = 0
    for face in ver_lst:
        with open('face_%04d.ply' % ocnt, 'w') as f:
            x = face[0]
            y = face[1]
            z = face[2]
            n = x.size
            print('ply', file=f)
            print('format ascii 1.0', file=f)
            print('element vertex %d' % n, file=f)
            print('property float x', file=f)
            print('property float y', file=f)
            print('property float z', file=f)
            print('element face 0', file=f)
            print('property list uchar int vertex_indices', file=f)
            print('end_header', file=f)
            for i in range(0, n):
                print("%12.8f %12.8f %12.8f" % (x[i], y[i], z[i]), file=f)
            ocnt += 1
1 comments

Thanks, I will consider adding it later :)