Nommage - suite

This commit is contained in:
GERALD NICOLAS 2021-04-06 17:59:21 +02:00
parent c018079f7f
commit 93f22a734d
4 changed files with 43 additions and 40 deletions

View File

@ -27,7 +27,8 @@ from .geomsmesh import geompy
from .geomsmesh import geomPublish
from .geomsmesh import geomPublishInFather
def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss):
def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesPipeFiss, \
nro_cas=None):
"""Identification des faces et edges de fissure externe pour maillage"""
logging.info('start')
@ -75,9 +76,10 @@ def identifieFacesEdgesFissureExterne(fsFissuExt, edFisExtPe, edFisExtPi, edgesP
edgesPeauFissureExterneC = geompy.MakeCompound(edgesFissExtPeau)
edgesPipeFissureExterneC = geompy.MakeCompound(edgesFissExtPipe)
geomPublish(initLog.always, faceFissureExterne, "faceFissureExterne", nro_cas)
geomPublishInFather(initLog.always, faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne", nro_cas)
geomPublishInFather(initLog.always, faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne", nro_cas)
wirePipeFissureExterne = geompy.MakeWire(geompy.ExtractShapes(edgesPipeFissureExterneC, geompy.ShapeType["EDGE"], False))
geomPublish(initLog.debug, faceFissureExterne, "faceFissureExterne")
geomPublishInFather(initLog.debug, faceFissureExterne, edgesPeauFissureExterneC, "edgesPeauFissureExterne")
geomPublishInFather(initLog.debug, faceFissureExterne, edgesPipeFissureExterneC, "edgesPipeFissureExterne")
return (faceFissureExterne, edgesPipeFissureExterneC, wirePipeFissureExterne, edgesPeauFissureExterneC)

View File

@ -103,7 +103,7 @@ def insereFissureLongue(geometriesSaines, \
insereFissureLongue_a (facePorteFissure, WirePorteFondFissure, \
fillingFaceExterne, \
pipefiss, rayonPipe, \
mailleur )
mailleur, nro_cas )
# -----------------------------------------------------------------------------
# --- pipe de fond de fissure
pipeFondFiss, disques, rayons, \

View File

@ -40,7 +40,7 @@ from .substractSubShapes import substractSubShapes
def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
fillingFaceExterne, \
pipefiss, rayonPipe, \
mailleur="MeshGems"):
mailleur="MeshGems", nro_cas=None):
"""procedure complete fissure longue"""
logging.info('start')
logging.info("Usage du mailleur %s", mailleur)
@ -51,7 +51,7 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
# --- partition peau defaut - face de fissure prolongee - wire de fond de fissure prolongée
partitionPeauFissFond = geompy.MakePartition([facePorteFissure, WirePorteFondFissure, fillingFaceExterne], list(), list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
geomPublish(initLog.debug, partitionPeauFissFond, 'partitionPeauFissFond' )
geomPublish(initLog.debug, partitionPeauFissFond, 'partitionPeauFissFond', nro_cas )
edges = geompy.ExtractShapes(WirePorteFondFissure, geompy.ShapeType["EDGE"], False)
@ -64,49 +64,49 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
lgmax = longueur
imax = i_aux
edgemax = edges[imax]
geomPublish(initLog.debug, edgemax, 'edgemax')
geomPublish(initLog.debug, edgemax, 'edgemax', nro_cas)
centreFondFiss = geompy.MakeVertexOnCurve(edgemax, 0.5)
geomPublish(initLog.debug, centreFondFiss, 'centreFondFiss')
geomPublish(initLog.debug, centreFondFiss, 'centreFondFiss', nro_cas)
tangentFondFiss = geompy.MakeTangentOnCurve(edgemax, 0.5)
geomPublish(initLog.debug, tangentFondFiss, 'tangentFondFiss')
geomPublish(initLog.debug, tangentFondFiss, 'tangentFondFiss', nro_cas)
bord1FondFiss = geompy.MakeVertexOnCurve(edgemax, 0.0)
geomPublish(initLog.debug, bord1FondFiss, 'bord1FondFiss')
geomPublish(initLog.debug, bord1FondFiss, 'bord1FondFiss', nro_cas)
tangentBord1FondFiss = geompy.MakeTangentOnCurve(edgemax, 0.0)
geomPublish(initLog.debug, tangentBord1FondFiss, 'tangentBord1FondFiss')
geomPublish(initLog.debug, tangentBord1FondFiss, 'tangentBord1FondFiss', nro_cas)
bord2FondFiss = geompy.MakeVertexOnCurve(edgemax, 1.0)
geomPublish(initLog.debug, bord2FondFiss, 'bord2FondFiss')
geomPublish(initLog.debug, bord2FondFiss, 'bord2FondFiss', nro_cas)
tangentBord2FondFiss = geompy.MakeTangentOnCurve(edgemax, 1.0)
geomPublish(initLog.debug, tangentBord2FondFiss, 'tangentBord2FondFiss')
geomPublish(initLog.debug, tangentBord2FondFiss, 'tangentBord2FondFiss', nro_cas)
planBord1 = geompy.MakePlane(bord1FondFiss, tangentBord1FondFiss, 3*rayonPipe)
planBord2 = geompy.MakePlane(bord2FondFiss, tangentBord2FondFiss, 3*rayonPipe)
geomPublish(initLog.debug, planBord1, 'planBord1')
geomPublish(initLog.debug, planBord2, 'planBord2')
geomPublish(initLog.debug, planBord1, 'planBord1', nro_cas)
geomPublish(initLog.debug, planBord2, 'planBord2', nro_cas)
[edgesInside, _, _] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "EDGE", 1.e-3)
[facesInside, _, facesOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissFond, centreFondFiss, "FACE", 1.e-3)
# --- partition peau -face fissure - pipe fond de fissure prolongé
partitionPeauFissByPipe = geompy.MakePartition([facesInside[0], facesOnside[0]], [pipefiss], list(), list(), geompy.ShapeType["FACE"], 0, list(), 0)
geomPublish(initLog.debug, partitionPeauFissByPipe, 'partitionPeauFissByPipe' )
geomPublish(initLog.debug, partitionPeauFissByPipe, 'partitionPeauFissByPipe', nro_cas )
# --- identification face de peau
[facesPeauFissInside, _, facesPeauFissOnside] = extractionOrientee(fillingFaceExterne, partitionPeauFissByPipe, centreFondFiss, "FACE", 0.1, "peauFiss_bord_")
facesPeauSorted, _, _ = sortFaces(facesPeauFissOnside) # 4 demi disques, une grande face
facePeau = facesPeauSorted[-1] # la plus grande face
geomPublishInFather(initLog.debug,partitionPeauFissByPipe, facePeau, "facePeau")
geomPublishInFather(initLog.debug,partitionPeauFissByPipe, facePeau, "facePeau", nro_cas)
# --- identification edges de bord face peau
edgesFilling = geompy.ExtractShapes(fillingFaceExterne, geompy.ShapeType["EDGE"], False)
edgesBords = list()
for i, edge in enumerate(edgesFilling):
for edge in edgesFilling:
edgepeau = geompy.GetInPlace(facePeau, edge)
edgesBords.append(edgepeau)
groupEdgesBordPeau = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesBordPeau, edgesBords)
geomPublishInFather(initLog.debug,facePeau, groupEdgesBordPeau , "EdgesBords")
geomPublishInFather(initLog.debug,facePeau, groupEdgesBordPeau , "EdgesBords", nro_cas)
# --- identification face fissure externe au pipe et edge commune peau fissure
for face in facesPeauFissInside:
@ -115,9 +115,9 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
if sharedEdges is not None:
faceFiss = face
edgePeauFiss = sharedEdges[0]
geomPublishInFather(initLog.debug,partitionPeauFissByPipe, faceFiss, "faceFiss")
geomPublishInFather(initLog.debug,faceFiss, edgePeauFiss, "edgePeauFiss")
geomPublishInFather(initLog.debug,facePeau, edgePeauFiss, "edgePeauFiss")
geomPublishInFather(initLog.debug,partitionPeauFissByPipe, faceFiss, "faceFiss", nro_cas)
geomPublishInFather(initLog.debug,faceFiss, edgePeauFiss, "edgePeauFiss", nro_cas)
geomPublishInFather(initLog.debug,facePeau, edgePeauFiss, "edgePeauFiss", nro_cas)
break
except:
pass
@ -130,16 +130,16 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
verticesDemiCerclesPeau = list()
for i_aux, edge in enumerate(demiCerclesPeau):
name = "demiCerclePeau_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, edge, name)
geomPublishInFather(initLog.debug,facePeau, edge, name, nro_cas)
verticesDemiCerclesPeau += geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], False)
verticesDemiCerclesPeau = eliminateDoubles(facePeau, verticesDemiCerclesPeau)
for i_aux, vertex in enumerate(verticesDemiCerclesPeau):
name = "verticesDemiCerclesPeau_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, vertex, name)
geomPublishInFather(initLog.debug,facePeau, vertex, name, nro_cas)
verticesOutCercles = substractSubShapes(facePeau, verticesDemiCerclesPeau, verticesEdgePeauFiss)
for i_aux, vertex in enumerate(verticesOutCercles):
name = "verticesOutCercles_{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, vertex, name)
geomPublishInFather(initLog.debug,facePeau, vertex, name, nro_cas)
# --- demi cercles regroupés
groupsDemiCerclesPeau = list()
@ -151,7 +151,7 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
group = geompy.CreateGroup(facePeau, geompy.ShapeType["EDGE"])
geompy.UnionList(group, demis)
name = "Cercle{}".format(i_aux)
geomPublishInFather(initLog.debug,facePeau, group , name)
geomPublishInFather(initLog.debug,facePeau, group , name, nro_cas)
groupsDemiCerclesPeau.append(group)
# --- identification edges commune pipe face fissure externe au pipe
@ -162,10 +162,10 @@ def insereFissureLongue_a(facePorteFissure, WirePorteFondFissure, \
if geompy.GetSubShapeID(partitionPeauFissByPipe, edge) != edgePeauFissId:
edgesFaceFissPipe.append(edge)
name = "edgeFaceFissPipe_%d"%len(edgesFaceFissPipe)
geomPublishInFather(initLog.debug,faceFiss, edge, name)
geomPublishInFather(initLog.debug,faceFiss, edge, name, nro_cas)
groupEdgesFaceFissPipe = geompy.CreateGroup(faceFiss, geompy.ShapeType["EDGE"])
geompy.UnionList(groupEdgesFaceFissPipe, edgesFaceFissPipe)
geomPublishInFather(initLog.debug,faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe")
geomPublishInFather(initLog.debug,faceFiss, groupEdgesFaceFissPipe, "edgesFaceFissPipe", nro_cas)
return edgesInside, centreFondFiss, tangentFondFiss, \
planBord1, planBord2, \

View File

@ -32,7 +32,8 @@ from .findWireEndVertices import findWireEndVertices
from .prolongeWire import prolongeWire
from .fissError import fissError
def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe, \
nro_cas=None):
"""
pipe de fond de fissure, prolongé, partition face fissure par pipe
identification des edges communes pipe et face fissure
@ -47,14 +48,14 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
plan = geompy.MakePlane(centreFondFiss, tgtCentre, 10000)
shapeDefaut = geompy.MakePartition([shapeDefaut], [plan], [], [], geompy.ShapeType["FACE"], 0, [], 0)
#fondFissCoupe = geompy.GetInPlaceByHistory(shapeDefaut, fondFiss) #= inutile
geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe')
#geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe')
geomPublish(initLog.debug, shapeDefaut, 'shapeDefaut_coupe', nro_cas)
#geomPublishInFather(initLog.debug,shapeDefaut, fondFissCoupe, 'fondFiss_coupe', nro_cas)
extrem, norms = findWireEndVertices(fondFiss, True)
logging.debug("extrem: %s, norm: %s",extrem, norms)
cercle = geompy.MakeCircle(extrem[0], norms[0], rayonPipe)
cercle = geompy.MakeRotation(cercle, norms[0], math.pi/3.0 ) # éviter d'avoir l'arête de couture du pipe presque confondue avec la face fissure
geomPublish(initLog.debug, cercle, 'cercle')
geomPublish(initLog.debug, cercle, 'cercle', nro_cas)
fondFissProlonge = prolongeWire(fondFiss, extrem, norms, 2*rayonPipe)
try:
pipeFiss = geompy.MakePipe(cercle, fondFissProlonge)
@ -62,24 +63,24 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
texte = "génération du pipe le long de la ligne de fond de fissure prolongée impossible. "
texte += "Cause possible : la ligne s'autointersecte lorsqu'on la prolonge."
raise fissError(traceback.extract_stack(),texte)
geomPublish(initLog.debug, pipeFiss, 'pipeFiss')
geomPublish(initLog.debug, pipeFiss, 'pipeFiss', nro_cas)
partFissPipe = geompy.MakePartition([shapeDefaut, pipeFiss], [], [], [], geompy.ShapeType["FACE"], 0, [], 1)
geomPublish(initLog.debug, partFissPipe, 'partFissPipe')
geomPublish(initLog.debug, partFissPipe, 'partFissPipe', nro_cas)
fissPipe = geompy.GetInPlaceByHistory(partFissPipe, shapeDefaut)
geomPublish(initLog.debug, fissPipe, 'fissPipe')
geomPublish(initLog.debug, fissPipe, 'fissPipe', nro_cas)
partPipe = geompy.GetInPlaceByHistory(partFissPipe, pipeFiss)
geomPublish(initLog.debug, partPipe, 'partPipe')
geomPublish(initLog.debug, partPipe, 'partPipe', nro_cas)
edgesPipeFiss = geompy.GetSharedShapesMulti([fissPipe, partPipe], geompy.ShapeType["EDGE"])
for i_aux, edge in enumerate(edgesPipeFiss):
name = "edgePipe{}".format(i_aux)
geomPublishInFather(initLog.debug,fissPipe, edge, name)
geomPublishInFather(initLog.debug,fissPipe, edge, name, nro_cas)
try:
wirePipeFiss = geompy.MakeWire(edgesPipeFiss)
except:
wirePipeFiss = geompy.MakeCompound(edgesPipeFiss)
logging.debug("wirePipeFiss construit sous forme de compound")
geomPublish(initLog.debug, wirePipeFiss, "wirePipeFiss")
geomPublish(initLog.always, wirePipeFiss, "wirePipeFiss", nro_cas)
wireFondFiss = geompy.GetInPlace(partFissPipe,fondFiss)
edgesFondFiss = geompy.GetSharedShapesMulti([fissPipe, wireFondFiss], geompy.ShapeType["EDGE"])
@ -87,6 +88,6 @@ def partitionneFissureParPipe(shapesFissure, elementsDefaut, rayonPipe):
name = "edgeFondFiss{}".format(i_aux)
geomPublishInFather(initLog.debug,fissPipe, edge, name)
wireFondFiss = geompy.MakeWire(edgesFondFiss)
geomPublish(initLog.debug, wireFondFiss,"wireFondFiss")
geomPublish(initLog.always, wireFondFiss, "wireFondFiss", nro_cas)
return (fissPipe, edgesPipeFiss, edgesFondFiss, wirePipeFiss, wireFondFiss)