Given a shape (e.g., a rectangle, a circle, etc.), how to divide it by $n$ randomly chosen lines. It is trivial to plot those lines (see figure below), using code like
Graphics[Table[{Hue[RandomReal[]], Opacity[0.8],
InfiniteLine[RandomReal[{-1, 1}, {2, 2}]]}, {49}],
PlotRange -> {{-1, 1}, {-1, 1}}, Frame -> True]
But how to extract the (many) regions in the figure? There are some posts doing similar things to an image (https://community.wolfram.com/groups/-/m/t/388948), but I am not sure how to do that to geometric shapes. Thanks!