OpenCASCADE duplicates Surface/Line/Point's when a Surface Loop is generated
While using the OpenCASCADE geometry kernel to define more complex polyhedra, the basic elements are duplicated when creating a volume. In the attached example, the points, lines, and surfaces, are all copied with higher element tags. This can cause many problems, but mainly makes automated scripting of geometry definitions difficult.openBug.geo
Indeed, this is a known bug with the 'Surface' command: see http://gitlab.onelab.info/gmsh/gmsh/blob/master/Geo/GModelIO_OCC.cpp#L1223.
('Plane Surface' for example will not produce duplicates.)
As a workaround you can apply a BooleanFragments command at the end, which will remove the duplicates.
Leaving open until we find a better solution. Help from OpenCascade specialists is welcomed!
Note that with your test case you will end up with duplicates even with "Plane Surface", as you explicitly
- create duplicated curves to build your surfaces
- and the surfaces orientation are fixed automatically to make the volume "finite"
So in this particular case you will always need to apply BooleanFragments to merge duplicates. Attached is a corrected version of your geometry: