From bad0bd8520abfa7d54ee01a272959d06ec5f4653 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 9 Nov 2014 15:27:34 +0100 Subject: Ported Print::validate() to XS --- xs/src/libslic3r/Geometry.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xs/src/libslic3r/Geometry.cpp') 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 -- cgit v1.2.3