Merged pull request "Gyroid improvements" #2730

by @supermerill and @wavexx

WIP: The function Fill::connect_infill() is being rewritten
to utilize spatial structures wherever possible for lower CPU load
and less dynamic memory allocation.
This commit is contained in:
bubnikv 2019-11-07 14:03:50 +01:00
commit f2dd49a905
8 changed files with 957 additions and 125 deletions

View file

@ -77,6 +77,11 @@ public:
void triangulate_pp(Points *triangles) const;
void triangulate_p2t(Polygons* polygons) const;
Lines lines() const;
// Number of contours (outer contour with holes).
size_t num_contours() const { return this->holes.size() + 1; }
Polygon& contour_or_hole(size_t idx) { return (idx == 0) ? this->contour : this->holes[idx - 1]; }
const Polygon& contour_or_hole(size_t idx) const { return (idx == 0) ? this->contour : this->holes[idx - 1]; }
};
inline bool operator==(const ExPolygon &lhs, const ExPolygon &rhs) { return lhs.contour == rhs.contour && lhs.holes == rhs.holes; }