Surface tags of OCC volume reassigned after transformation
Hi,
I'm rotating/translating OpenCASCADE volumes, suing the python api, and trying to keep track of the surfaces so they can be used in Physical Groups. When I transform a single volume and it is the only volume in the model, the surface tags in the model remain unchanged. When I transform a single volume but there are other volumes in the model, the surface tags are reassigned (in the same order as they were assigned) to the next values above the surface tags in the second volume. For example:
import gmsh
model = gmsh.model
factory = model.occ
mesh = model.mesh
gmsh.initialize()
gmsh.option.setNumber("Mesh.CharacteristicLengthMax", 0.2)
gmsh.model.add("Example")
vol = factory.addCylinder(0,0,0,0,0,1,0.5,tag=-1) # create volumes
vol2 = factory.addCylinder(0,0,1,0,0,1,0.5,tag=-1)
factory.synchronize()
print(model.getEntities(2)) # get the tags of the surfaces
factory.translate([(3, vol)], 2, 0, 0) # translate one volume
factory.synchronize()
print(model.getEntities(2)) # get the new tags of the surfaces
gmsh.finalize()
This outputs
[(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6)]
[(2, 4), (2, 5), (2, 6), (2, 7), (2, 8), (2, 9)]
where the first volume's surface tags have been increased to 7, 8, 9.
Is this intended, and if so is there a suggested workaround?
Apologies if this has been answered or is clear in the documentation.