Fix polytree traversal.

Put back old traverse_pt and union_pt_chained
This commit is contained in:
tamasmeszaros 2019-12-19 11:27:01 +01:00
parent 2feb8421e9
commit 42ffc4e3c5
4 changed files with 211 additions and 117 deletions

View file

@ -337,18 +337,15 @@ PadSkeleton divide_blueprint(const ExPolygons &bp)
for (ClipperLib::PolyTree::PolyNode *node : ptree.Childs) {
ExPolygon poly(ClipperPath_to_Slic3rPolygon(node->Contour));
for (ClipperLib::PolyTree::PolyNode *child : node->Childs) {
if (child->IsHole()) {
poly.holes.emplace_back(
ClipperPath_to_Slic3rPolygon(child->Contour));
poly.holes.emplace_back(
ClipperPath_to_Slic3rPolygon(child->Contour));
traverse_pt_unordered(child->Childs, &ret.inner);
}
else traverse_pt_unordered(child, &ret.inner);
traverse_pt(child->Childs, &ret.inner);
}
ret.outer.emplace_back(poly);
}
return ret;
}