X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FcreeZoneDefautDansObjetSain.py;h=a1cd1e710f6535d45e7b4af6b60091d4e86ac9e5;hb=8d297d6698f361d4f2dde723050bcfbaea050920;hp=edd6855dbb0528a1b8c70fb561653cce933c42d5;hpb=5d68554076bbca0e1e95fb0db215a6c2b84b6c54;p=modules%2Fsmesh.git diff --git a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py index edd6855db..a1cd1e710 100644 --- a/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py +++ b/src/Tools/blocFissure/gmu/creeZoneDefautDansObjetSain.py @@ -1,16 +1,16 @@ # -*- coding: utf-8 -*- import logging -from geomsmesh import smesh +from .geomsmesh import smesh import SMESH import SALOMEDS -from creeZoneDefautMaillage import creeZoneDefautMaillage -from peauInterne import peauInterne -from quadranglesToShape import quadranglesToShape -from creeZoneDefautFilling import creeZoneDefautFilling -from creeZoneDefautGeom import creeZoneDefautGeom -from getCentreFondFiss import getCentreFondFiss +from .creeZoneDefautMaillage import creeZoneDefautMaillage +from .peauInterne import peauInterne +from .quadranglesToShapeNoCorner import quadranglesToShapeNoCorner +from .creeZoneDefautFilling import creeZoneDefautFilling +from .creeZoneDefautGeom import creeZoneDefautGeom +from .getCentreFondFiss import getCentreFondFiss # ----------------------------------------------------------------------------- # --- @@ -18,11 +18,9 @@ from getCentreFondFiss import getCentreFondFiss def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, shapeFissureParams, maillageFissureParams): """ - TODO: a compléter + #TODO: a compléter """ logging.info('start') - - #smesh.SetCurrentStudy(salome.myStudy) geometrieSaine = geometriesSaines[0] maillageSain = maillagesSains[0] @@ -32,10 +30,10 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, coordsNoeudsFissure = shapesFissure[3] isElliptique = False - if shapeFissureParams.has_key('elliptique'): + if 'elliptique' in shapeFissureParams: isElliptique = shapeFissureParams['elliptique'] if isElliptique: - if shapeFissureParams.has_key('demiGrandAxe'): + if 'demiGrandAxe' in shapeFissureParams: demiGrandAxe = shapeFissureParams['demiGrandAxe'] else: demiGrandAxe = shapeFissureParams['longueur'] @@ -59,10 +57,10 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, [origShapes, verticesShapes, dmoyen] = \ creeZoneDefautMaillage(maillagesSains, shapeDefaut, tailleDefaut, nomZones, coordsNoeudsFissure) - maillageSain.ExportMED( fichierMaillageSain, 0, SMESH.MED_V2_2, 1 ) + maillageSain.ExportMED(fichierMaillageSain) logging.debug("fichier maillage sain %s", fichierMaillageSain) [maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges] = \ - peauInterne(fichierMaillageSain, nomZones) + peauInterne(fichierMaillageSain, shapeDefaut, nomZones) facesDefaut = [] centresDefaut = [] @@ -71,7 +69,9 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, isPlane = False if isHexa and not isPlane: meshQuad = smesh.CopyMesh( zoneDefaut_skin, 'meshQuad', 0, 0) - fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShape(meshQuad, shapeFissureParams, centreFondFiss) + + fillings, noeuds_bords, bordsPartages, fillconts, idFilToCont = quadranglesToShapeNoCorner(meshQuad, shapeFissureParams, centreFondFiss) + for filling in fillings: [faceDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \ creeZoneDefautFilling(filling, shapeDefaut, lgExtrusion) @@ -82,11 +82,11 @@ def creeZoneDefautDansObjetSain(geometriesSaines, maillagesSains, shapesFissure, else: [facesDefaut, centreDefaut, normalDefaut, extrusionDefaut] = \ creeZoneDefautGeom( geometrieSaine, shapeDefaut, origShapes, verticesShapes, dmoyen, lgExtrusion) - bordsPartages =[] + bordsPartages = [] for face in facesDefaut: bordsPartages.append([None,None]) # TODO : traitement des arêtes vives ? fillconts = facesDefaut - idFilToCont = range(len(facesDefaut)) + idFilToCont = list(range(len(facesDefaut))) return [facesDefaut, centresDefaut, normalsDefaut, extrusionsDefaut, dmoyen, bordsPartages, fillconts, idFilToCont, maillageSain, internalBoundary, zoneDefaut, zoneDefaut_skin, zoneDefaut_internalFaces, zoneDefaut_internalEdges,