[Gmsh] python-api: Problem with signed line-tags with the OCC

Martin Baun mar.baun at gmail.com
Tue Jul 17 16:36:34 CEST 2018


Hallo,

with the following example I got an OCC error "Error   : Unknown
OpenCASCADE curve with tag -4". It seems the is a problem with the sign.
The example works if I use the 'geo' kernel. It also works if I use the occ
kernel and rewrite this example as a *.geo file.
Is this a problem with the python-api?

Best regards
Martin




import sys
sys.path.append('/home/Werkzeuge/gmsh/20180705/build')
import gmsh

model = gmsh.model
factory = model.occ     # do not works
# factory = model.geo   # works

gmsh.initialize(sys.argv)
gmsh.option.setNumber("General.Terminal", 1)
model.add("LineLoop")


lcar = 0.3
p1 = factory.addPoint(0, 0, 0, lcar)
p2 = factory.addPoint(1, 0, 0, lcar)
p3 = factory.addPoint(1, 1, 0, lcar)
p4 = factory.addPoint(0, 1, 0, lcar)
l1 = factory.addLine(p1, p2)
l2 = factory.addLine(p2, p3)
l3 = factory.addLine(p3, p4)
l4 = factory.addLine(p1, p4)  # reverse
ll = factory.addCurveLoop([l1, l2, l3, -l4])
s = factory.addPlaneSurface([ll])


factory.synchronize()
model.mesh.generate(2)
gmsh.write("LineLoop.msh")
gmsh.write("LineLoop.geo_unrolled")
gmsh.finalize()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20180717/d7cc7a78/attachment.html>


More information about the gmsh mailing list