How to discover the intersection point between two ofPath or ofPolygon?

how to discover a point where the intersection between a line and an ofPath or ofPolygon occour?
Thanks

You can create complex data structures if you’re doing it a lot and running into computational limitations, but a brute force might be fine for your applications. One quick and dirty way would be to look at each line-segment of a polygon (e.g. p[0]->p[1], p[1]->p[2], etc) and see if it intersects with the line you’d like to test. You can use this function http://www.openframeworks.cc/documentation/math/ofMath.html#show_ofLineSegmentIntersection