mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 10:47:50 -06:00
Bugfix of bottom bridges. If close regions shall be closed by bridges,
these regions are grown to anchor the bridge lines to the bottom surface. The grown regions may overlap. In that case the regions are now merged before the bridging direction is calculated for the merged region.
This commit is contained in:
parent
b5e24d3527
commit
3a81e6bee4
12 changed files with 265 additions and 10 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "Polygon.hpp"
|
||||
#include "Line.hpp"
|
||||
#include "ClipperUtils.hpp"
|
||||
#include "SVG.hpp"
|
||||
#include "polypartition.h"
|
||||
#include "poly2tri/poly2tri.h"
|
||||
#include <algorithm>
|
||||
|
@ -34,6 +35,17 @@ ExPolygon::operator Polygons() const
|
|||
return polygons;
|
||||
}
|
||||
|
||||
ExPolygon::operator Polylines() const
|
||||
{
|
||||
Polylines polylines;
|
||||
polylines.reserve(this->holes.size() + 1);
|
||||
polylines.push_back((Polyline)this->contour);
|
||||
for (Polygons::const_iterator it = this->holes.begin(); it != this->holes.end(); ++it) {
|
||||
polylines.push_back((Polyline)*it);
|
||||
}
|
||||
return polylines;
|
||||
}
|
||||
|
||||
void
|
||||
ExPolygon::scale(double factor)
|
||||
{
|
||||
|
@ -104,6 +116,25 @@ ExPolygon::contains(const Polyline &polyline) const
|
|||
return pl_out.empty();
|
||||
}
|
||||
|
||||
bool
|
||||
ExPolygon::contains(const Polylines &polylines) const
|
||||
{
|
||||
#if 0
|
||||
BoundingBox bbox = get_extents(polylines);
|
||||
bbox.merge(get_extents(*this));
|
||||
SVG svg("out\\ExPolygon_contains.svg", bbox);
|
||||
svg.draw(*this);
|
||||
svg.draw_outline(*this);
|
||||
svg.draw(polylines, "blue");
|
||||
#endif
|
||||
Polylines pl_out;
|
||||
diff(polylines, *this, &pl_out);
|
||||
#if 0
|
||||
svg.draw(pl_out, "red");
|
||||
#endif
|
||||
return pl_out.empty();
|
||||
}
|
||||
|
||||
bool
|
||||
ExPolygon::contains(const Point &point) const
|
||||
{
|
||||
|
@ -131,6 +162,16 @@ ExPolygon::has_boundary_point(const Point &point) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
ExPolygon::overlaps(const ExPolygon &other) const
|
||||
{
|
||||
Polylines pl_out;
|
||||
intersection((Polylines)other, *this, &pl_out);
|
||||
if (! pl_out.empty())
|
||||
return true;
|
||||
return ! other.contour.points.empty() && this->contains_b(other.contour.points.front());
|
||||
}
|
||||
|
||||
void
|
||||
ExPolygon::simplify_p(double tolerance, Polygons* polygons) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue