WIP Refactoring of Layers: LayerIslands filled in with perimeter

extrusions, gap fill extrusions and fill regions.
This commit is contained in:
Vojtech Bubnik 2022-11-02 12:59:31 +01:00
parent 2eb0417018
commit 409fae6183
13 changed files with 891 additions and 560 deletions

View file

@ -306,6 +306,18 @@ Lines ExPolygon::lines() const
return lines;
}
// Do expolygons match? If they match, they must have the same topology,
// however their contours may be rotated.
bool expolygons_match(const ExPolygon &l, const ExPolygon &r)
{
if (l.holes.size() != r.holes.size() || ! polygons_match(l.contour, r.contour))
return false;
for (size_t hole_idx = 0; hole_idx < l.holes.size(); ++ hole_idx)
if (! polygons_match(l.holes[hole_idx], r.holes[hole_idx]))
return false;
return true;
}
BoundingBox get_extents(const ExPolygon &expolygon)
{
return get_extents(expolygon.contour);