Curve loop is not closed with overlapping lines
I'm trying to convert an SVG filled path into a mesh with the Python API. The surface is defined in red exemplified on the first picture below.
The second picture has a simpler equivalent shape, which shows what I'm trying to accomplish. It's basically a single line loop that encloses the surface area and goes in and out to make a triangular hole, causing an overlap of lines (lines 6 and 10). When I try to make a curve loop, following exception occurs.
Error : Curve loop is not closed
Traceback (most recent call last):
File "~/Documents/Kicad_parsing/misc/test_zone_surface.py", line 99, in <module>
line_loop = kernel.add_curve_loop(lines_to_loop)
File "~/.local/lib/python3.10/site-packages/gmsh.py", line 6955, in addCurveLoop
raise Exception(logger.getLastError())
Exception: Curve loop is not closed
Is there a way to automatically accomplish the same effect in Gmsh as the SVG without deleting the overlapping lines?
If not, can someone give a suggestion to deal with those lines?