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)
# --- 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)
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:
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
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()
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
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, \
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
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)
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"])
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)