]> SALOME platform Git repositories - modules/smesh.git/blob - src/Tools/blocFissure/gmu/commonSubShapes.py
Salome HOME
Allow saving groups with non-ascii names.
[modules/smesh.git] / src / Tools / blocFissure / gmu / commonSubShapes.py
1 # -*- coding: utf-8 -*-
2
3 import logging
4 from .geomsmesh import geompy
5
6 # -----------------------------------------------------------------------------
7 # --- subShapes communes à deux listes
8
9 def commonSubShapes(obj, sub1, sub2):
10   """
11   liste de subshapes communes
12   """
13   logging.info("start")
14   idsub1 = {}
15   subList = []
16   for s in sub1:
17     idsub1[geompy.GetSubShapeID(obj, s)] = s
18   for s in sub2:
19     idsub = geompy.GetSubShapeID(obj, s)
20     if idsub in list(idsub1.keys()):
21       subList.append(s)
22   logging.debug("subList=%s", subList)
23   return subList