Fix of SPE-1658 GH #9665 Crash at macOS when Orgnanic Support selected

Reworked (again!) connecting of islands into a Z-graph.
Implemented various heuristics to handle self-intersecting and
mutually intersecting ExPolygons on the same layer.
This commit is contained in:
Vojtech Bubnik 2023-04-18 12:57:00 +02:00
parent 206d251f27
commit fdac21b807
2 changed files with 262 additions and 117 deletions

View file

@ -1911,6 +1911,16 @@ std::vector<ExPolygons> slice_mesh_ex(
this_mode == MeshSlicingParams::SlicingMode::EvenOdd ? ClipperLib::pftEvenOdd :
this_mode == MeshSlicingParams::SlicingMode::PositiveLargestContour ? ClipperLib::pftPositive : ClipperLib::pftNonZero,
&expolygons);
#if 0
//#ifndef _NDEBUG
// Test whether the expolygons in a single layer overlap.
for (size_t i = 0; i < expolygons.size(); ++ i)
for (size_t j = i + 1; j < expolygons.size(); ++ j) {
Polygons overlap = intersection(expolygons[i], expolygons[j]);
assert(overlap.empty());
}
#endif
#if 0
//#ifndef _NDEBUG
for (const ExPolygon &ex : expolygons) {