diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2014-11-09 17:27:34 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2014-11-09 17:27:34 +0300 |
commit | bad0bd8520abfa7d54ee01a272959d06ec5f4653 (patch) | |
tree | 4caa8b93bd6cfb913ad961bca934b3da41965b25 /xs/src/libslic3r/Geometry.cpp | |
parent | 3e4c57216412504e63154b6887bf14f89f4b559f (diff) |
Ported Print::validate() to XS
Diffstat (limited to 'xs/src/libslic3r/Geometry.cpp')
-rw-r--r-- | xs/src/libslic3r/Geometry.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xs/src/libslic3r/Geometry.cpp b/xs/src/libslic3r/Geometry.cpp index 002f11f46..8c2664aa1 100644 --- a/xs/src/libslic3r/Geometry.cpp +++ b/xs/src/libslic3r/Geometry.cpp @@ -52,6 +52,16 @@ convex_hull(Points points, Polygon* hull) hull->points.pop_back(); } +void +convex_hull(const Polygons &polygons, Polygon* hull) +{ + Points pp; + for (Polygons::const_iterator p = polygons.begin(); p != polygons.end(); ++p) { + pp.insert(pp.end(), p->points.begin(), p->points.end()); + } + convex_hull(pp, hull); +} + /* accepts an arrayref of points and returns a list of indices according to a nearest-neighbor walk */ void |