Reputation: 21
Is there a way of reading a PLY file and show the face colors when visualizing the geometry? This is how I open a dialog window to select the PLY file and read the mesh and subsequently visualize it.
root = tk.Tk()
root.withdraw()
input_file = filedialog.askopenfilename(filetypes=[('PLY Files', '*.ply')])
file_name = os.path.basename(input_file)
self.mesh = o3d.io.read_triangle_mesh(input_file)
self.mesh.compute_vertex_normals()
o3d.visualization.draw_geometries([self.mesh])
This excerpt is from a method of a larger app, when I click a button, the dialog opens up, and when the file is selected the visualization window is opened, that is why it has the "self."
Upvotes: 1
Views: 1062