Subject: CGAL users discussion list
List archive
- From:
- To:
- Subject: problem with is_simple() for polygon
- Date: Thu, 15 Nov 2007 19:15:47 +0100
I write a code and within it I want to check whether it is simple or not:
Rational x, y;
std::list<Rat_point_2> vertices;
for (j = 0; j < n_vertices; j++)
{
ifile >> x >> y;
vertices.push_back (Rat_point_2 (x, y));
}
Rat_polygon_2 pgn (vertices.begin(), vertices.end());
if (! pgn.is_simple())
{
std::cerr << "Error - Polygon no. " << i + 1
<< " is not simple." << std::endl;
return (false);
}
for a polygon like:
2/1 5/1
1.5/1 3.5/1
3/1 3/1
3.5/1 4/1
the program found it is not simple!!!, I checked the usage of is_simple()
with the one in the example\polygon
and they are similar.
but for a polygon like:
1/1 1/1
1/1 2/1
2/1 2/1
2/1 1/1
the program finds it as simple.
what checks should I do more?
- problem with is_simple() for polygon, nt_mahmood, 11/15/2007
- Re: [cgal-discuss] problem with is_simple() for polygon, Ophir Setter, 11/15/2007
Archive powered by MHonArc 2.6.16.