Little refactoring of douglas_peucker()
This commit is contained in:
parent
6d0ceeb886
commit
fd437dcaf5
7 changed files with 46 additions and 28 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue