I have a 2D drawing with many straight lines. All those lines are mathematically known. And they are independent of the others.
You can consider I know start and end point of each line and I can make them intersect to find all intersection points. (In detail, they are in Autocad, but I can only work via code. So, I want an Algorythm more than an Autocad solution, although Autocad solution is welcome as well).
The problem is: given a point (anywhere), I want to find the smaller polygon that contains it. That polygon would be formed by the nearest lines.
Details:
I have no declared polygons. Just lines. Any number of lines, any size, any position. And a given point.
Those lines may form one polygon, many or none. So there's no rule to what the polygons looks like. Any number of sides, no regularity. (The points that form the polygons are found by intersecting the lines. And the lines are finite, if they don't intersect, they don't form a polygon.)
My answer is the smallest polygon possible containing a given point.