CGAL: Polygon overlap test
up vote
0
down vote
favorite
I am looking for a function which tests whether in 2D a simple polygon completely contains another simple polygon. do_intersect
as mentioned here, returns true even if polygons are partially overlapping. What is the appropriate function to check complete overlap?
c++ cgal
add a comment |
up vote
0
down vote
favorite
I am looking for a function which tests whether in 2D a simple polygon completely contains another simple polygon. do_intersect
as mentioned here, returns true even if polygons are partially overlapping. What is the appropriate function to check complete overlap?
c++ cgal
Not sure what the exact capabiliites of cgal are, but things that could work: is the symmetric difference of the polygons equal to their difference? Or is the intersection of the polygons equal to the second polygon?
– jakub_d
Nov 7 at 15:25
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am looking for a function which tests whether in 2D a simple polygon completely contains another simple polygon. do_intersect
as mentioned here, returns true even if polygons are partially overlapping. What is the appropriate function to check complete overlap?
c++ cgal
I am looking for a function which tests whether in 2D a simple polygon completely contains another simple polygon. do_intersect
as mentioned here, returns true even if polygons are partially overlapping. What is the appropriate function to check complete overlap?
c++ cgal
c++ cgal
edited Nov 7 at 13:28
asked Nov 7 at 13:22
Shibli
2,42974095
2,42974095
Not sure what the exact capabiliites of cgal are, but things that could work: is the symmetric difference of the polygons equal to their difference? Or is the intersection of the polygons equal to the second polygon?
– jakub_d
Nov 7 at 15:25
add a comment |
Not sure what the exact capabiliites of cgal are, but things that could work: is the symmetric difference of the polygons equal to their difference? Or is the intersection of the polygons equal to the second polygon?
– jakub_d
Nov 7 at 15:25
Not sure what the exact capabiliites of cgal are, but things that could work: is the symmetric difference of the polygons equal to their difference? Or is the intersection of the polygons equal to the second polygon?
– jakub_d
Nov 7 at 15:25
Not sure what the exact capabiliites of cgal are, but things that could work: is the symmetric difference of the polygons equal to their difference? Or is the intersection of the polygons equal to the second polygon?
– jakub_d
Nov 7 at 15:25
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
You can use do_intersect()
function first and if you have no intersection take any point for P1 and check whether it is inside P2 using has_on_bounded_side()
. Then if P1 is not included in P2, do same for a point of P2 with reference to P1 in order to conclude.
add a comment |
up vote
0
down vote
A convex polygon is completely contained in another convex polygon if and only all its vertices are contained inside the containing polygon.
To test if a point is contained inside the polygon you can use the OpenCV function pointPolygonTest() (see description here) (see example use here)
I am looking for a solution in CGAL context though.
– Shibli
Nov 7 at 13:59
Can't you use something from doc.cgal.org/latest/Point_set_2/… ?
– Cristi
Nov 7 at 14:22
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You can use do_intersect()
function first and if you have no intersection take any point for P1 and check whether it is inside P2 using has_on_bounded_side()
. Then if P1 is not included in P2, do same for a point of P2 with reference to P1 in order to conclude.
add a comment |
up vote
1
down vote
You can use do_intersect()
function first and if you have no intersection take any point for P1 and check whether it is inside P2 using has_on_bounded_side()
. Then if P1 is not included in P2, do same for a point of P2 with reference to P1 in order to conclude.
add a comment |
up vote
1
down vote
up vote
1
down vote
You can use do_intersect()
function first and if you have no intersection take any point for P1 and check whether it is inside P2 using has_on_bounded_side()
. Then if P1 is not included in P2, do same for a point of P2 with reference to P1 in order to conclude.
You can use do_intersect()
function first and if you have no intersection take any point for P1 and check whether it is inside P2 using has_on_bounded_side()
. Then if P1 is not included in P2, do same for a point of P2 with reference to P1 in order to conclude.
answered Nov 7 at 16:09
sloriot
3,7841122
3,7841122
add a comment |
add a comment |
up vote
0
down vote
A convex polygon is completely contained in another convex polygon if and only all its vertices are contained inside the containing polygon.
To test if a point is contained inside the polygon you can use the OpenCV function pointPolygonTest() (see description here) (see example use here)
I am looking for a solution in CGAL context though.
– Shibli
Nov 7 at 13:59
Can't you use something from doc.cgal.org/latest/Point_set_2/… ?
– Cristi
Nov 7 at 14:22
add a comment |
up vote
0
down vote
A convex polygon is completely contained in another convex polygon if and only all its vertices are contained inside the containing polygon.
To test if a point is contained inside the polygon you can use the OpenCV function pointPolygonTest() (see description here) (see example use here)
I am looking for a solution in CGAL context though.
– Shibli
Nov 7 at 13:59
Can't you use something from doc.cgal.org/latest/Point_set_2/… ?
– Cristi
Nov 7 at 14:22
add a comment |
up vote
0
down vote
up vote
0
down vote
A convex polygon is completely contained in another convex polygon if and only all its vertices are contained inside the containing polygon.
To test if a point is contained inside the polygon you can use the OpenCV function pointPolygonTest() (see description here) (see example use here)
A convex polygon is completely contained in another convex polygon if and only all its vertices are contained inside the containing polygon.
To test if a point is contained inside the polygon you can use the OpenCV function pointPolygonTest() (see description here) (see example use here)
answered Nov 7 at 13:45
Cristi
1801314
1801314
I am looking for a solution in CGAL context though.
– Shibli
Nov 7 at 13:59
Can't you use something from doc.cgal.org/latest/Point_set_2/… ?
– Cristi
Nov 7 at 14:22
add a comment |
I am looking for a solution in CGAL context though.
– Shibli
Nov 7 at 13:59
Can't you use something from doc.cgal.org/latest/Point_set_2/… ?
– Cristi
Nov 7 at 14:22
I am looking for a solution in CGAL context though.
– Shibli
Nov 7 at 13:59
I am looking for a solution in CGAL context though.
– Shibli
Nov 7 at 13:59
Can't you use something from doc.cgal.org/latest/Point_set_2/… ?
– Cristi
Nov 7 at 14:22
Can't you use something from doc.cgal.org/latest/Point_set_2/… ?
– Cristi
Nov 7 at 14:22
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53190342%2fcgal-polygon-overlap-test%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Not sure what the exact capabiliites of cgal are, but things that could work: is the symmetric difference of the polygons equal to their difference? Or is the intersection of the polygons equal to the second polygon?
– jakub_d
Nov 7 at 15:25