Fix crash when splitting objects

fixes partially #2209
This commit is contained in:
tamasmeszaros 2020-12-03 14:58:56 +01:00
parent 91b1d469eb
commit 310de2f2ef

View file

@ -1273,6 +1273,10 @@ void ModelObject::split(ModelObjectPtrs* new_objects)
ModelVolume* volume = this->volumes.front(); ModelVolume* volume = this->volumes.front();
TriangleMeshPtrs meshptrs = volume->mesh().split(); TriangleMeshPtrs meshptrs = volume->mesh().split();
for (TriangleMesh *mesh : meshptrs) { for (TriangleMesh *mesh : meshptrs) {
// FIXME: crashes if not satisfied
if (mesh->facets_count() < 3) continue;
mesh->repair(); mesh->repair();
// XXX: this seems to be the only real usage of m_model, maybe refactor this so that it's not needed? // XXX: this seems to be the only real usage of m_model, maybe refactor this so that it's not needed?