Hacker News new | past | comments | ask | show | jobs | submit login

Very, very nice, congratulations.

And it pretty much works out of the box, something rather unusual for researchy code.

What would make this absolutely great is there was a way to output a wavefront OBJ file for the dense 3D geometry.




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


Thanks, I will consider adding it later :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: