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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2014-12-24 12:20:55 +0300
committerAlessandro Ranellucci <aar@cpan.org>2014-12-24 12:20:55 +0300
commit4848cb7606a3f1f0741bcff9cae0cc19764c59f0 (patch)
treecd4f73bd786f10391fd561ec10f32987606eb413 /xs/src/libslic3r/ClipperUtils.cpp
parentea40c4d1b0d7d67464f7cebdd98a669b4b8ffb4b (diff)
Ported PrintObject::bridge_over_infill() to XS
Diffstat (limited to 'xs/src/libslic3r/ClipperUtils.cpp')
-rw-r--r--xs/src/libslic3r/ClipperUtils.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/xs/src/libslic3r/ClipperUtils.cpp b/xs/src/libslic3r/ClipperUtils.cpp
index 2a86f2a26..ba243ee82 100644
--- a/xs/src/libslic3r/ClipperUtils.cpp
+++ b/xs/src/libslic3r/ClipperUtils.cpp
@@ -426,6 +426,18 @@ template void diff<Slic3r::Polylines, Slic3r::Polylines>(const Slic3r::Polylines
template void diff<Slic3r::Lines, Slic3r::Lines>(const Slic3r::Lines &subject, const Slic3r::Polygons &clip, Slic3r::Lines* retval, bool safety_offset_);
template <class SubjectType, class ResultType>
+void diff(const SubjectType &subject, const Slic3r::ExPolygons &clip, ResultType* retval, bool safety_offset_)
+{
+ Slic3r::Polygons pp;
+ for (Slic3r::ExPolygons::const_iterator ex = clip.begin(); ex != clip.end(); ++ex) {
+ Slic3r::Polygons ppp = *ex;
+ pp.insert(pp.end(), ppp.begin(), ppp.end());
+ }
+ diff(subject, pp, retval, safety_offset_);
+}
+template void diff<Slic3r::Polygons, Slic3r::ExPolygons>(const Slic3r::Polygons &subject, const Slic3r::ExPolygons &clip, Slic3r::ExPolygons* retval, bool safety_offset_);
+
+template <class SubjectType, class ResultType>
void intersection(const SubjectType &subject, const Slic3r::Polygons &clip, ResultType* retval, bool safety_offset_)
{
_clipper(ClipperLib::ctIntersection, subject, clip, retval, safety_offset_);