Ported from the playground branch. Various documentation and optimization.

This commit is contained in:
bubnikv 2016-09-13 13:30:00 +02:00
parent a5b7f14dfa
commit 620c6c7378
38 changed files with 586 additions and 92 deletions

View file

@ -514,4 +514,20 @@ ExPolygon::dump_perl() const
return ret.str();
}
BoundingBox get_extents(const ExPolygon &expolygon)
{
return get_extents(expolygon.contour);
}
BoundingBox get_extents(const ExPolygons &expolygons)
{
BoundingBox bbox;
if (! expolygons.empty()) {
bbox = get_extents(expolygons.front());
for (size_t i = 1; i < expolygons.size(); ++ i)
bbox.merge(get_extents(expolygons[i]));
}
return bbox;
}
} // namespace Slic3r