2016-09-13 11:30:00 +00:00
|
|
|
#include "BoundingBox.hpp"
|
2013-07-16 19:04:14 +00:00
|
|
|
#include "ClipperUtils.hpp"
|
|
|
|
#include "Polygon.hpp"
|
|
|
|
#include "Polyline.hpp"
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
2014-01-07 14:40:38 +00:00
|
|
|
Polygon::operator Polygons() const
|
|
|
|
{
|
|
|
|
Polygons pp;
|
|
|
|
pp.push_back(*this);
|
|
|
|
return pp;
|
|
|
|
}
|
|
|
|
|
2014-05-08 09:07:37 +00:00
|
|
|
Polygon::operator Polyline() const
|
|
|
|
{
|
2015-01-19 17:53:04 +00:00
|
|
|
return this->split_at_first_point();
|
2014-05-08 09:07:37 +00:00
|
|
|
}
|
|
|
|
|
2014-04-28 18:14:20 +00:00
|
|
|
Point&
|
|
|
|
Polygon::operator[](Points::size_type idx)
|
|
|
|
{
|
|
|
|
return this->points[idx];
|
|
|
|
}
|
|
|
|
|
|
|
|
const Point&
|
|
|
|
Polygon::operator[](Points::size_type idx) const
|
|
|
|
{
|
|
|
|
return this->points[idx];
|
|
|
|
}
|
|
|
|
|
2014-04-24 14:40:10 +00:00
|
|
|
Point
|
2013-09-02 20:33:03 +00:00
|
|
|
Polygon::last_point() const
|
2013-09-02 18:22:20 +00:00
|
|
|
{
|
2014-04-24 14:40:10 +00:00
|
|
|
return this->points.front(); // last point == first point for polygons
|
2013-09-02 18:22:20 +00:00
|
|
|
}
|
|
|
|
|
2013-07-16 19:04:14 +00:00
|
|
|
Lines
|
2013-09-03 17:26:58 +00:00
|
|
|
Polygon::lines() const
|
2013-07-16 19:04:14 +00:00
|
|
|
{
|
|
|
|
Lines lines;
|
2015-01-19 17:53:04 +00:00
|
|
|
lines.reserve(this->points.size());
|
2013-09-13 13:19:15 +00:00
|
|
|
for (Points::const_iterator it = this->points.begin(); it != this->points.end()-1; ++it) {
|
2015-01-19 17:53:04 +00:00
|
|
|
lines.push_back(Line(*it, *(it + 1)));
|
2013-07-16 19:04:14 +00:00
|
|
|
}
|
2015-01-19 17:53:04 +00:00
|
|
|
lines.push_back(Line(this->points.back(), this->points.front()));
|
|
|
|
return lines;
|
2013-07-16 19:04:14 +00:00
|
|
|
}
|
|
|
|
|
2015-01-19 17:53:04 +00:00
|
|
|
Polyline
|
|
|
|
Polygon::split_at_vertex(const Point &point) const
|
2013-08-26 20:39:35 +00:00
|
|
|
{
|
|
|
|
// find index of point
|
|
|
|
for (Points::const_iterator it = this->points.begin(); it != this->points.end(); ++it) {
|
2014-05-07 10:02:09 +00:00
|
|
|
if (it->coincides_with(point)) {
|
2015-01-19 17:53:04 +00:00
|
|
|
return this->split_at_index(it - this->points.begin());
|
2014-05-07 10:02:09 +00:00
|
|
|
}
|
2013-08-26 20:39:35 +00:00
|
|
|
}
|
2013-09-13 13:19:15 +00:00
|
|
|
CONFESS("Point not found");
|
2015-01-19 17:53:04 +00:00
|
|
|
return Polyline();
|
2013-08-26 20:39:35 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 11:30:00 +00:00
|
|
|
// Split a closed polygon into an open polyline, with the split point duplicated at both ends.
|
2015-01-19 17:53:04 +00:00
|
|
|
Polyline
|
|
|
|
Polygon::split_at_index(int index) const
|
2013-07-16 19:04:14 +00:00
|
|
|
{
|
2015-01-19 17:53:04 +00:00
|
|
|
Polyline polyline;
|
|
|
|
polyline.points.reserve(this->points.size() + 1);
|
2013-09-13 13:19:15 +00:00
|
|
|
for (Points::const_iterator it = this->points.begin() + index; it != this->points.end(); ++it)
|
2015-01-19 17:53:04 +00:00
|
|
|
polyline.points.push_back(*it);
|
2013-09-13 13:19:15 +00:00
|
|
|
for (Points::const_iterator it = this->points.begin(); it != this->points.begin() + index + 1; ++it)
|
2015-01-19 17:53:04 +00:00
|
|
|
polyline.points.push_back(*it);
|
|
|
|
return polyline;
|
2013-07-16 19:04:14 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 11:30:00 +00:00
|
|
|
// Split a closed polygon into an open polyline, with the split point duplicated at both ends.
|
2015-01-19 17:53:04 +00:00
|
|
|
Polyline
|
|
|
|
Polygon::split_at_first_point() const
|
2013-07-16 19:04:14 +00:00
|
|
|
{
|
2015-01-19 17:53:04 +00:00
|
|
|
return this->split_at_index(0);
|
2013-07-16 19:04:14 +00:00
|
|
|
}
|
|
|
|
|
2015-01-19 17:53:04 +00:00
|
|
|
Points
|
|
|
|
Polygon::equally_spaced_points(double distance) const
|
2013-11-11 19:59:58 +00:00
|
|
|
{
|
2015-01-19 17:53:04 +00:00
|
|
|
return this->split_at_first_point().equally_spaced_points(distance);
|
2013-11-11 19:59:58 +00:00
|
|
|
}
|
|
|
|
|
2016-10-20 11:04:23 +00:00
|
|
|
/*
|
|
|
|
int64_t Polygon::area2x() const
|
2013-08-26 20:44:40 +00:00
|
|
|
{
|
2016-10-20 11:04:23 +00:00
|
|
|
size_t n = poly.size();
|
|
|
|
if (n < 3)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
int64_t a = 0;
|
|
|
|
for (size_t i = 0, j = n - 1; i < n; ++i)
|
|
|
|
a += int64_t(poly[j].x + poly[i].x) * int64_t(poly[j].y - poly[i].y);
|
|
|
|
j = i;
|
|
|
|
}
|
|
|
|
return -a * 0.5;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
double Polygon::area() const
|
|
|
|
{
|
|
|
|
size_t n = points.size();
|
|
|
|
if (n < 3)
|
|
|
|
return 0.;
|
|
|
|
|
|
|
|
double a = 0.;
|
|
|
|
for (size_t i = 0, j = n - 1; i < n; ++i) {
|
|
|
|
a += double(points[j].x + points[i].x) * double(points[i].y - points[j].y);
|
|
|
|
j = i;
|
|
|
|
}
|
|
|
|
return 0.5 * a;
|
2013-08-26 20:44:40 +00:00
|
|
|
}
|
|
|
|
|
2013-07-16 19:04:14 +00:00
|
|
|
bool
|
2013-08-26 20:50:26 +00:00
|
|
|
Polygon::is_counter_clockwise() const
|
2013-07-16 19:04:14 +00:00
|
|
|
{
|
2013-11-21 13:15:38 +00:00
|
|
|
ClipperLib::Path p;
|
2014-11-15 22:44:03 +00:00
|
|
|
Slic3rMultiPoint_to_ClipperPath(*this, &p);
|
2013-11-21 13:15:38 +00:00
|
|
|
return ClipperLib::Orientation(p);
|
2013-07-16 19:04:14 +00:00
|
|
|
}
|
|
|
|
|
2013-08-26 23:26:44 +00:00
|
|
|
bool
|
|
|
|
Polygon::is_clockwise() const
|
|
|
|
{
|
|
|
|
return !this->is_counter_clockwise();
|
|
|
|
}
|
|
|
|
|
2013-07-16 19:09:29 +00:00
|
|
|
bool
|
|
|
|
Polygon::make_counter_clockwise()
|
|
|
|
{
|
|
|
|
if (!this->is_counter_clockwise()) {
|
|
|
|
this->reverse();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
Polygon::make_clockwise()
|
|
|
|
{
|
|
|
|
if (this->is_counter_clockwise()) {
|
|
|
|
this->reverse();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-08-26 21:27:51 +00:00
|
|
|
bool
|
|
|
|
Polygon::is_valid() const
|
|
|
|
{
|
|
|
|
return this->points.size() >= 3;
|
|
|
|
}
|
|
|
|
|
2016-09-13 11:30:00 +00:00
|
|
|
// Does an unoriented polygon contain a point?
|
|
|
|
// Tested by counting intersections along a horizontal line.
|
2013-11-21 15:21:42 +00:00
|
|
|
bool
|
2014-11-23 19:14:13 +00:00
|
|
|
Polygon::contains(const Point &point) const
|
2013-11-21 15:21:42 +00:00
|
|
|
{
|
|
|
|
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
|
2013-11-21 17:42:16 +00:00
|
|
|
bool result = false;
|
2013-11-21 15:21:42 +00:00
|
|
|
Points::const_iterator i = this->points.begin();
|
|
|
|
Points::const_iterator j = this->points.end() - 1;
|
|
|
|
for (; i != this->points.end(); j = i++) {
|
2016-09-13 11:30:00 +00:00
|
|
|
//FIXME this test is not numerically robust. Particularly, it does not handle horizontal segments at y == point.y well.
|
|
|
|
// Does the ray with y == point.y intersect this line segment?
|
|
|
|
#if 1
|
2014-04-24 14:40:10 +00:00
|
|
|
if ( ((i->y > point.y) != (j->y > point.y))
|
2014-04-30 14:55:20 +00:00
|
|
|
&& ((double)point.x < (double)(j->x - i->x) * (double)(point.y - i->y) / (double)(j->y - i->y) + (double)i->x) )
|
2013-11-21 15:21:42 +00:00
|
|
|
result = !result;
|
2016-09-13 11:30:00 +00:00
|
|
|
#else
|
|
|
|
if ((i->y > point.y) != (j->y > point.y)) {
|
|
|
|
// Orientation predicated relative to i-th point.
|
|
|
|
double orient = (double)(point.x - i->x) * (double)(j->y - i->y) - (double)(point.y - i->y) * (double)(j->x - i->x);
|
|
|
|
if ((i->y > j->y) ? (orient > 0.) : (orient < 0.))
|
|
|
|
result = !result;
|
|
|
|
}
|
|
|
|
#endif
|
2013-11-21 15:21:42 +00:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2015-01-30 17:33:20 +00:00
|
|
|
// this only works on CCW polygons as CW will be ripped out by Clipper's simplify_polygons()
|
2013-11-21 19:25:24 +00:00
|
|
|
Polygons
|
|
|
|
Polygon::simplify(double tolerance) const
|
|
|
|
{
|
2014-12-07 18:53:22 +00:00
|
|
|
// repeat first point at the end in order to apply Douglas-Peucker
|
|
|
|
// on the whole polygon
|
|
|
|
Points points = this->points;
|
|
|
|
points.push_back(points.front());
|
|
|
|
Polygon p(MultiPoint::_douglas_peucker(points, tolerance));
|
|
|
|
p.points.pop_back();
|
2013-11-21 19:25:24 +00:00
|
|
|
|
2013-11-22 01:16:10 +00:00
|
|
|
Polygons pp;
|
|
|
|
pp.push_back(p);
|
2014-11-15 22:44:03 +00:00
|
|
|
simplify_polygons(pp, &pp);
|
2013-11-22 01:16:10 +00:00
|
|
|
return pp;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Polygon::simplify(double tolerance, Polygons &polygons) const
|
|
|
|
{
|
|
|
|
Polygons pp = this->simplify(tolerance);
|
|
|
|
polygons.reserve(polygons.size() + pp.size());
|
|
|
|
polygons.insert(polygons.end(), pp.begin(), pp.end());
|
2013-11-21 19:25:24 +00:00
|
|
|
}
|
|
|
|
|
2014-04-24 14:59:36 +00:00
|
|
|
// Only call this on convex polygons or it will return invalid results
|
|
|
|
void
|
|
|
|
Polygon::triangulate_convex(Polygons* polygons) const
|
|
|
|
{
|
|
|
|
for (Points::const_iterator it = this->points.begin() + 2; it != this->points.end(); ++it) {
|
|
|
|
Polygon p;
|
|
|
|
p.points.reserve(3);
|
|
|
|
p.points.push_back(this->points.front());
|
|
|
|
p.points.push_back(*(it-1));
|
|
|
|
p.points.push_back(*it);
|
2014-04-24 15:06:16 +00:00
|
|
|
|
|
|
|
// this should be replaced with a more efficient call to a merge_collinear_segments() method
|
|
|
|
if (p.area() > 0) polygons->push_back(p);
|
2014-04-24 14:59:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-22 17:34:49 +00:00
|
|
|
// center of mass
|
|
|
|
Point
|
|
|
|
Polygon::centroid() const
|
|
|
|
{
|
|
|
|
double area_temp = this->area();
|
|
|
|
double x_temp = 0;
|
|
|
|
double y_temp = 0;
|
|
|
|
|
2015-01-19 17:53:04 +00:00
|
|
|
Polyline polyline = this->split_at_first_point();
|
2014-05-22 17:34:49 +00:00
|
|
|
for (Points::const_iterator point = polyline.points.begin(); point != polyline.points.end() - 1; ++point) {
|
|
|
|
x_temp += (double)( point->x + (point+1)->x ) * ( (double)point->x*(point+1)->y - (double)(point+1)->x*point->y );
|
|
|
|
y_temp += (double)( point->y + (point+1)->y ) * ( (double)point->x*(point+1)->y - (double)(point+1)->x*point->y );
|
|
|
|
}
|
|
|
|
|
|
|
|
return Point(x_temp/(6*area_temp), y_temp/(6*area_temp));
|
|
|
|
}
|
|
|
|
|
2014-11-15 22:06:15 +00:00
|
|
|
std::string
|
|
|
|
Polygon::wkt() const
|
|
|
|
{
|
|
|
|
std::ostringstream wkt;
|
|
|
|
wkt << "POLYGON((";
|
|
|
|
for (Points::const_iterator p = this->points.begin(); p != this->points.end(); ++p) {
|
|
|
|
wkt << p->x << " " << p->y;
|
|
|
|
if (p != this->points.end()-1) wkt << ",";
|
|
|
|
}
|
|
|
|
wkt << "))";
|
|
|
|
return wkt.str();
|
|
|
|
}
|
|
|
|
|
2015-06-01 15:55:51 +00:00
|
|
|
// find all concave vertices (i.e. having an internal angle greater than the supplied angle)
|
|
|
|
// (external = right side, thus we consider ccw orientation)
|
2015-01-19 17:53:04 +00:00
|
|
|
Points
|
|
|
|
Polygon::concave_points(double angle) const
|
2014-11-30 20:48:50 +00:00
|
|
|
{
|
2015-01-19 17:53:04 +00:00
|
|
|
Points points;
|
2014-12-21 22:10:38 +00:00
|
|
|
angle = 2*PI - angle;
|
|
|
|
|
2014-11-30 20:48:50 +00:00
|
|
|
// check whether first point forms a concave angle
|
2014-12-21 22:10:38 +00:00
|
|
|
if (this->points.front().ccw_angle(this->points.back(), *(this->points.begin()+1)) <= angle)
|
2015-01-19 17:53:04 +00:00
|
|
|
points.push_back(this->points.front());
|
2014-11-30 20:48:50 +00:00
|
|
|
|
|
|
|
// check whether points 1..(n-1) form concave angles
|
|
|
|
for (Points::const_iterator p = this->points.begin()+1; p != this->points.end()-1; ++p) {
|
2015-01-19 17:53:04 +00:00
|
|
|
if (p->ccw_angle(*(p-1), *(p+1)) <= angle) points.push_back(*p);
|
2014-11-30 20:48:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// check whether last point forms a concave angle
|
2014-12-21 22:10:38 +00:00
|
|
|
if (this->points.back().ccw_angle(*(this->points.end()-2), this->points.front()) <= angle)
|
2015-01-19 17:53:04 +00:00
|
|
|
points.push_back(this->points.back());
|
|
|
|
|
|
|
|
return points;
|
2014-11-30 20:48:50 +00:00
|
|
|
}
|
|
|
|
|
2015-06-01 15:55:51 +00:00
|
|
|
// find all convex vertices (i.e. having an internal angle smaller than the supplied angle)
|
|
|
|
// (external = right side, thus we consider ccw orientation)
|
2015-01-19 17:53:04 +00:00
|
|
|
Points
|
|
|
|
Polygon::convex_points(double angle) const
|
2014-11-30 20:48:50 +00:00
|
|
|
{
|
2015-01-19 17:53:04 +00:00
|
|
|
Points points;
|
2014-12-21 22:10:38 +00:00
|
|
|
angle = 2*PI - angle;
|
|
|
|
|
2014-11-30 20:48:50 +00:00
|
|
|
// check whether first point forms a convex angle
|
2014-12-21 22:10:38 +00:00
|
|
|
if (this->points.front().ccw_angle(this->points.back(), *(this->points.begin()+1)) >= angle)
|
2015-01-19 17:53:04 +00:00
|
|
|
points.push_back(this->points.front());
|
2014-11-30 20:48:50 +00:00
|
|
|
|
|
|
|
// check whether points 1..(n-1) form convex angles
|
|
|
|
for (Points::const_iterator p = this->points.begin()+1; p != this->points.end()-1; ++p) {
|
2015-01-19 17:53:04 +00:00
|
|
|
if (p->ccw_angle(*(p-1), *(p+1)) >= angle) points.push_back(*p);
|
2014-11-30 20:48:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// check whether last point forms a convex angle
|
2014-12-21 22:10:38 +00:00
|
|
|
if (this->points.back().ccw_angle(*(this->points.end()-2), this->points.front()) >= angle)
|
2015-01-19 17:53:04 +00:00
|
|
|
points.push_back(this->points.back());
|
|
|
|
|
|
|
|
return points;
|
2014-11-30 20:48:50 +00:00
|
|
|
}
|
|
|
|
|
2016-09-13 11:30:00 +00:00
|
|
|
BoundingBox get_extents(const Polygon &poly)
|
|
|
|
{
|
|
|
|
return poly.bounding_box();
|
|
|
|
}
|
|
|
|
|
|
|
|
BoundingBox get_extents(const Polygons &polygons)
|
|
|
|
{
|
|
|
|
BoundingBox bb;
|
|
|
|
if (! polygons.empty()) {
|
|
|
|
bb = polygons.front().bounding_box();
|
|
|
|
for (size_t i = 1; i < polygons.size(); ++ i)
|
|
|
|
bb.merge(polygons[i]);
|
|
|
|
}
|
|
|
|
return bb;
|
|
|
|
}
|
|
|
|
|
2016-10-20 11:04:23 +00:00
|
|
|
static inline bool is_stick(const Point &p1, const Point &p2, const Point &p3)
|
|
|
|
{
|
|
|
|
Point v1 = p2 - p1;
|
|
|
|
Point v2 = p3 - p2;
|
|
|
|
int64_t dir = int64_t(v1.x) * int64_t(v2.x) + int64_t(v1.y) * int64_t(v2.y);
|
|
|
|
if (dir > 0)
|
|
|
|
// p3 does not turn back to p1. Do not remove p2.
|
|
|
|
return false;
|
|
|
|
double l2_1 = double(v1.x) * double(v1.x) + double(v1.y) * double(v1.y);
|
|
|
|
double l2_2 = double(v2.x) * double(v2.x) + double(v2.y) * double(v2.y);
|
|
|
|
if (dir == 0)
|
|
|
|
// p1, p2, p3 may make a perpendicular corner, or there is a zero edge length.
|
|
|
|
// Remove p2 if it is coincident with p1 or p2.
|
|
|
|
return l2_1 == 0 || l2_2 == 0;
|
|
|
|
// p3 turns back to p1 after p2. Are p1, p2, p3 collinear?
|
|
|
|
// Calculate distance from p3 to a segment (p1, p2) or from p1 to a segment(p2, p3),
|
|
|
|
// whichever segment is longer
|
|
|
|
double cross = double(v1.x) * double(v2.y) - double(v2.x) * double(v1.y);
|
|
|
|
double dist2 = cross * cross / std::max(l2_1, l2_2);
|
|
|
|
return dist2 < EPSILON * EPSILON;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool remove_sticks(Polygon &poly)
|
|
|
|
{
|
|
|
|
bool modified = false;
|
|
|
|
size_t j = 1;
|
|
|
|
for (size_t i = 1; i + 1 < poly.points.size(); ++ i) {
|
|
|
|
if (! is_stick(poly[j-1], poly[i], poly[i+1])) {
|
|
|
|
// Keep the point.
|
|
|
|
if (j < i)
|
|
|
|
poly.points[j] = poly.points[i];
|
|
|
|
++ j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (++ j < poly.points.size()) {
|
|
|
|
poly.points[j-1] = poly.points.back();
|
|
|
|
poly.points.erase(poly.points.begin() + j, poly.points.end());
|
|
|
|
modified = true;
|
|
|
|
}
|
|
|
|
while (poly.points.size() >= 3 && is_stick(poly.points[poly.points.size()-2], poly.points.back(), poly.points.front())) {
|
|
|
|
poly.points.pop_back();
|
|
|
|
modified = true;
|
|
|
|
}
|
|
|
|
while (poly.points.size() >= 3 && is_stick(poly.points.back(), poly.points.front(), poly.points[1]))
|
|
|
|
poly.points.erase(poly.points.begin());
|
|
|
|
return modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool remove_sticks(Polygons &polys)
|
|
|
|
{
|
|
|
|
bool modified = false;
|
|
|
|
size_t j = 0;
|
|
|
|
for (size_t i = 0; i < polys.size(); ++ i) {
|
|
|
|
modified |= remove_sticks(polys[i]);
|
|
|
|
if (polys[i].points.size() >= 3) {
|
|
|
|
if (j < i)
|
|
|
|
std::swap(polys[i].points, polys[j].points);
|
|
|
|
++ j;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (j < polys.size())
|
|
|
|
polys.erase(polys.begin() + j, polys.end());
|
|
|
|
return modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool remove_degenerate(Polygons &polys)
|
|
|
|
{
|
|
|
|
bool modified = false;
|
|
|
|
size_t j = 0;
|
|
|
|
for (size_t i = 0; i < polys.size(); ++ i) {
|
|
|
|
if (polys[i].points.size() >= 3) {
|
|
|
|
if (j < i)
|
|
|
|
std::swap(polys[i].points, polys[j].points);
|
|
|
|
++ j;
|
|
|
|
} else
|
|
|
|
modified = true;
|
|
|
|
}
|
|
|
|
if (j < polys.size())
|
|
|
|
polys.erase(polys.begin() + j, polys.end());
|
|
|
|
return modified;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool remove_small(Polygons &polys, double min_area)
|
|
|
|
{
|
|
|
|
bool modified = false;
|
|
|
|
size_t j = 0;
|
|
|
|
for (size_t i = 0; i < polys.size(); ++ i) {
|
|
|
|
if (polys[i].area() >= min_area) {
|
|
|
|
if (j < i)
|
|
|
|
std::swap(polys[i].points, polys[j].points);
|
|
|
|
++ j;
|
|
|
|
} else
|
|
|
|
modified = true;
|
|
|
|
}
|
|
|
|
if (j < polys.size())
|
|
|
|
polys.erase(polys.begin() + j, polys.end());
|
|
|
|
return modified;
|
|
|
|
}
|
|
|
|
|
2013-07-16 19:04:14 +00:00
|
|
|
}
|