mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
New coverage detection for bridges. Includes implementation of ExPolygon::get_trapezoids()
This commit is contained in:
parent
d458a7c4d2
commit
6201aacf88
21 changed files with 358 additions and 27 deletions
|
@ -47,7 +47,7 @@ ExPolygon::translate(double x, double y)
|
|||
}
|
||||
|
||||
void
|
||||
ExPolygon::rotate(double angle, Point* center)
|
||||
ExPolygon::rotate(double angle, const Point ¢er)
|
||||
{
|
||||
contour.rotate(angle, center);
|
||||
for (Polygons::iterator it = holes.begin(); it != holes.end(); ++it) {
|
||||
|
@ -158,6 +158,24 @@ ExPolygon::medial_axis(double max_width, double min_width, Polylines* polylines)
|
|||
intersection(*polylines, *this, *polylines);
|
||||
}
|
||||
|
||||
void
|
||||
ExPolygon::get_trapezoids(Polygons* polygons) const
|
||||
{
|
||||
ExPolygons expp;
|
||||
expp.push_back(*this);
|
||||
boost::polygon::get_trapezoids(*polygons, expp);
|
||||
}
|
||||
|
||||
void
|
||||
ExPolygon::get_trapezoids(Polygons* polygons, double angle) const
|
||||
{
|
||||
ExPolygon clone = *this;
|
||||
clone.rotate(PI/2 - angle, Point(0,0));
|
||||
clone.get_trapezoids(polygons);
|
||||
for (Polygons::iterator polygon = polygons->begin(); polygon != polygons->end(); ++polygon)
|
||||
polygon->rotate(-(PI/2 - angle), Point(0,0));
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
SV*
|
||||
ExPolygon::to_AV() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue