X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FsubstractSubShapes.py;h=9f867ebf9ec9363a27b677b3bfd1fae8e33d58fa;hb=93738e779d1a2bd6628e3f545a748ec2a930c695;hp=81c10f37e8f3d2b7ce92618cf922b386ef373ee3;hpb=6d32f944a0a115b6419184c50b57bf7c4eef5786;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/substractSubShapes.py b/src/Tools/blocFissure/gmu/substractSubShapes.py index 81c10f37e..9f867ebf9 100644 --- a/src/Tools/blocFissure/gmu/substractSubShapes.py +++ b/src/Tools/blocFissure/gmu/substractSubShapes.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2014-2019 CEA/DEN, EDF R&D +# Copyright (C) 2014-2021 EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,25 +17,25 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +"""Substract a list of subShapes from another""" import logging -from .geomsmesh import geompy -# ----------------------------------------------------------------------------- -# --- substract a list of subShapes from another +from .geomsmesh import geompy def substractSubShapes(obj, subs, toRemove): - """ - liste de subshapes par difference - """ + """liste de subshapes par difference""" logging.info("start") - idToremove = {} - subList = [] - for s in toRemove: - idToremove[geompy.GetSubShapeID(obj, s)] = s - for s in subs: - idsub = geompy.GetSubShapeID(obj, s) - if idsub not in list(idToremove.keys()): - subList.append(s) + idToremove = dict() + for shape in toRemove: + idToremove[geompy.GetSubShapeID(obj, shape)] = shape + + subList = list() + for shape in subs: + idsub = geompy.GetSubShapeID(obj, shape) + if ( idsub not in idToremove ): + subList.append(shape) + logging.debug("subList=%s", subList) + return subList