Added try/catch around 3D mesh generation
This commit is contained in:
@@ -87,13 +87,13 @@ public:
|
||||
|
||||
void rebuild(Floorplan::IndoorMap* im) {
|
||||
|
||||
// rebuild the mesh
|
||||
Ray3D::ModelFactory fac(im);
|
||||
mesh = fac.getMesh();
|
||||
|
||||
triaTransp.clear();
|
||||
triaSolid.clear();
|
||||
|
||||
// rebuild the mesh
|
||||
try {
|
||||
Ray3D::ModelFactory fac(im);
|
||||
mesh = fac.getMesh();
|
||||
for (const Ray3D::Obstacle3D& obs : mesh.elements) {
|
||||
const int matID = getMaterial(obs);
|
||||
const Material& mat = mats[matID];
|
||||
@@ -106,7 +106,10 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch(const std::exception& e) {
|
||||
std::cout << "Can't create 3D view. Failed to get mesh from model factory with error: '" << e.what() << "'" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user