Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] problem with is_simple() for polygon

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] problem with is_simple() for polygon


Chronological Thread 
  • From: "Ophir Setter" <>
  • To:
  • Subject: Re: [cgal-discuss] problem with is_simple() for polygon
  • Date: Thu, 15 Nov 2007 20:38:05 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=EVAYUrrxwc7fF5g1a+GAoOJWAd515z3r7MvhiAMAKRmo5UrLMQ5dT4VUSoklHB+RFqG5nQkj3ZLmShYVlGhFeagoqHspcROUNmeNko8x+eUTKXKtCpRG5zifrYeJrzv/NOlxoRzusWVkOUZ+KKHR6d6fPhUcjfTyc+AWtL6B4C8=

Just a guess. Try:
2/1 5/1
15/10 35/10
3/1 3/1
35/10 4/10

Instead of:
2/1 5/1
1.5/1 3.5/1
3/1 3/1
3.5/1 4/1


On Nov 15, 2007 8:15 PM, <> wrote:
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?
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss




Archive powered by MHonArc 2.6.16.

Top of Page