Skip to content

Commit

Permalink
Merge pull request PointCloudLibrary#422 from ujohnny/416
Browse files Browse the repository at this point in the history
savePolygonFile "Unsupported file type" fix
  • Loading branch information
rbrusu committed Jan 2, 2014
2 parents 77d0240 + d8b5686 commit c05cc19
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit c05cc19

Please sign in to comment.