I have a dxf drawing and I want to find the number of regions which have closed loops. For Example: The below picture has two closed loops. I want to detect that this drawing has 2 closed loops.
I am using ezdxf library in Python. If I use the inherent function (.isclosed) it will check for each entity individually. In the below figure, the inner loop consists of multiple entities (lines and curves) and this fails to get detected. How to overcome this issue i.e it should detect closed loops irrespective of the number of entities.
Two Bounded Regions