Hi, I wonder whether there is a way in code to detect whether a polygon (stored as PoolVector2Array) self-intersects. The Geometry singleton does not seem to have a function for this.
I tried:
func isSelfIntersecting(polygon: PoolVector2Array) -> bool:
#returns true if the polygon intersects itself.This does NOT WORK.
var ints = Geometry.intersect_polyline_with_polygon_2d(polygon, polygon).size()
return ints > 0
Am I doing something wrong, or is there a method somewhere I missed?