mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Recursive pruning. Some more unit tests
This commit is contained in:
parent
33da6adc3c
commit
2a73ab988f
7 changed files with 86 additions and 98 deletions
|
@ -135,19 +135,15 @@ ExPolygon::simplify(double tolerance, ExPolygons &expolygons) const
|
|||
}
|
||||
|
||||
void
|
||||
ExPolygon::medial_axis(double width, Polylines* polylines) const
|
||||
ExPolygon::medial_axis(double max_width, double min_width, Polylines* polylines) const
|
||||
{
|
||||
// init helper object
|
||||
Slic3r::Geometry::MedialAxis ma(width);
|
||||
Slic3r::Geometry::MedialAxis ma(max_width, min_width);
|
||||
|
||||
// populate list of segments for the Voronoi diagram
|
||||
ExPolygons expp;
|
||||
this->simplify(scale_(0.01), expp);
|
||||
for (ExPolygons::const_iterator expolygon = expp.begin(); expolygon != expp.end(); ++expolygon) {
|
||||
expolygon->contour.lines(&ma.lines);
|
||||
for (Polygons::const_iterator hole = expolygon->holes.begin(); hole != expolygon->holes.end(); ++hole)
|
||||
hole->lines(&ma.lines);
|
||||
}
|
||||
this->contour.lines(&ma.lines);
|
||||
for (Polygons::const_iterator hole = this->holes.begin(); hole != this->holes.end(); ++hole)
|
||||
hole->lines(&ma.lines);
|
||||
|
||||
// compute the Voronoi diagram
|
||||
ma.build(polylines);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue