there are functions to compute the result of the intersection between two polygons, but there is no test function that returns a boolean result.
So you were right, one way to detects if two polygons intersect is to use the isEmpty() methods, that will tell you if the result of the operation contains a polygon or not.
I hope this answer your question ?
regards,
David
Last edit: David Legland 2013-10-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I've just started to check out javaGeom, and after a quick look, I didn't find an intersects() method for SimplePolygon2D.
I did see that Polygons2D has an intersection() method. Perhaps this would return null or a degenerate Polygon2D if the arguments don't intersect?
What's the best way to determine if two polygons intersect?
Hi dezzroy,
there are functions to compute the result of the intersection between two polygons, but there is no test function that returns a boolean result.
So you were right, one way to detects if two polygons intersect is to use the isEmpty() methods, that will tell you if the result of the operation contains a polygon or not.
I hope this answer your question ?
regards,
David
Last edit: David Legland 2013-10-03
Yes, I understand, thanks.