Skip to content

savePolygonFile "Unsupported file type" fix #422

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

Merged
merged 1 commit into from
Jan 2, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions io/src/vtk_lib_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ pcl::io::savePolygonFile (const std::string &file_name, const pcl::PolygonMesh&
// TODO: what about sensor position and orientation?!?!?!?
// TODO: how to adequately catch exceptions thrown by the vtk writers?!
std::string extension = file_name.substr (file_name.find_last_of (".") + 1);
if (extension == ".pcd") // no Polygon, but only a point cloud
if (extension == "pcd") // no Polygon, but only a point cloud
{
int error_code = pcl::io::savePCDFile (file_name, mesh.cloud);
if (error_code != 0)
return (0);
return (static_cast<int> (mesh.cloud.width * mesh.cloud.height));
}
else if (extension == ".vtk")
else if (extension == "vtk")
return (pcl::io::savePolygonFileVTK (file_name, mesh));
else if (extension == ".ply")
else if (extension == "ply")
return (pcl::io::savePolygonFilePLY (file_name, mesh));
else if (extension == ".stl" )
else if (extension == "stl" )
return (pcl::io::savePolygonFileSTL (file_name, mesh));
else
{
Expand Down