Subject: CGAL users discussion list
List archive
- From: Sandeep Dey <>
- To:
- Subject: Re: [cgal-discuss] Segment Inside a Polygon
- Date: Thu, 2 Feb 2012 23:37:42 +0100
Hi Prateek,
It is written in the manual:
The function bounded_side_2 computes if a point lies inside a polygon. The polygon is defined by the sequence of points first. . . last. Being inside is defined by the odd-even rule. If we take a ray starting at the point and extending to infinity (in any direction), we count the number of intersections. If this number is odd, the point is inside, otherwise it is outside.
So if we write a similar function in which the ray is in the direction of other end point, then depending on the number of intersection up to the other end point we can decide if the line segment is inside or not.
May be there are other existing possible solutions.
Best regards,
Sandeep.
Hi Prateek,
The function CGAL::bounded_side_2 computes if a point lies inside a polygon. Please check the reference manual for its usage.
#include <CGAL/Polygon_2_algorithms.h>
An example of how to use this function is also given in the Polygon chapter of the CGAL Manual.
Hope this helps.
Best regards,
Sandeep.
On Thu, Feb 2, 2012 at 8:06 PM, pgiitu <> wrote:
Hello
I am new to CGAl and I need to check whether there is a way to check if a
line segment lies completely inside a polygon or not.
The file intersection.h in CGAL offers intersection of line vs live,
triangle vs line and many more options but not a polygon.
Can anyone help me?
--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/Segment-Inside-a-Polygon-tp4352456p4352456.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] Segment Inside a Polygon, pgiitu, 02/02/2012
- Re: [cgal-discuss] Segment Inside a Polygon, Sandeep Dey, 02/02/2012
- Re: [cgal-discuss] Segment Inside a Polygon, Sandeep Dey, 02/02/2012
- [cgal-discuss] Re: Segment Inside a Polygon, pgiitu, 02/03/2012
- Re: [cgal-discuss] Re: Segment Inside a Polygon, Sandeep Dey, 02/03/2012
- Re: [cgal-discuss] Re: Segment Inside a Polygon, Sebastien Loriot (GeometryFactory), 02/03/2012
- [cgal-discuss] Re: Segment Inside a Polygon, pgiitu, 02/03/2012
- [cgal-discuss] Re: Segment Inside a Polygon, pgiitu, 02/03/2012
- [cgal-discuss] Re: Segment Inside a Polygon, pgiitu, 02/03/2012
- Re: [cgal-discuss] Re: Segment Inside a Polygon, Sebastien Loriot (GeometryFactory), 02/03/2012
- Re: [cgal-discuss] Re: Segment Inside a Polygon, Sandeep Dey, 02/03/2012
- [cgal-discuss] Re: Segment Inside a Polygon, pgiitu, 02/03/2012
- Re: [cgal-discuss] Segment Inside a Polygon, Sandeep Dey, 02/02/2012
- Re: [cgal-discuss] Segment Inside a Polygon, Sandeep Dey, 02/02/2012
Archive powered by MHonArc 2.6.16.