]> SALOME platform Git repositories - modules/smesh.git/blob - src/Tools/blocFissure/gmu/eliminateDoubles.py
Salome HOME
Allow saving groups with non-ascii names.
[modules/smesh.git] / src / Tools / blocFissure / gmu / eliminateDoubles.py
1 # -*- coding: utf-8 -*-
2
3 import logging
4 from .geomsmesh import geompy
5
6 # -----------------------------------------------------------------------------
7 # --- éliminer les doublons d'une liste de subshapes
8
9 def eliminateDoubles(obj, subshapes):
10   """
11   éliminer les doublons d'une liste de subshapes
12   """
13   idsubs = {}
14   for sub in subshapes:
15     subid = geompy.GetSubShapeID(obj, sub)
16     if subid in list(idsubs.keys()):
17       idsubs[subid].append(sub)
18     else:
19       idsubs[subid] = [sub]
20   shortList = []
21   for k, v in idsubs.items():
22     shortList.append(v[0])
23   logging.debug("shortList=%s", shortList)
24   return shortList