Ported Print::validate() to XS

This commit is contained in:
Alessandro Ranellucci 2014-11-09 15:27:34 +01:00
parent 3e4c572164
commit bad0bd8520
10 changed files with 148 additions and 75 deletions

View file

@ -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