POLYGONSELFINTERSECTIONS Find self-intersection points of a polygon.
PTS = polygonSelfIntersections(POLY)
Return the position of self intersection points
[PTS, POS1, POS2] = polygonSelfIntersections(POLY)
Also return the 2 positions of each intersection point (the position
when meeting point for first time, then position when meeting point
for the second time).
[...] = polygonSelfIntersections(POLY, 'tolerance', TOL)
Specifies an additional parameter to decide whether two intersection
points should be considered the same, based on their euclidean
distance.
Example
% use a '8'-shaped polygon
poly = [10 0;0 0;0 10;20 10;20 20;10 20];
polygonSelfIntersections(poly)
ans =
10 10
See also
polygons2d, polylineSelfIntersections
Package: matgeom