surface from curve loop: wrong error message, and too late as well
The following code as a wrong definition of edges in the curve loop (it should be e[2]
, not -e[2]
). Unfortunately, no error is thrown in curve loop, but later on when trying to generate a surface from it. It's also quite misleading.
import gmsh
gmsh.initialize()
p = [
gmsh.model.geo.addPoint(0.0, 0.0, 0.0),
gmsh.model.geo.addPoint(1.0, 0.0, 0.0),
gmsh.model.geo.addPoint(0.0, 1.0, 0.0),
]
e = [
gmsh.model.geo.addLine(p[0], p[1]),
gmsh.model.geo.addLine(p[1], p[2]),
gmsh.model.geo.addLine(p[2], p[0]),
]
ll = gmsh.model.geo.addCurveLoop([e[0], e[1], -e[2]])
gmsh.model.geo.addSurfaceFilling([ll])
Traceback (most recent call last):
File "k.py", line 27, in <module>
gmsh.model.geo.addSurfaceFilling([ll])
File "/usr/local/lib/gmsh.py", line 3581, in addSurfaceFilling
raise Exception(logger.getLastError())
Exception: Wrong definition of surface 1: 2 borders instead of 3 or 4