-# Copyright (C) 2014-2016 EDF R&D
+# Copyright (C) 2014-2019 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
import math, Config
from salome.geom import geomBuilder
-geompy = geomBuilder.New( Config.theStudy )
+geompy = geomBuilder.New()
def Go(GeoObj, CutPlnLst, OutLvlLst, PrefixLst, Publish):
NumCuts = CheckInput(CutPlnLst, OutLvlLst, PrefixLst, 1)
OrigType = FindStandType(GeoObj,0)
- InvDictionary = dict((v,k) for k, v in geompy.ShapeType.items()) # Give geometry type name as a function of standard type numbering, ex: 4=FACE, 6=EDGE, 7=VERTEX
+ InvDictionary = {v: k for k, v in geompy.ShapeType.items()} # Give geometry type name as a function of standard type numbering, ex: 4=FACE, 6=EDGE, 7=VERTEX
TrimSize = geompy.BasicProperties(GeoObj)[0]*100
CutPlane = [] ; Sections = [] ; Parts = []
NumCuts = CheckInput(CutPlnLst, OutLvlLst, PrefixLst, 0)
OrigType = FindStandType(GeoObj,0)
- InvDictionary = dict((v,k) for k, v in geompy.ShapeType.items()) # Give geometry type name as a function of standard type numbering, ex: 4=FACE, 6=EDGE, 7=VERTEX
+ InvDictionary = {v: k for k, v in geompy.ShapeType.items()} # Give geometry type name as a function of standard type numbering, ex: 4=FACE, 6=EDGE, 7=VERTEX
CutPlane = [] ; Sections = [] ; Parts = []
if NumCuts:
for i in range(0, NumCuts): # Loop over the cutting planes to create them one by one