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>2015-10-27 01:23:03 +0300
committerAlessandro Ranellucci <aar@cpan.org>2015-10-27 01:24:46 +0300
commit9fcec107373b6846f3775fe353c7ae29653cf9ac (patch)
tree745479a8dfd50c9f2d4ccbae9b886ab064710821 /xs/src/libslic3r/ClipperUtils.cpp
parent5b8ed7367a2a9148c215eafa53c7e13b30cd0c36 (diff)
Finished porting LayerRegion to C++
Diffstat (limited to 'xs/src/libslic3r/ClipperUtils.cpp')
-rw-r--r--xs/src/libslic3r/ClipperUtils.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/xs/src/libslic3r/ClipperUtils.cpp b/xs/src/libslic3r/ClipperUtils.cpp
index baddd8f45..3d07891b1 100644
--- a/xs/src/libslic3r/ClipperUtils.cpp
+++ b/xs/src/libslic3r/ClipperUtils.cpp
@@ -212,6 +212,15 @@ offset(const Slic3r::Polygons &polygons, Slic3r::ExPolygons* retval, const float
ClipperPaths_to_Slic3rExPolygons(output, retval);
}
+Slic3r::ExPolygons
+offset_ex(const Slic3r::Polygons &polygons, const float delta,
+ double scale, ClipperLib::JoinType joinType, double miterLimit)
+{
+ Slic3r::ExPolygons expp;
+ offset(polygons, &expp, delta, scale, joinType, miterLimit);
+ return expp;
+}
+
void
offset2(const Slic3r::Polygons &polygons, ClipperLib::Paths* retval, const float delta1,
const float delta2, const double scale, const ClipperLib::JoinType joinType, const double miterLimit)
@@ -472,13 +481,16 @@ diff(const Slic3r::Polygons &subject, const Slic3r::Polygons &clip, bool safety_
return pp;
}
+template <class SubjectType, class ClipType>
Slic3r::ExPolygons
-diff_ex(const Slic3r::Polygons &subject, const Slic3r::Polygons &clip, bool safety_offset_)
+diff_ex(const SubjectType &subject, const ClipType &clip, bool safety_offset_)
{
Slic3r::ExPolygons expp;
diff(subject, clip, &expp, safety_offset_);
return expp;
}
+template Slic3r::ExPolygons diff_ex<Slic3r::Polygons, Slic3r::Polygons>(const Slic3r::Polygons &subject, const Slic3r::Polygons &clip, bool safety_offset_);
+template Slic3r::ExPolygons diff_ex<Slic3r::Polygons, Slic3r::ExPolygons>(const Slic3r::Polygons &subject, const Slic3r::ExPolygons &clip, bool safety_offset_);
template <class SubjectType, class ResultType>
void intersection(const SubjectType &subject, const Slic3r::Polygons &clip, ResultType* retval, bool safety_offset_)
@@ -507,6 +519,14 @@ intersection(const Slic3r::Polylines &subject, const Slic3r::Polygons &clip, boo
return pp;
}
+Slic3r::ExPolygons
+intersection_ex(const Slic3r::Polygons &subject, const Slic3r::Polygons &clip, bool safety_offset_)
+{
+ Slic3r::ExPolygons expp;
+ intersection(subject, clip, &expp, safety_offset_);
+ return expp;
+}
+
template <class SubjectType>
bool intersects(const SubjectType &subject, const Slic3r::Polygons &clip, bool safety_offset_)
{