gmsh.model.occ.removeAllDuplicates() throws an error if there is nothing to remove since gmsh 4.7
Hi all, I've been using gmsh python API for quite a long time to build my bridge from CAD to mesh. Since the CAD inputs are sometimes exported from assemblies (thus there may be overlapped surfaces), I have to perform a coherence operation to ensure different parts have identical mesh vertice on their boundaries.
Previously, I call gmsh.model.occ.removeAllDuplicates()
after loading a *.stp
file, regardless of whether the import is an assembly or not. The code worked well untill I ungraded the SDK to gmsh 4.7.
In version 4.7 and above, the gmsh.model.occ.removeAllDuplicates()
throws an error if the imported shape has only one part, while everything goes as usual if the input is an assembly containing multiple parts (i.e. containing indenpente volumes with overlapped interfaces). It looks like gmsh.model.occ.removeAllDuplicates()
throws an error if there is nothing to remove. I have tested versions 4.7, 4.8, and 4.9, and the behaviors were identical.
I am not sure whether this is the intended behavior of the newer versions. Would someone please kindly show me the best practice ensuring to remove identical surfaces without prior Knowledge about the input topologic?
Of course, it's also quite reasonable if we firstly check the necessity before actually calling removeAllDuplicates()
. I looked up the new document but didn't found any clue about ensuring a safe call to removeAllDuplicates()
.