diff --git a/io/src/vtk_lib_io.cpp b/io/src/vtk_lib_io.cpp index e00bd79d97a..1e033702911 100644 --- a/io/src/vtk_lib_io.cpp +++ b/io/src/vtk_lib_io.cpp @@ -182,8 +182,8 @@ pcl::io::savePolygonFileVTK (const std::string &file_name, poly_writer->SetInputData (poly_data); #endif - if (!binary_format) - poly_writer->SetFileTypeToASCII (); + if (binary_format) + poly_writer->SetFileTypeToBinary (); poly_writer->SetFileName (file_name.c_str ()); return (poly_writer->Write ()); @@ -206,8 +206,8 @@ pcl::io::savePolygonFilePLY (const std::string &file_name, poly_writer->SetInputData (poly_data); #endif - if (!binary_format) - poly_writer->SetFileTypeToASCII (); + if (binary_format) + poly_writer->SetFileTypeToBinary (); poly_writer->SetFileName (file_name.c_str ()); poly_writer->SetArrayName ("Colors"); @@ -230,8 +230,8 @@ pcl::io::savePolygonFileSTL (const std::string &file_name, poly_writer->SetInputData (poly_data); #endif - if (!binary_format) - poly_writer->SetFileTypeToASCII (); + if (binary_format) + poly_writer->SetFileTypeToBinary (); poly_writer->SetFileName (file_name.c_str ()); return (poly_writer->Write ());