Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2014-11-23 22:03:16 +0300
committerAlessandro Ranellucci <aar@cpan.org>2014-11-23 22:03:16 +0300
commit5deadc8f123e1a67886de8efffd52f177465bd11 (patch)
tree59b87d3317bcbff60356cf0d1f37cc391d7d0f6e /xs/src/libslic3r
parent4925b056c25b4cb4b2e6f85d41ee2c00928f2660 (diff)
Refactoring: removed _islands members in Slic3r::GCode
Diffstat (limited to 'xs/src/libslic3r')
-rw-r--r--xs/src/libslic3r/ExPolygonCollection.cpp18
-rw-r--r--xs/src/libslic3r/ExPolygonCollection.hpp4
2 files changed, 22 insertions, 0 deletions
diff --git a/xs/src/libslic3r/ExPolygonCollection.cpp b/xs/src/libslic3r/ExPolygonCollection.cpp
index 3de86e7c6..181288c95 100644
--- a/xs/src/libslic3r/ExPolygonCollection.cpp
+++ b/xs/src/libslic3r/ExPolygonCollection.cpp
@@ -64,6 +64,24 @@ ExPolygonCollection::contains_point(const Point &point) const
return false;
}
+bool
+ExPolygonCollection::contains_line(const Line &line) const
+{
+ for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it) {
+ if (it->contains_line(line)) return true;
+ }
+ return false;
+}
+
+bool
+ExPolygonCollection::contains_polyline(const Polyline &polyline) const
+{
+ for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it) {
+ if (it->contains_polyline(polyline)) return true;
+ }
+ return false;
+}
+
void
ExPolygonCollection::simplify(double tolerance)
{
diff --git a/xs/src/libslic3r/ExPolygonCollection.hpp b/xs/src/libslic3r/ExPolygonCollection.hpp
index f6a27284f..07532ccf4 100644
--- a/xs/src/libslic3r/ExPolygonCollection.hpp
+++ b/xs/src/libslic3r/ExPolygonCollection.hpp
@@ -3,6 +3,8 @@
#include <myinit.h>
#include "ExPolygon.hpp"
+#include "Line.hpp"
+#include "Polyline.hpp"
namespace Slic3r {
@@ -23,6 +25,8 @@ class ExPolygonCollection
void translate(double x, double y);
void rotate(double angle, const Point &center);
bool contains_point(const Point &point) const;
+ bool contains_line(const Line &line) const;
+ bool contains_polyline(const Polyline &polyline) const;
void simplify(double tolerance);
void convex_hull(Polygon* hull) const;
};