This is the main idea.
I suppose the problem is somewhat more general, but it will be easier to adapt to your problem: considering a plan containing all the shapes, a point and a set of geometric shapes, we want to remove the area that is not visible from the point from the plan.
We want to get starting_polar and ending_polar points for each shape, which are two points with the minimum and maximum polar angles belonging to the shape.
Now we will remove the form from the plan form and we will remove the quadrilateral formed by the points: starting_polar , ending_polar , and the intersections between the two lines (x, starting_polar) and (x, ending_polar) and the border of the plan .
In your case, the plan will be just a triangle .
source share