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

Save reconstruct colored mesh #58

Open
PiotrRzRobotec opened this issue Dec 20, 2023 · 2 comments
Open

Save reconstruct colored mesh #58

PiotrRzRobotec opened this issue Dec 20, 2023 · 2 comments

Comments

@PiotrRzRobotec
Copy link

I have a problem with saving generated mesh as ply with vertex color. I can visualize proper colors with:
vis.show_3d([vis.mesh(mesh.v, mesh.f, color=mesh.c)], [pcd])

but I don't know how to save vertex color information with a mesh. I'm able to create a ply file with this:
vis.to_file(vis.mesh(mesh.v, mesh.f, color=mesh.c), "../assets/final.ply")
but I don't have vertex color in it.

Is it possible to do it?

@zhouilu
Copy link

zhouilu commented Jan 3, 2024

I have a problem with saving generated mesh as ply with vertex color. I can visualize proper colors with: vis.show_3d([vis.mesh(mesh.v, mesh.f, color=mesh.c)], [pcd])

but I don't know how to save vertex color information with a mesh. I'm able to create a ply file with this: vis.to_file(vis.mesh(mesh.v, mesh.f, color=mesh.c), "../assets/final.ply") but I don't have vertex color in it.

Is it possible to do it?

your points cloud have color? you can read like this

pcd = o3d.io.read_point_cloud("input.ply")
input_xyz = torch.from_numpy(np.asarray(pcd.points)).to(torch.float)
input_color = torch.from_numpy(np.asarray(pcd.colors)).to(torch.float)
input_normal = torch.from_numpy(np.asarray(pcd.normals)).to(torch.float)

@PiotrRzRobotec
Copy link
Author

PiotrRzRobotec commented Jan 4, 2024

Thank you for the answer. Yes, my point cloud has color and already I am reading point cloud like that.
However, I realized it was an issue in Blender where I was trying to load exported ply.
vis.to_file(vis.mesh(mesh.v, mesh.f, color=mesh.c) was working from beginning, everything is fine now

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