Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange box when trying to convert tensoRF to mesh #6

Closed
brabbitdousha opened this issue Apr 9, 2024 · 2 comments
Closed

strange box when trying to convert tensoRF to mesh #6

brabbitdousha opened this issue Apr 9, 2024 · 2 comments

Comments

@brabbitdousha
Copy link

brabbitdousha commented Apr 9, 2024

Hi, I tried to convert tensoRF to mesh using:

verts, faces = diffmc_worker(pytorch_3d_sdf_tensor - level, None)

    verts_numpy = verts.cpu().numpy()
    mesh_points = np.zeros_like(verts_numpy)
    mesh_points[:, 0] = bbox[0,0] + verts_numpy[:, 0] * (bbox[1,0] - bbox[0,0])
    mesh_points[:, 1] = bbox[0,1] + verts_numpy[:, 1] * (bbox[1,1] - bbox[0,1])
    mesh_points[:, 2] = bbox[0,2] + verts_numpy[:, 2] * (bbox[1,2] - bbox[0,2])

    # try writing to the obj file
    mesh = trimesh.Trimesh(vertices=mesh_points, faces=faces.cpu().numpy(), process=False)
    print("saving mesh to %s" % (ply_filename_out))
    mesh.export(ply_filename_out)

However, I get strange result like a lego inside a box:
image
is there any modification I need inorder to make it right?

@brabbitdousha brabbitdousha changed the title strange 剥削 strange box when trying to convert tensoRF to mesh Apr 9, 2024
@SarahWeiii
Copy link
Owner

Hi this is because in my definition, the level set values > 0 are defined as outside and values < 0 are defined as inside. You can flip the TensoRF density values to fix the problem.

@brabbitdousha
Copy link
Author

That helps, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants