I have an ordered list of 3D points P1, ..., Pn that compose the vertices of a polygon. It is NOT assumed that the polygon is planar.
I need to determine whether a 3D point P is contained in the polygon (either on one of the edges or inside). Is it mathematically correct to proceed as follows?
- Every sequence of 3 consecutive points Pi-1, Pi, Pi+1 define a planar triangle. I can use, e.g., the method described in Check whether a point is within a 3D Triangle to determine whether the point is in in the triangle.
- A point P is contained in the polygon if it is contained in one of the triangles composing the polygon.
Corollary questions: If the above method is correct
- Are there more efficient ways to compute this?
- Can the above method be used to compute the area of the polygon? In other words, is the area of the polygon equal to the sum of the areas of the composing triangles?