mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
fixed corrupted exported mesh
This commit is contained in:
@@ -4038,13 +4038,27 @@ void MainWindow::saveMeshes(const std::map<int, pcl::PolygonMesh::Ptr> & meshes,
|
|||||||
bool success =false;
|
bool success =false;
|
||||||
if(QFileInfo(path).suffix() == "ply")
|
if(QFileInfo(path).suffix() == "ply")
|
||||||
{
|
{
|
||||||
success = pcl::io::savePLYFile(path.toStdString(), *meshes.begin()->second, binaryMode) == 0;
|
if(binaryMode)
|
||||||
|
{
|
||||||
|
success = pcl::io::savePLYFileBinary(path.toStdString(), *meshes.begin()->second) == 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
success = pcl::io::savePLYFile(path.toStdString(), *meshes.begin()->second) == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(QFileInfo(path).suffix() == "")
|
else if(QFileInfo(path).suffix() == "")
|
||||||
{
|
{
|
||||||
//default ply
|
//default ply
|
||||||
path += ".ply";
|
path += ".ply";
|
||||||
success = pcl::io::savePLYFile(path.toStdString(), *meshes.begin()->second, binaryMode) == 0;
|
if(binaryMode)
|
||||||
|
{
|
||||||
|
success = pcl::io::savePLYFileBinary(path.toStdString(), *meshes.begin()->second) == 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
success = pcl::io::savePLYFile(path.toStdString(), *meshes.begin()->second) == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -4094,7 +4108,14 @@ void MainWindow::saveMeshes(const std::map<int, pcl::PolygonMesh::Ptr> & meshes,
|
|||||||
bool success =false;
|
bool success =false;
|
||||||
if(suffix == "ply")
|
if(suffix == "ply")
|
||||||
{
|
{
|
||||||
success = pcl::io::savePLYFile(pathFile.toStdString(), mesh, binaryMode) == 0;
|
if(binaryMode)
|
||||||
|
{
|
||||||
|
success = pcl::io::savePLYFileBinary(pathFile.toStdString(), mesh) == 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
success = pcl::io::savePLYFile(pathFile.toStdString(), mesh) == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user