X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2FblocFissure%2Fgmu%2FfacesVolumesToriques.py;h=8e85e933e17fb3f361762385dbb8b5861bba3554;hp=af48c95602a502263d0e7569d452b482180a71e7;hb=HEAD;hpb=b24a2d1b7692bdb21cf037b026e0273ba547cef4 diff --git a/src/Tools/blocFissure/gmu/facesVolumesToriques.py b/src/Tools/blocFissure/gmu/facesVolumesToriques.py index af48c9560..a17880dfb 100644 --- a/src/Tools/blocFissure/gmu/facesVolumesToriques.py +++ b/src/Tools/blocFissure/gmu/facesVolumesToriques.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2014-2021 EDF R&D +# Copyright (C) 2014-2024 EDF # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,19 +17,18 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +"""Tore : aces toriques et volumes du tore""" import logging + +from . import initLog + from .geomsmesh import geompy -from .geomsmesh import geomPublish from .geomsmesh import geomPublishInFather -from . import initLog + from .extractionOrientee import extractionOrientee from .getSubshapeIds import getSubshapeIds -# ----------------------------------------------------------------------------- -# --- TORE -# --- faces toriques et volumes du tore - def facesVolumesToriques(tore, plan, facesDefaut): """ Extraction des deux faces et volumes du tore partitionné, qui suivent la génératrice elliptique. @@ -43,28 +42,25 @@ def facesVolumesToriques(tore, plan, facesDefaut): normal = geompy.GetNormal(plan, centre) reference = geompy.MakeTranslationVector(centre, normal) - [facesInPlan, facesOutPlan, facesOnPlan] = extractionOrientee(plan, tore, reference, "FACE", 1.e-2, "faceTorePlan_") - [facesInSide, facesOutSide, facesOnSide] = extractionOrientee(facesDefaut, tore, reference, "FACE", 1.e-2, "faceTorePeau_") + [facesInPlan, facesOutPlan, _] = extractionOrientee(plan, tore, reference, "FACE", 1.e-2, "faceTorePlan_") facesIdInPlan = getSubshapeIds(tore, facesInPlan) facesIdOutPlan = getSubshapeIds(tore, facesOutPlan) + + [_, _, facesOnSide] = extractionOrientee(facesDefaut, tore, reference, "FACE", 1.e-2, "faceTorePeau_") facesIdOnSide = getSubshapeIds(tore, facesOnSide) - facesIdInSide = getSubshapeIds(tore, facesInSide) - facesIdOutSide = getSubshapeIds(tore, facesOutSide) - #facesIdInOutSide = facesIdInSide + facesIdOutSide + facetore1 = None - faceTore2 = None - for i, faceId in enumerate(facesIdInPlan): + for i_aux, faceId in enumerate(facesIdInPlan): if faceId not in facesIdOnSide: - facetore1 = facesInPlan[i] + facetore1 = facesInPlan[i_aux] break - for i, faceId in enumerate(facesIdOutPlan): + geomPublishInFather(initLog.debug, tore, facetore1, 'facetore1' ) + + facetore2 = None + for i_aux, faceId in enumerate(facesIdOutPlan): if faceId not in facesIdOnSide: - facetore2 = facesOutPlan[i] + facetore2 = facesOutPlan[i_aux] break - - #[facetore1,facetore2] = geompy.GetShapesOnShape(pipe0, tore, geompy.ShapeType["FACE"], GEOM.ST_ON) - - geomPublishInFather(initLog.debug, tore, facetore1, 'facetore1' ) geomPublishInFather(initLog.debug, tore, facetore2, 'facetore2' ) [volumeTore1, volumeTore2] = geompy.ExtractShapes(tore, geompy.ShapeType["SOLID"], True)