Bug correction in the logic for loading an Ascii model

Esse commit está contido em:
Joachim Hagege
2014-06-28 18:13:11 +03:00
commit 074d4cea00
+4 -2
Ver Arquivo
@@ -133,13 +133,15 @@ SimpleModel* loadModelSTL(SimpleModel *m,const char* filename, FMatrix3x3& matri
SimpleModel* asciiModel = loadModelSTL_ascii(m, filename, matrix);
if (!asciiModel)
return nullptr;
else
return asciiModel;
// This logic is used to handle the case where the file starts with
// "solid" but is a binary file.
if (m->volumes[m->volumes.size()-1].faces.size() < 1)
{
m->volumes.erase(m->volumes.end() - 1);
return loadModelSTL_binary(m, filename, matrix);
}
return asciiModel;
}
return loadModelSTL_binary(m, filename, matrix);
}