mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
More unfinished work
This commit is contained in:
parent
518798beb3
commit
df8d889481
16 changed files with 74 additions and 48 deletions
|
@ -83,21 +83,32 @@ ExPolygon::contains_point(const Point* point) const
|
|||
}
|
||||
|
||||
Polygons
|
||||
ExPolygon::simplify(double tolerance) const
|
||||
ExPolygon::simplify_p(double tolerance) const
|
||||
{
|
||||
Polygons p;
|
||||
this->contour.simplify(tolerance, p);
|
||||
for (Polygons::const_iterator it = this->holes.begin(); it != this->holes.end(); ++it)
|
||||
it->simplify(tolerance, p);
|
||||
simplify_polygons(p, p);
|
||||
return p;
|
||||
Polygons pp(this->holes.size() + 1);
|
||||
|
||||
// contour
|
||||
Polygon p = this->contour;
|
||||
p.points = MultiPoint::_douglas_peucker(p.points, tolerance);
|
||||
pp.push_back(p);
|
||||
|
||||
// holes
|
||||
for (Polygons::const_iterator it = this->holes.begin(); it != this->holes.end(); ++it) {
|
||||
p = *it;
|
||||
p.points = MultiPoint::_douglas_peucker(p.points, tolerance);
|
||||
pp.push_back(p);
|
||||
}
|
||||
simplify_polygons(pp, pp);
|
||||
return pp;
|
||||
}
|
||||
|
||||
ExPolygons
|
||||
ExPolygon::simplify(double tolerance) const
|
||||
{
|
||||
Polygons p = this->simplify(tolerance);
|
||||
return union_(p);
|
||||
Polygons pp = this->simplify_p(tolerance);
|
||||
ExPolygons expp;
|
||||
union_(pp, expp);
|
||||
return expp;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue