Hotfix for crash when empty pad and support mesh is generated.

This commit is contained in:
tamasmeszaros 2019-08-09 17:13:18 +02:00
parent aa7f98b020
commit a49caea6cc

View file

@ -713,7 +713,7 @@ struct Pad {
}
tmesh.translate(0, 0, float(zlevel));
tmesh.require_shared_vertices();
if (!tmesh.empty()) tmesh.require_shared_vertices();
}
bool empty() const { return tmesh.facets_count() == 0; }
@ -2626,10 +2626,10 @@ std::vector<ExPolygons> SLASupportTree::slice(
}
size_t len = grid.size();
for (const Slices slv : slices) { len = std::min(len, slv.size()); }
for (const Slices &slv : slices) { len = std::min(len, slv.size()); }
// Either the support or the pad or both has to be non empty
assert(!slices.empty());
if (slices.empty()) return {};
Slices &mrg = slices.front();