I have game where there can be arbitrary lines, these lines can overlap. I want to find out first if there are any enclosed shapes created by overlapping lines, and then I want to fill the enclosed shape.
The best guess I have at doing this comes from this other post: determine if a set of tiles on a grid forms and enclosed shape. From what I can gather this would be, given a graph you can detect loops. However I can't quite figure out how to construct the graph from my data.
Is this a good way to go about solving this problem? And if so, any pointers on how I might get there given a list of collisions?