Just to be sure, attached is a simple JPEG of what I would like to accomplish. I would like to calculate the actual point between P0 and P1 that intersects the polygon.
Hello everyone. I am new to this forum and have a simple question (at least I hope it is simple).
I have a segment defined by two points (P0 and P1) and a convex polygon defined by a set of vertices n. I would like to know how to find the point of intersection (if it exists) for the segment and the convex polygon - can anyone help me?
BTW, the points for both the segment and the convex polygon are defined in X, Y, and Z coordinate space and the segment could be parallel to the plane containing the convex polygon.
This is complicated but it is the simplest way I can think of. Each of the sides of the polygon can be written as a linear equation. You can check to determine if one of the points is "inside" the polygon and the other "outside
(if an edge is ax+ by+ c= 0, then and are on the same side if has the same sign as .) Once you have determined that the two points are outside and inside the polygon you can determine where the line between them intersect a side.