Little refactoring of douglas_peucker()

This commit is contained in:
Vojtech Bubnik 2023-05-02 15:48:24 +02:00
parent 6d0ceeb886
commit fd437dcaf5
7 changed files with 46 additions and 28 deletions

View file

@ -184,14 +184,14 @@ Polygons ExPolygon::simplify_p(double tolerance) const
{
Polygon p = this->contour;
p.points.push_back(p.points.front());
p.points = MultiPoint::_douglas_peucker(p.points, tolerance);
p.points = MultiPoint::douglas_peucker(p.points, tolerance);
p.points.pop_back();
pp.emplace_back(std::move(p));
}
// holes
for (Polygon p : this->holes) {
p.points.push_back(p.points.front());
p.points = MultiPoint::_douglas_peucker(p.points, tolerance);
p.points = MultiPoint::douglas_peucker(p.points, tolerance);
p.points.pop_back();
pp.emplace_back(std::move(p));
}