Import / read PLY files with color
Based on https://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadPLY and https://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/WritePLY I am trying to read a PLY-File with color information on vertices and then write the poly data incl. colors into a new file. But the new file has no colors.
I am able to write PLY files with colors based on otherwise generated polygons, so I think the problem is that the vtkPlyReader does not read the colors of the original file.
This is my approach:
` vtkSmartPointer colors = vtkSmartPointer::New(); colors->SetNumberOfComponents(3); colors->SetName("Colors");
vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName ( "input.ply" ); reader->Update();
vtkSmartPointer plyWriter1 = vtkSmartPointer::New(); plyWriter1->SetFileName("output.ply"); plyWriter1->SetArrayName("Colors"); plyWriter1->SetInputData(reader->GetOutput()); plyWriter1->Write(); `
Is there a way to import the color information from the PLY file?